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

itrous/bsl-analyzer

Measured 16 November 2026, 23:28 UTC, at code version 884b964

First survey, so nothing to compare with yet
CAI score 65.5out of 100 At risk

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

A very large codebase: 587,181 lines of product code in 49 projects, tests not counted · Estimated rebuild effort: about 7.4 person-years · Weakest lens: Production Readiness, 58.9

Findings by how serious they are

56 critical 2396 serious 167 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 23:28 UTC

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

64of 64 dimensions measured by tools.
2542of 2619 findings point to an exact file and line, so you can open each one in the code. The other 77 concern the repository as a whole, such as missing documentation.
64dimensions across 7 lenses, read from 587,181 lines of product code in 49 projects.
Chapters

Executive summary

itrous/bsl-analyzer is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 65.5 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Production Readiness, at 58.9, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the security flaws the scanner found, worth about 2.8 points. Protecting outgoing calls with timeouts would lift Production Readiness itself, worth about 3.4 points. Raising Production Readiness to 62 would lift the score to about 66.8.

Thirty-seven pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Sixteen weaknesses in the code could be used by an attacker, and three known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version, fixing the weaknesses the scanner points to and updating the vulnerable packages would close these risks.

The product code is 587,181 lines, about €1,100,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 58.9 · counts for 46%Security and Compliance 61.6 · counts for 25%Code Health 70.9 · counts for 14%Maturity 83.9 · counts for 8%Performance 85.0 · counts for 4%Architecture 92.6 · counts for 2%Event Sourcing 100.0 · counts for 1%

If Production Readiness rose from 58.9 to 62, the lowest score rated Strong, the score would rise from 65.5 to about 66.8.

Code composition: what the lines of code are
Product code 77%Tests 23%
Rebuild cost: about €1,100,000 · Estimate
Cost to rebuild€360,000 to €1,800,000, for 5,996 to 19,022 hours of work, about 7.4 person-years for 4 to 15 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 66. 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.
SizeVery large: 587,181 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4).
Raises the score by about 2.8 points · Medium effort · Static Analysis (SAST)
2
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
Raises the score by about 3.5 points · Medium effort · Web-Security Posture
3
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Raises the score by about 3.4 points · Medium effort · Outbound HTTP resilience

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €1,100,000 to build again, about 7.4 person-years of work. Its weakest lens is Production Readiness, at 58.9 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 15 REDACTED finding(s) in Static Analysis (SAST). Of all the actions in this report, it raises the score most for the work it takes: about 2.8 points for medium effort, because it clears the 15 Static Analysis (SAST) findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 539,700 lines over the last 90 days, which is about 2,188,783 lines a year. At that pace, the extra work comes to an estimated 170.5 to 1023.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch base-db base-db bsl-conventions bsl-conventions base-db->bsl-conventions parser parser base-db->parser stdx stdx base-db->stdx syntax syntax base-db->syntax vfs vfs base-db->vfs bsl-analyzer bsl-analyzer bsl-analyzer->base-db bsl-analyzer->bsl-conventions bsl-metadata bsl-metadata bsl-analyzer->bsl-metadata bsl-platform bsl-platform bsl-analyzer->bsl-platform bsl-search bsl-search bsl-analyzer->bsl-search hir hir bsl-analyzer->hir ide ide bsl-analyzer->ide ide-db ide-db bsl-analyzer->ide-db ide-host-core ide-host-core bsl-analyzer->ide-host-core mcp-server mcp-server bsl-analyzer->mcp-server bsl-analyzer->parser project-model project-model bsl-analyzer->project-model bsl-analyzer->stdx bsl-analyzer->syntax bsl-analyzer->vfs bsl-metadata->bsl-conventions bsl-metadata->bsl-platform bsl-metadata->stdx bsl-platform->stdx bsl-search->bsl-conventions bsl-search->project-model bsl-search->stdx bsl-search->syntax hir->base-db hir->bsl-metadata hir->bsl-platform hir-def hir-def hir->hir-def hir-ty hir-ty hir->hir-ty hir->parser hir->stdx hir->syntax hir->vfs hir-def->base-db hir-def->bsl-conventions hir-def->bsl-metadata hir-def->bsl-platform hir-def->parser hir-def->project-model sdbl-hir sdbl-hir hir-def->sdbl-hir hir-def->stdx hir-def->syntax hir-def->vfs hir-ty->base-db hir-ty->bsl-metadata hir-ty->bsl-platform hir-ty->hir-def hir-ty->sdbl-hir hir-ty->stdx hir-ty->syntax hir-ty->vfs ide->bsl-conventions ide->bsl-metadata ide->bsl-platform ide->hir ide->ide-db ide-diagnostics ide-diagnostics ide->ide-diagnostics ide->parser ide->project-model ide->sdbl-hir ide->stdx ide->syntax ide->vfs ide-db->base-db ide-db->bsl-conventions ide-db->bsl-metadata ide-db->bsl-platform ide-db->hir ide-db->parser ide-db->project-model ide-db->sdbl-hir ide-db->stdx ide-db->syntax ide-db->vfs ide-diagnostics->base-db ide-diagnostics->bsl-conventions ide-diagnostics->bsl-metadata ide-diagnostics->bsl-platform ide-diagnostics->hir ide-diagnostics->ide-db ide-diagnostics->parser ide-diagnostics->sdbl-hir ide-diagnostics->stdx ide-diagnostics->syntax ide-diagnostics->vfs ide-host-core->base-db ide-host-core->bsl-conventions ide-host-core->bsl-metadata ide-host-core->bsl-platform ide-host-core->hir ide-host-core->ide ide-host-core->ide-db ide-host-core->project-model ide-host-core->vfs mcp-server->base-db mcp-server->bsl-conventions mcp-server->bsl-metadata mcp-server->bsl-platform mcp-server->bsl-search mcp-server->ide mcp-server->ide-host-core mcp-server->parser mcp-server->project-model mcp-server->sdbl-hir mcp-server->stdx mcp-server->syntax mcp-server->vfs parser->stdx parser->syntax project-model->base-db project-model->bsl-conventions project-model->bsl-metadata project-model->stdx sdbl-hir->base-db sdbl-hir->bsl-metadata sdbl-hir->stdx sdbl-hir->syntax syntax->stdx vfs->stdx __more__ +28 more projects

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.

928 modules, with 3195 dependencies between them. 21 loops run through 78 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 888 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 bsl_metadata.enums2 bsl_platform.types3 bsl_search.workspace_roots4 cfg_types.indices5 cfg_types.local_range6 hir_def.name7 ide_diagnostics.code8 line_index9 onec_client10 sdbl_hir.diagnostics11 syntax.syntax_kind12 vfs13 base_db.input14 bsl_metadata.metadata_object15 bsl_search.engine16 cfg.graph17 hir_def.execution_env18 ide_diagnostics.types19 project_model20 bsl_metadata.register21 bsl_types.kind22 hir_def.body23 hir_def.module_interface24 mcp_server.state25 bsl_metadata.configuration26 hir_def27 hir_def.configs28 hir_def.item_tree29 ide_db.metadata30 hir_ty.infer31 ide_db.database32 ide_db.provider33 ide_db.salsa_provider34 ide_diagnostics.context35 ide_diagnostics.body_context36 ide_diagnostics.handlers.transferring_parameters_between_client_and_server37 ide_diagnostics.config38 ide39 ide_diagnostics.sdbl_utils40 bsl_analyzer.global_state
1 bsl_metadata.enums
2 bsl_platform.types
3 bsl_search.workspace_roots
4 cfg_types.indices
5 cfg_types.local_range
6 hir_def.name
7 ide_diagnostics.code
8 line_index
9 onec_client
10 sdbl_hir.diagnostics
11 syntax.syntax_kind
12 vfs
13 base_db.input1
14 bsl_metadata.metadata_object21
15 bsl_search.engine14
16 cfg.graph1
17 hir_def.execution_env1122
18 ide_diagnostics.types311
19 project_model3
20 bsl_metadata.register24
21 bsl_types.kind1
22 hir_def.body9411
23 hir_def.module_interface41182
24 mcp_server.state132
25 bsl_metadata.configuration141
26 hir_def1132141111133
27 hir_def.configs2313112
28 hir_def.item_tree6115
29 ide_db.metadata33271121
30 hir_ty.infer1532122822121
31 ide_db.database21111273111233194194
32 ide_db.provider1112121111317113
33 ide_db.salsa_provider111412111131711132
34 ide_diagnostics.context21113121121121811312
35 ide_diagnostics.body_context11131321
36 ide_diagnostics.handlers.transferring_parameters_between_client_and_server11221
37 ide_diagnostics.config1132
38 ide421231
39 ide_diagnostics.sdbl_utils1111
40 bsl_analyzer.global_state65131
Uses a module listed above itPart of a loopThe module itself
1 bsl_metadata.enums2 bsl_platform.types3 bsl_search.workspace_roots4 cfg_types.indices5 cfg_types.local_range6 hir_def.name7 ide_diagnostics.code8 line_index9 onec_client10 sdbl_hir.diagnostics11 syntax.syntax_kind12 vfs13 base_db.input14 bsl_metadata.metadata_object15 bsl_search.engine16 cfg.graph17 hir_def.execution_env18 ide_diagnostics.types19 project_model20 bsl_metadata.register21 bsl_types.kind22 hir_def.body23 hir_def.module_interface24 mcp_server.state25 bsl_metadata.configuration26 hir_def27 hir_def.configs28 hir_def.item_tree29 ide_db.metadata30 hir_ty.infer31 ide_db.database32 ide_db.provider33 ide_db.salsa_provider34 ide_diagnostics.context35 ide_diagnostics.body_context36 ide_diagnostics.handlers.transferring_parameters_between_client_and_server37 ide_diagnostics.config38 ide39 ide_diagnostics.sdbl_utils40 bsl_analyzer.global_statebsl_metadata.enums1bsl_platform.types2bsl_search.workspace_roots3cfg_types.indices4cfg_types.local_range5hir_def.name6ide_diagnostics.code7line_index8onec_client9sdbl_hir.diagnostics10syntax.syntax_kind11vfs12base_db.input13bsl_metadata.metadata_object14bsl_search.engine15cfg.graph16hir_def.execution_env17ide_diagnostics.types18project_model19bsl_metadata.register20bsl_types.kind21hir_def.body22hir_def.module_interface23mcp_server.state24bsl_metadata.configuration25hir_def26hir_def.configs27hir_def.item_tree28ide_db.metadata29hir_ty.infer30ide_db.database31ide_db.provider32ide_db.salsa_provider33ide_diagnostics.context34ide_diagnostics.body_context35ide_diagnostics.handlers.transferring_parameters_between_client_and_server36ide_diagnostics.config37ide38ide_diagnostics.sdbl_utils39bsl_analyzer.global_state40121141112231132419411411821321411132141111133231311261153327112115321228221212111127311123319419411121211113171131114121111317111322111312112112181131211131321112211132421231111165131+888 more modules (most-connected shown)

At a glance — Code Health · 70.9 · Adequate · gated by D2 ·

At a glance — Architecture · 92.6 · Exemplary ·

At a glance — Maturity · 83.9 · Exemplary ·

At a glance — Readiness · 58.9 · Adequate · gated by P7 ·

At a glance — Security · 61.6 · Adequate · gated by D29 ·

At a glance — Event Sourcing · 100.0 · Exemplary ·

At a glance — Performance · 85.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection55High / Critical
A03:2025 — Software Supply Chain Failures32High / Critical

Roadmap

Top priorities: Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only; Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail; Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4).

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4).+2.8 ptsMediumStatic Analysis (SAST)
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.+3.5 ptsMediumWeb-Security Posture
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.+3.4 ptsMediumOutbound HTTP resilience
Enable Dependabot/Renovate or a dependency-review gate.+2.1 ptsMediumSecurity & performance tooling
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+2.1 ptsMediumDeployment & Rollback
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+0.8 ptsLowStatic Analysis (SAST)
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED.+0.8 ptsLowDependency Vulnerabilities
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED.+0.8 ptsLowDependency Vulnerabilities

File quality

Per-file score 0–10 — a quality signature. Of 438 files carrying findings, judged against the Preview bar: 1% slop · 2% mixed · 97% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
crates/bsl-platform/src/db.rs5.5MixedCyclomatic Complexity: PlatformDataInner::from_help (cyclomatic 36)
crates/mcp-server/src/lib.rs5.5MixedCyclomatic Complexity: McpServer::graph (cyclomatic 28)
crates/ide-db/src/database.rs5.5MixedCyclomatic Complexity: RootDatabaseImpl::resolve_common_module_files_for_file (cyclomatic 18)
crates/hir-def/src/body/lower/mod.rs5.5MixedCyclomatic Complexity: hir_def::body::lower::lower_method_with_externals (cyclomatic 21)
crates/bsl-analyzer/src/bin/cli/analyze.rs5.7MixedCyclomatic Complexity: bsl_analyzer::bin::cli::analyze::analyze_salsa (cyclomatic 83)
crates/ide-diagnostics/src/handlers/using_service_tag.rs6.0MixedExplicit Debt: TodoComment
crates/ide-diagnostics/src/handlers.rs6.3MixedGod Classes: FunctionTooLong: ide_diagnostics::handlers::get_metadata
crates/hir-ty/src/infer.rs7.0Near-cleanCyclomatic Complexity: InferenceContext::infer_call (cyclomatic 93)
crates/hir-def/src/body/lower/expr.rs7.0Near-cleanCyclomatic Complexity: hir_def::body::lower::expr::lower_call_expr (cyclomatic 85)
crates/bsl-analyzer/src/server.rs7.0Near-cleanCyclomatic Complexity: bsl_analyzer::server::handle_task (cyclomatic 67)
crates/mcp-server/src/state/bootstrap.rs7.0Near-cleanCyclomatic Complexity: SharedState::init_workspace_search_engine (cyclomatic 54)
crates/bsl-check-executor/src/native_check/profile.rs7.0Near-cleanCyclomatic Complexity: bsl_check_executor::native_check::profile::run_native_check (cyclomatic 53)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 56

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

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

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

Could not be resolved — 8

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 64 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 64 dimensions across the health lenses
D1D2D3D4D5D6D7D12D13D14D15D16D17D19D26D28D29D30D34D35D36D43D44AX10AX3AX4AX5AX8AX9ES1ES2GD1IC1M1M2M3M4P1P10P2P3P4P6P7PF1PF3S1X1X12X13X14X15X16X17X18X21X23X25X27X28X29X30X4X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2542 of 2619 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1e6b1-4008-7743-8332-90f642be00c9.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs, .py) and this repository declares a Cargo test suite (repository root, 1103 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D20 ADR Quality — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 220 further occurrence(s) are not listed individually; the score already reflects all 260.
  • X5 Nullable reference types — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 442 further occurrence(s) are not listed individually; the score already reflects all 482.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity6.1 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

281 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was InferenceContext::infer_call at 93. A further 75 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 ide_diagnostics::handlers::get_metadata at 227 — they are counted neither in the figure above nor in this dimension's score. 32 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/ide-diagnostics/src/handlers.rs (ide_diagnostics::handlers::get_metadata at 227), crates/ide-diagnostics/src/standards.rs (ide_diagnostics::standards::standards at 227), crates/parser/src/syntax_kind.rs (parser::syntax_kind::node_kind_to_syntax at 114), crates/parser/src/sdbl_token_converter.rs (parser::sdbl_token_converter::convert_sdbl_token_kind at 94), crates/parser-error/src/lib.rs (parser_error::token_display_ru at 88), and 27 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

ide_diagnostics::handlers::rewrite_method_parameter::stmt_uses_binding (cyclomatic 42) · ×31crates/ide-diagnostics/src/handlers/rewrite_method_parameter.rs:478
hir_def::body::lower::expr::lower_call_expr (cyclomatic 85) · ×22crates/hir-def/src/body/lower/expr.rs:385
mcp_server::tools::search::status::search_status_with_cap (cyclomatic 79) · ×20crates/mcp-server/src/tools/search/status.rs:226
bsl_analyzer::bin::cli::analyze::analyze_salsa (cyclomatic 83) · ×18crates/bsl-analyzer/src/bin/cli/analyze.rs:356
ide::completion::platform_completion::platform_completions (cyclomatic 32) · ×12crates/ide/src/completion/platform_completion.rs:72

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

What to do

  1. Bring the 6 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with InferenceContext::infer_call (cyclomatic 93), hir_def::body::lower::expr::lower_call_expr (cyclomatic 85), bsl_analyzer::bin::cli::analyze::analyze_salsa (cyclomatic 83). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cyclomatic Complexity from 6.1 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.5 / 10Weak✓ Tool-verified

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

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

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

561 method(s) exceeded the cognitive complexity threshold of 15; the worst was InferenceContext::infer_call at 254.

ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::collect_and_check (cognitive 131) · ×70crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:294
mcp_server::tools::search::status::search_status_with_cap (cognitive 139) · ×49crates/mcp-server/src/tools/search/status.rs:226
hir_def::body::lower::expr::lower_call_expr (cognitive 210) · ×48crates/hir-def/src/body/lower/expr.rs:385
bsl_analyzer::bin::cli::analyze::analyze_salsa (cognitive 142) · ×34crates/bsl-analyzer/src/bin/cli/analyze.rs:356
ide::completion::platform_completion::platform_completions (cognitive 71) · ×28crates/ide/src/completion/platform_completion.rs:72

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

What to do

  1. Bring the 8 bodies over 120 down to 120 or less in Cognitive Complexity — start with InferenceContext::infer_call (cognitive 254), hir_def::body::lower::expr::lower_call_expr (cognitive 210), bsl_analyzer::bin::cli::analyze::analyze_salsa (cognitive 142). — 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.5 to about 4.0/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes9.0 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

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

249 god class(es) detected.

FileTooLong: src/engine.rs · ×91crates/bsl-search/src/engine.rs
MethodTooLong: InferenceContext.infer_call · ×55crates/hir-ty/src/infer.rs:4963
FunctionTooLong: bsl_analyzer::bin::cli::analyze::analyze_salsa · ×50crates/bsl-analyzer/src/bin/cli/analyze.rs:356
TooManyMethods: SearchEngine · ×25crates/bsl-search/src/engine.rs:457
ClassTooLong: SearchEngine · ×19crates/bsl-search/src/engine.rs:457

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

What to do

  1. Resolve the 91 FileTooLong finding(s) in God Classes — start with lib.rs (5), metadata.rs (3), symbol_info.rs (2). — One of this dimension's main actionable groups (91 warning-level).
  2. Resolve the 55 MethodTooLong finding(s) in God Classes — start with lib.rs (7), infer.rs (5), engine.rs (5). — One of this dimension's main actionable groups (55 warning-level).
  3. Resolve the 50 FunctionTooLong finding(s) in God Classes — start with REDACTED (4), mod.rs (3), diagnostics_baseline.rs (2). — One of this dimension's main actionable groups (50 warning-level).

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

D4 · Code Duplication8.5 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

554 duplicated block group(s) detected. 3.7 % of the production lines (21,686 of 587,181) are in a reported copy. A further 379 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 10 of the 933 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (8 lines × 2) · ×41crates/bsl-analyzer/src/handlers/request.rs:2257
Duplicated block (6 lines × 2) · ×41crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:606
Duplicated block (10 lines × 2) · ×39crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:1000
Duplicated block (5 lines × 2) · ×38crates/bsl-check-executor/src/native_check/profile.rs:3007
Duplicated block (7 lines × 2) · ×29crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:197

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

What to do

  1. Resolve the 41 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with engine.rs (3), database.rs (2), graph.rs (2). — One of this dimension's main actionable groups (41 warning-level).
  2. Resolve the 41 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with engine.rs (3), graph_index.rs (3), scraper_parser.rs (3). — One of this dimension's main actionable groups (41 warning-level).
  3. Resolve the 39 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with profile.rs (3), REDACTED (3), graph.rs (2). — One of this dimension's main actionable groups (39 warning-level).

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

D5 · Coupling5.9 / 10Adequate✓ Tool-verified

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

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

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

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

48 production modules (Cargo+Python), 0 dependency cycle(s), 7 unstable depended-on module(s). Read from the build's own module declarations; 17 module(s) off the main sequence, with abstractness counted on 45 of the 48 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: html-parser · ×16
Unstable project hir-ty
Unstable project ide
Unstable project ide-assists
Unstable project ide-diagnostics

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

What to do

  1. Resolve the 16 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 1 Unstable project hir-ty finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Unstable project ide finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 4 serious findings✓ Tool-verified

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

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

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

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

4 of 403 classes have LCOM4 above 3.

Low cohesion: RootDatabaseImpl (LCOM4 30) · ×4crates/ide-db/src/database.rs:95

What to do

  1. Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with database.rs, db.rs, lib.rs. — One of this dimension's main actionable groups (4 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D12 · Dependency Hygiene8.0 / 10Strong✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

44 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 · ×44

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

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 603 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. A further 3 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.4 / 10Stronggated by 147 serious findings✓ Tool-verified

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

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

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

Top hotspots: crates/hir-ty/src/infer.rs (89×93=8277); crates/bsl-analyzer/src/server.rs (54×67=3618); crates/bsl-analyzer/src/bin/cli/analyze.rs (38×83=3154) Repeated repair below the complexity floor: crates/ide-diagnostics/src/handlers/unresolved_method_call.rs (11 of 16 changes were fixes); crates/bsl-metadata/src/metadata_object.rs (10 of 14 changes were fixes); crates/mcp-server/src/cache.rs (9 of 16 changes were fixes)

Hotspot: crates/hir-ty/src/infer.rs · ×86crates/hir-ty/src/infer.rs:4963
Repeated repair: crates/ide-diagnostics/src/handlers/unresolved_method_call.rs · ×61crates/ide-diagnostics/src/handlers/unresolved_method_call.rs:22

What to do

  1. Resolve the 86 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (4), mod.rs (3), workspace.rs (2). — One of this dimension's main actionable groups (86 warning-level).
  2. Resolve the 61 Repeated repair finding(s) in Churn × Complexity Hotspots — start with lib.rs (4), unresolved_method_call.rs, metadata_object.rs. — One of this dimension's main actionable groups (61 warning-level).

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

D16 · Bus Factor9.5 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

47 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/bsl-platform/tools/html-parser/src/scraper_parser.rs. Counted over 862 of the 985 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 · ×2
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt10.0 / 10Stronggated by 10 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

10 deducted task-comment markers across 587181 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×8crates/ide-diagnostics/src/handlers/bad_words.rs:205
FixmeComment · ×2crates/ide-diagnostics/src/handlers/using_service_tag.rs:221

What to do

  1. Resolve the 8 TodoComment finding(s) in Explicit Debt — start with using_service_tag.rs (4), bad_words.rs (2), if_else_if_ends_with_else.rs (2). — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with using_service_tag.rs (2). — One of this dimension's main actionable groups (2 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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.

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

1 of 1 documentation facets pass in full. 506 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D26 · Project Cohesion6.7 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

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

8 of 49 build units (Cargo, Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×8crates/mcp-server/Cargo.toml:1

What to do

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

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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.

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.5 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

55 finding(s): 0 critical, 53 high, 2 medium, 0 low. 36 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 6 file(s) — `crates/bsl-analyzer/src/global_state.rs` (line 248), `crates/bsl-search/src/merge.rs` (line 65), `crates/mcp-server/src/broker/daemon.rs` (line 1472, line 1566), `crates/mcp-server/src/graph/snapshot.rs` (line 743), `scripts/benchmark-compare.sh` (line 6), … (+1 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 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (15 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 36 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 (36 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities3.4 / 10Weak✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

27 finding(s): 1 critical, 2 high, 22 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 High CVE 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.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 862 of the 985 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.9 / 10Stronggated by 5 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: handlers.rs↔standards.rs 90%; salsa_provider.rs↔context.rs 83%; runner.rs↔standards.rs 73%

Change coupling: salsa_provider.rs ↔ context.rs · ×4crates/ide-db/src/salsa_provider.rs:1
Change-coupling hub: standards.rs → handlers.rs, runner.rs, diagnostics.rscrates/ide-diagnostics/src/standards.rs

What to do

  1. Resolve the 4 Change coupling finding(s) in Change Coupling — start with salsa_provider.rs, analyze.rs, handlers.rs. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with standards.rs. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

2/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 6 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.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.9 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

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.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

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.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs6.7 / 10Adequate✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `append_baseline_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/bsl-analyzer/src/bin/cli/check_config.rs:464
  • `semantic_tokens_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/bsl-analyzer/src/smoke.rs:548
  • `document_symbols_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/bsl-analyzer/src/smoke.rs:552
  • `folding_ranges_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/bsl-analyzer/src/smoke.rs:556
  • `diagnostics_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/bsl-analyzer/src/smoke.rs:560
  • `lifetime_pair` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/bsl-platform/src/security/mod.rs:122
  • `log_snapshot_publish_phase_timings` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — REDACTED:4276
  • `set_process_id` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/bsl-search/src/lifecycle.rs:24
  • `body_arc_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/hir-def/src/body.rs:495
  • `shared_effect_summary_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/effects.rs:81
  • `shared_mdo_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:162
  • `shared_register_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:168
  • `shared_common_module_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:191
  • `shared_http_service_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:198
  • `shared_web_service_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:205
  • `shared_integration_service_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:212
  • `shared_event_subscription_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:220
  • `shared_scheduled_job_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:228
  • `shared_role_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:234
  • `shared_subsystem_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-db/src/metadata.rs:240
  • `from_hir` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/ide-diagnostics/src/handlers/missing_common_module_method.rs:22
  • `register_cli_surface` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/mcp-server/src/contract.rs:532
  • `zero` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/stdx/src/heap.rs:46
  • `set_current_thread_qos_class` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/stdx/src/thread/intent.rs:129
  • `file_content` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/vfs/src/lib.rs:278

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
M1 · Documentation (README)6.8 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 1 public type in `ide_db.database` is marked as implementation by its own namespace, folder or name: `RootDatabaseImpl` (crates/ide-db/src/database.rs:95, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — crates/ide-db/src/database.rs:95

What to do

  • Hide `ide_db.database` (`RootDatabaseImpl`) (Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability7.6 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 24/28 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/bsl-check-executor`, `crates/bsl-launcher`, `xtask`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • `Cargo.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — Cargo.toml:22

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release. — REDACTED:176

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crates/bsl-launcher/src/http.rs:12, crates/bsl-launcher/src/http.rs:19
  • `urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — scripts/user2/prepare-qwen-vulkan.py:45

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
PF1 · Benchmark discipline8.5 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene8.5 / 10Exemplary✓ Tool-verified

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

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

  • `run_daemon` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — crates/bsl-analyzer/src/bin/cli/mcp/shared.rs:411

What to do

  • Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

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 serves HTTP itself (`axum::serve(` (crates/mcp-server/src/http.rs:291)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.

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.

  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (crates/mcp-server/src/http.rs:291).
  • 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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/mcp-server/src/http.rs:291).

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

X12 · Unreachable branch8.0 / 10Strong✓ Tool-verified

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.

  • `if has_raise || has_log { CatchBodyClass::Mixed } else if has_rollback { Catc…` follows `{ return pure; }` (line 32) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/hir-def/src/catch_class.rs:36
  • `let cwd = fs::canonicalize(entry.path().join("cwd")).map_err(| _ | NativeProf…` follows `{ return Err(NativeProfileError::CleanupFailed); }` (line 3566) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/bsl-check-executor/src/native_check/profile.rs:3569
  • `let cwd = match fs::canonicalize(format !("/proc/{pid}/cwd")) { Ok(cwd) => cw…` follows `{ return Err(NativeProfileError::CleanupFailed); }` (line 3601) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — crates/bsl-check-executor/src/native_check/profile.rs:3604

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document1.2 / 10Critical✓ Tool-verified

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

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

  • `stack_size` is public and takes a `Builder` as its receiver from its caller, and it calls itself at line 31 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `stack_size` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/stdx/src/thread.rs:31
  • `spawn` is public and takes a `Builder` as its receiver from its caller, and it calls itself at line 44 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `spawn` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/stdx/src/thread.rs:44
  • `join` is public and takes a `JoinHandle` as its receiver from its caller, and it calls itself at line 61 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `join` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/stdx/src/thread.rs:61
  • `collect_resolved_tables` is public and takes a `SdblHir` as its receiver from its caller, and it recurses at line 71 through `collect_expr_tables` and back with a piece of the document (and at line 74, line 78, line 82, line 86, line 90, line 94, line 98, line 102, line 511, line 513, line 517, line 520, line 524, line 525, line 527, line 530, line 535, line 538, line 539, line 542, line 546, line 547, line 548, line 551, line 552, line 554, line 557, line 560) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_resolved_tables` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/hir.rs:71
  • `collect_resolved_attributes` is public, takes a document from its caller (line 114) and hands it to `walk_level_expr`, which calls itself at line 453 with a piece of the document (and at line 457, line 464, line 465, line 467, line 470, line 475, line 478, line 479, line 482, line 486, line 487, line 488, line 491, line 492, line 494, line 497, line 500) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `walk_level_expr` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/hir.rs:453
  • `collect_resolved_attributes` is public and takes a `SdblHir` as its receiver from its caller, and it calls itself at line 165 with a piece of the document (and at line 172) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_resolved_attributes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/hir.rs:165
  • `collect_dereference_chains` is public, takes a document from its caller (line 185) and hands it to `referred_object`, which calls itself at line 251 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `referred_object` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/hir.rs:251
  • `collect_dereference_chains` is public and takes a `SdblHir` as its receiver from its caller, and it calls itself at line 216 with a piece of the document (and at line 223) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_dereference_chains` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/hir.rs:216
  • `collect_referenced_objects` is public and takes a `SdblHir` as its receiver from its caller, and it recurses at line 267 through `collect_expr_objects` and back with a piece of the document (and at line 270, line 274, line 278, line 282, line 286, line 290, line 294, line 298, line 320, line 323, line 325, line 329, line 332, line 336, line 337, line 340, line 344, line 347, line 348, line 351, line 355, line 356, line 357, line 360, line 361, line 363, line 368) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_referenced_objects` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/hir.rs:267
  • `is_numeric` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 129 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_numeric` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/types.rs:129
  • `unwrap_aggregate` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 151 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `unwrap_aggregate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/types.rs:151
  • `is_unlimited_string` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 144 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_unlimited_string` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/types.rs:144
  • `is_compatible_with` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 186 with a piece of the document (and at line 187) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_compatible_with` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/types.rs:186
  • `display_name` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 268 with a piece of the document (and at line 277) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `display_name` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/types.rs:268
  • `check_nested_fields_by_dot` is public, takes a document from its caller (line 123) and hands it to `report_dotted_paths`, which calls itself at line 304 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `report_dotted_paths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/lower/diagnostics.rs:304
  • `expanded` is public and takes `ty: &SdblType` from its caller, and it calls itself at line 896 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `expanded` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/lower/diagnostics.rs:896
  • `check_ref_overuse` is public and takes `hir: &SdblHir` from its caller, and it recurses at line 545 through `check_ref_overuse_in_joins`, `check_ref_overuse_in_order_by`, `check_ref_overuse_in_having`, `check_ref_overuse_in_group_by`, `check_ref_overuse_in_where`, `check_expr_for_ref_overuse`, `check_ref_overuse_in_select` and back with a piece of the document (and at line 537, line 538, line 539, line 540, line 541, line 542, line 551, line 557, line 564, line 571, line 578, line 586, line 598, line 599, line 603, line 608, line 614, line 617, line 618, line 621, line 626, line 630, line 634, line 638, line 644, line 645, line 646, line 650, line 651, line 653, line 658, line 663) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `check_ref_overuse` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/lower/diagnostics.rs:545
  • `check_unlimited_string_usage` is public, takes a document from its caller (line 719) and hands it to `check_expr_for_unlimited_string`, which calls itself at line 771 with a piece of the document (and at line 772, line 776, line 781, line 787, line 790, line 791, line 794, line 811, line 815, line 824, line 825, line 826, line 831, line 832, line 834, line 839, line 844) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `check_expr_for_unlimited_string` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/lower/diagnostics.rs:771
  • `check_unlimited_string_usage` is public and takes `hir: &SdblHir` from its caller, and it calls itself at line 758 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `check_unlimited_string_usage` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/lower/diagnostics.rs:758
  • `of_when` is public, takes a document from its caller (line 175) and hands it to `value`, which recurses at line 270 through `propagates_null`, `isnull` and back with a piece of the document (and at line 280, line 287, line 300) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/lower/missing_row.rs:270
  • `of` is public and takes `condition: &ExprHir` from its caller, and it calls itself at line 184 with a piece of the document (and at line 185, line 186) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `of` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/sdbl-hir/src/lower/missing_row.rs:184
  • `a_line_break_precedes` is public and takes a `Parser` as its receiver from its caller, and it calls itself at line 636 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `a_line_break_precedes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/parser/src/parser.rs:636
  • `a_gap_precedes` is public and takes a `Parser` as its receiver from its caller, and it calls itself at line 645 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `a_gap_precedes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/parser/src/parser.rs:645
  • `expression` is public and takes `p: &mut Parser` from its caller, and it recurses at line 276 through `paren_or_subquery_expr`, `when_clause`, `case_expr`, `column_or_function`, `primary_expr`, `unary_expr`, `multiplicative_expr`, `additive_expr`, `predicate_expr`, `comparison_expr`, `not_expr`, `logical_and_expr`, `logical_or_expr` and back with a piece of the document (and at line 282, line 288, line 300, line 306, line 319, line 322, line 329, line 337, line 346, line 354, line 366, line 369, line 379, line 384, line 396, line 423, line 547, line 562, line 629, line 635, line 666, line 692, line 718, line 726, line 732, line 736, line 775, line 914, line 950, line 991, line 997, line 1006, line 1023, line 1031) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `expression` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/parser/src/grammar/sdbl/expressions.rs:276
  • `subquery` is public and takes `p: &mut Parser` from its caller, and it recurses at line 171 through `union_clause`, `join_clause`, `data_source`, `from_clause`, `query_body_clauses`, `query_content`, `query` and back with a piece of the document (and at line 182, line 195, line 212, line 253, line 566, line 579, line 593, line 700, line 748) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `subquery` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/parser/src/grammar/sdbl/select.rs:171
  • `execute_query` is public, takes a document from its caller (line 82) and hands it to `post`, which calls itself at line 132 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `post` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/onec-client/src/lib.rs:132
  • `kind` is public and takes a `DocumentSymbol` as its receiver from its caller, and it calls itself at line 581 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `kind` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/ide/src/lib.rs:581
  • `eval` is public and takes a `PreprocCondition` as its receiver from its caller, and it recurses at line 155 through `eval_with` and back with a piece of the document (and at line 157, line 166, line 167, line 169, line 176) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `eval` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/hir-def/src/preproc_condition.rs:155
  • `get` is public and takes a `ValueOverlay` as its receiver from its caller, and it calls itself at line 43 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `get` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dataflow/src/value_state.rs:43
  • `is_empty` is public and takes a `ValueOverlay` as its receiver from its caller, and it calls itself at line 50 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_empty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/dataflow/src/value_state.rs:50
  • `apply_extension_overlay` is public and takes a `MetadataObject` as its receiver from its caller, and it calls itself at line 944 with a piece of the document (and at line 955) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `apply_extension_overlay` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/bsl-metadata/src/metadata_object.rs:944

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness5.3 / 10Adequate✓ Tool-verified

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.

  • `writer` (line 1185) is a `GraphDbWriter` this function owns and never releases: no `finalize()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `GraphDbWriter` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — REDACTED:1185
  • `config` (line 49) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/bad_words.rs:49
  • `config` (line 128) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/commented_code.rs:128
  • `config` (line 46) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/duplicate_string_literal.rs:46
  • `config` (line 72) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/duplicate_string_literal.rs:72
  • `config` (line 467) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:467
  • `config` (line 81) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/line_length.rs:81
  • `config` (line 273) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/magic_date.rs:273
  • `config` (line 36) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/magic_number.rs:36
  • `config` (line 350) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/missing_space.rs:350
  • `config` (line 71) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/missing_temporary_file_deletion.rs:71
  • `config` (line 73) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:73
  • `config` (line 92) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/timeouts_in_external_resources.rs:92
  • `config` (line 330) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/typo.rs:330
  • `config` (line 393) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/typo.rs:393
  • `config` (line 200) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/using_hardcode_network_address.rs:200
  • `config` (line 126) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/ide-diagnostics/src/handlers/using_hardcode_path.rs:126
  • `tx` (line 3159) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — REDACTED:3159
  • `tx` (line 3773) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — REDACTED:3773
  • `tx` (line 4426) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 4446; the `return` on line 4437 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — REDACTED:4426
  • `tx` (line 4557) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 4610; the `return` on line 4581 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — REDACTED:4557
  • `tx` (line 4683) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 4702; the `return` on line 4692 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — REDACTED:4683
  • `tx` (line 5326) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 5344; the `return` on line 5335 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — REDACTED:5326
  • `tx` (line 1363) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 1391; the `return` on line 1369 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure). — REDACTED:1363

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

X23 · Unguarded diagnostic materialisation8.0 / 10Strong✓ Tool-verified

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.

  • `tracing::debug!` at line 1210 is called with an argument built by `parent_obj.tabular_sections.iter().map(|ts|ts.name()).collect::<Vec<_>>()` (line 1216), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls. — crates/sdbl-hir/src/lower/from_clause.rs:1210

What to do

  • In Rust, hand the logger the value and let it format only what it writes: `debug!("rows: {:?}", rows)` or a field, `debug!(rows = ?rows, "loaded")` — `format_args!` and `?`/`%` fields defer the formatting. When the line needs a computed view (a `collect`, a `join`, a `serde_json::to_string`), put it behind `if log_enabled!(Level::Debug)` (`if tracing::enabled!(Level::DEBUG)` for tracing), which asks the target's own filter. The macros put their arguments behind the global maximum level only, so a collect or serialisation in the argument runs whenever any target is at debug, and the logger then drops this line.
X25 · Inert configuration knob6.9 / 10Strong✓ Tool-verified

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.

  • `Commands::Analyze.workspace_dir` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:106
  • `Commands::Analyze.output_dir` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:109
  • `Commands::Analyze.quiet` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:118
  • `Commands::Analyze.only_diagnostic` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:136
  • `Commands::Format.spaces` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:175
  • `Commands::Deps.sample` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:222
  • `Commands::Deps.quiet` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:228
  • `Commands::Deps.report_mem` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:234
  • `Commands::Deps.bench` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:237
  • `Commands::Deps.multi_open` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:240
  • `Commands::Deps.bench_index` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:243
  • `Commands::Deps.index_workers` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/bin/main.rs:246
  • `DepsResult.roots_sampled` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:155
  • `DepsResult.cold_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:156
  • `SessionResult.rss_boot_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:173
  • `SessionResult.rss_warm_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:174
  • `SessionResult.rss_post_edits_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:176
  • `SessionResult.rss_post_trim_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:177
  • `SessionResult.edit_rounds` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:181
  • `SessionResult.interned_trend` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:184
  • `InternedTrendRow.count_max` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/bsl-analyzer/src/smoke.rs:200
  • `GraphState.probe_window_hook` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/mcp-server/src/graph/state.rs:382
  • `GraphState.scan_receipt_hook` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/mcp-server/src/graph/state.rs:390
  • `EventLogParams.date_from` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/mcp-server/src/lib.rs:679
  • `EventLogParams.date_to` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/mcp-server/src/lib.rs:681
  • `CredentialHelperResponse.lease_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/project-model/src/lib.rs:4292
  • `CredentialHelperResponse.expires_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/project-model/src/lib.rs:4294
  • `CredentialHelperResponse.renewable` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/project-model/src/lib.rs:4296

What to do

  • Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
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.

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

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

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

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

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

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

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.

X4 · Structured logging5.0 / 10Adequate✓ Tool-verified

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.

  • `warn!` at line 1214 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/vfs-notify/src/lib.rs:1214
  • `debug!` at line 163 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/vcs/src/author_filter.rs:163
  • `debug!` at line 67 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/vcs/src/lib.rs:67
  • `debug!` at line 96 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/vcs/src/lib.rs:96
  • `debug!` at line 153 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/vcs/src/lib.rs:153
  • `debug!` at line 248 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/vcs/src/lib.rs:248
  • `trace!` at line 47 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:47
  • `trace!` at line 60 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:60
  • `trace!` at line 71 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:71
  • `warn!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:79
  • `trace!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:93
  • `trace!` at line 102 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:102
  • `trace!` at line 131 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:131
  • `trace!` at line 160 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:160
  • `trace!` at line 169 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:169
  • `trace!` at line 190 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:190
  • `trace!` at line 199 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/literal.rs:199
  • `trace!` at line 45 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/sdbl-hir/src/position_detector.rs:45
  • `warn!` at line 510 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/project-model/src/lib.rs:510
  • `warn!` at line 355 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/platform-help/src/lib.rs:355
  • `warn!` at line 373 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/platform-help/src/lib.rs:373
  • `warn!` at line 211 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/baseline.rs:211
  • `warn!` at line 243 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/baseline.rs:243
  • `warn!` at line 431 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/baseline.rs:431
  • `warn!` at line 1478 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/baseline.rs:1478
  • `warn!` at line 1506 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/baseline.rs:1506
  • `warn!` at line 1522 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/baseline.rs:1522
  • `warn!` at line 259 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:259
  • `debug!` at line 5206 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5206
  • `warn!` at line 5217 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5217
  • `debug!` at line 5307 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5307
  • `debug!` at line 5333 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5333
  • `debug!` at line 5368 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5368
  • `warn!` at line 5402 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5402
  • `debug!` at line 5487 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5487
  • `debug!` at line 5707 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5707
  • `debug!` at line 5792 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5792
  • `debug!` at line 5807 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5807
  • `warn!` at line 5817 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5817
  • `debug!` at line 5835 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/mcp-server/src/change_hub.rs:5835

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.7 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.

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

  • `stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker,"VfsLoader").spawn(move||actor.run(receiver))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vfs-notify/src/lib.rs:88
  • `self.sender.send(Message::Config(config))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `set_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vfs-notify/src/lib.rs:93
  • `self.sender.send(Message::WatchOnlyFiles(files))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `set_watch_only_files` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vfs-notify/src/lib.rs:97
  • `self.sender.send(Message::Invalidate(path))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `invalidate` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vfs-notify/src/lib.rs:101
  • `it` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `next_event` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vfs-notify/src/lib.rs:179
  • `stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker,format!("VfsReader{i}"),).spawn(move||{while let Ok(path)=paths_rx.recv(){let contents=read(path.as_path());if results_tx.send((path,contents)).is_err(){break;}}})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `load_entry` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vfs-notify/src/lib.rs:533
  • `slot.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `lines_kept_cached` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/vcs/src/author_filter.rs:214
  • `text[pos..end].chars().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `skip_leading_whitespace` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/syntax/src/sdbl_query.rs:710
  • `literal_text[pos..end].chars().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `process_content` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/syntax/src/sdbl_query.rs:742
  • `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_walk_paths` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/fs.rs:151
  • `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_read_files` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/fs.rs:198
  • `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_read_transform` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/fs.rs:253
  • `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_read_transform_with_progress` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/fs.rs:312
  • `Builder::new(intent,name).spawn(f)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/thread.rs:14
  • `self.inner.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/thread.rs:61
  • `Builder::new(INITIAL_INTENT,format!("Worker{idx}",)).stack_size(STACK_SIZE).allow_leak(true).spawn({let extant_tasks=Arc::clone(&extant_tasks);let job_receiver:Receiver<Job>=job_receiver.clone();move||{let mut current_intent=INITIAL_INTENT;for job in job_receiver{if job.requested_intent!=current_intent{job.requested_intent.apply_to_current_thread();current_intent=job.requested_intent;}drop(panic::catch_unwind(job.f));extant_tasks.fetch_sub(1,Ordering::SeqCst);}}})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/thread/pool.rs:55
  • `self.job_sender.send(job)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/thread/pool.rs:76
  • `self.pool.job_sender.send(job)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/stdx/src/thread/pool.rs:131
  • `parts.last()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parse_nested_field_chain` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/sdbl-hir/src/context_detector.rs:103
  • `sdbl_types.into_iter().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `from_attribute_type` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/sdbl-hir/src/types.rs:108
  • `arms.into_iter().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `resolve_attribute_type_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/sdbl-hir/src/lower/from_clause.rs:1397
  • `relative.file_name()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `open_parent` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/project-model/src/diagnostics_baseline_fs.rs:164
  • `edges[current].iter().map(|id|id.index()).find(|idx|remaining_deps[*idx]>0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `topological_order` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/project-model/src/extension_topology.rs:676
  • `config.resolve_configuration_path(root)?` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `discover_source_path` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/project-model/src/lib.rs:1117
  • `unit_outcomes.next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `scan_in_scope` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/project-model/src/source_set.rs:114
  • `outcome.files.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `partition_root` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/project-model/src/source_set.rs:206
  • `tikv_jemalloc_ctl::epoch::advance()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `now` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/profile/src/memory_usage.rs:27
  • `tikv_jemalloc_ctl::stats::allocated::read()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `now` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/profile/src/memory_usage.rs:29
  • `serde_json::to_string(self)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cache_key` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/platform-help/src/installed.rs:184
  • `serde_json::to_vec_pretty(identity)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `save` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/platform-help/src/installed.rs:266
  • `serde_json::to_vec_pretty(manifest)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `stage` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/platform-help/src/package.rs:170
  • `serde_json::to_vec(manifest)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `publication_name` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/platform-help/src/package.rs:409
  • `Utf8Path::join(self.as_ref(),path).try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/paths/src/lib.rs:182
  • `AbsPathBuf::try_from(self.0.to_path_buf())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `to_path_buf` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/paths/src/lib.rs:190
  • `RelPathBuf::try_from(self.0.to_path_buf())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `to_path_buf` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/paths/src/lib.rs:307
  • `p` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `preprocessor_if` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×3) — crates/parser/src/grammar.rs:184, crates/parser/src/grammar.rs:195, crates/parser/src/grammar.rs:216
  • `p` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `torn_preprocessor_if` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/parser/src/grammar.rs:242
  • `p` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `preproc_logical_operand` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/parser/src/grammar.rs:436

What to do

  • Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health70.9Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture92.6ExemplarySolid.
Maturity83.9ExemplarySolid.
Readiness58.9Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security61.6Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100.0ExemplaryStrongest area.
Performance85.0ExemplarySolid.
Unscored — 3 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 38 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 20 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 49 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: 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.
  • 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. 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.
  • AX6 Interface segregation — no interface, protocol or abstract type declares an operation an implementer must write
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • 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.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~172699 lines of test source are present (.rs, .py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-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.
  • D20 ADR Quality — 3 ADR(s) are written in a language our ADR lexicon does not cover, or are too short to tell (undetermined); their sections and statuses were not judged.
  • D21 Naming Consistency — N/A — too few peers to establish a naming convention (44951 declarations, no unit with a dominant convention).
  • D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • 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.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 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.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D8 Code Coverage — Coverage not measured — Rust suite
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 254 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one; a Domain/Aggregates/ValueObjects layer; a Rust domain-layer crate (a .../domain/ clean-architecture layer); a domain structure with no aggregate, domain event or strongly-typed id in it: a CRUD / clean-architecture model, measured but not claimed as DDD; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
  • 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
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 2% of this repository's production lines — rust (575,851 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 56 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 11 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
Serious — 2396 finding(s)
D3 · God Classes · FileTooLong · ×91
  • FileTooLong: src/engine.rs crates/bsl-search/src/engine.rs — FileTooLong — 4591 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: SearchEngine (3 blocks, 457-6660). The bar is 500 significant lines; this is 4091 over it, 9.18× 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/infer.rs crates/hir-ty/src/infer.rs — FileTooLong — 4130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: InferenceContext (2 blocks, 670-6513). The bar is 500 significant lines; this is 3630 over it, 8.26× 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: REDACTED REDACTED — FileTooLong — 3983 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 3483 over it, 7.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3534 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 3034 over it, 7.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: src/lib.rs crates/project-model/src/lib.rs — FileTooLong — 2896 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 2396 over it, 5.79× 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: native_check/profile.rs crates/bsl-check-executor/src/native_check/profile.rs — FileTooLong — 2803 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 82 free functions. The bar is 500 significant lines; this is 2303 over it, 5.61× 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/database.rs crates/ide-db/src/database.rs — FileTooLong — 2433 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: RootDatabaseImpl (11 blocks, 95-4041). The bar is 500 significant lines; this is 1933 over it, 4.87× 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/change_hub.rs crates/mcp-server/src/change_hub.rs — FileTooLong — 2050 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1550 over it, 4.10× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs crates/mcp-server/src/lib.rs — FileTooLong — 1950 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: McpServer (5 blocks, 1254-3467). The bar is 500 significant lines; this is 1450 over it, 3.90× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/graph.rs crates/ide/src/graph.rs — FileTooLong — 1938 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 1438 over it, 3.88× 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/workspace_overlay.rs crates/bsl-search/src/workspace_overlay.rs — FileTooLong — 1927 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: WorkspaceOverlayCache (3 blocks, 168-2473). The bar is 500 significant lines; this is 1427 over it, 3.85× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: state/bootstrap.rs crates/mcp-server/src/state/bootstrap.rs — FileTooLong — 1859 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: SharedState (663-3004). The bar is 500 significant lines; this is 1359 over it, 3.72× 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: REDACTED REDACTED — FileTooLong — 1794 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 1294 over it, 3.59× 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: handlers/request.rs crates/bsl-analyzer/src/handlers/request.rs — FileTooLong — 1616 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1116 over it, 3.23× 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/metadata.rs crates/ide-db/src/metadata.rs — FileTooLong — 1533 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 1033 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: src/graph_index.rs crates/hir-def/src/graph_index.rs — FileTooLong — 1525 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 1025 over it, 3.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/server.rs crates/bsl-analyzer/src/server.rs — FileTooLong — 1486 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 986 over it, 2.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: lower/expr.rs crates/hir-def/src/body/lower/expr.rs — FileTooLong — 1344 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 844 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: graph/state.rs crates/mcp-server/src/graph/state.rs — FileTooLong — 1308 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 808 over it, 2.62× 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/baseline.rs crates/mcp-server/src/baseline.rs — FileTooLong — 1295 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 795 over it, 2.59× 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: lower/from_clause.rs crates/sdbl-hir/src/lower/from_clause.rs — FileTooLong — 1288 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: LoweringContext (2 blocks, 57-1606). The bar is 500 significant lines; this is 788 over it, 2.58× 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: tools/platform.rs crates/mcp-server/src/tools/platform.rs — FileTooLong — 1237 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 63 free functions. The bar is 500 significant lines; this is 737 over it, 2.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: cli/mcp.rs crates/bsl-analyzer/src/bin/cli/mcp.rs — FileTooLong — 1155 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 655 over it, 2.31× 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/symbol_info.rs crates/ide/src/symbol_info.rs — FileTooLong — 1155 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 655 over it, 2.31× 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/graph_query.rs crates/mcp-server/src/graph_query.rs — FileTooLong — 1145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 74% of them inside a single declaration: GraphDb (2 blocks, 390-1733). The bar is 500 significant lines; this is 645 over it, 2.29× 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.
  • + 66 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×86
  • Hotspot: crates/hir-ty/src/infer.rs crates/hir-ty/src/infer.rs:4963 — crates/hir-ty/src/infer.rs changed 89 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in InferenceContext::infer_call at line 4963. 52 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-ty/src/infer.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/bsl-analyzer/src/server.rs crates/bsl-analyzer/src/server.rs:1243 — crates/bsl-analyzer/src/server.rs changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in bsl_analyzer::server::handle_task at line 1243. 26 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-analyzer/src/server.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/bsl-analyzer/src/bin/cli/analyze.rs crates/bsl-analyzer/src/bin/cli/analyze.rs:356 — crates/bsl-analyzer/src/bin/cli/analyze.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in bsl_analyzer::bin::cli::analyze::analyze_salsa at line 356. 18 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-analyzer/src/bin/cli/analyze.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/mcp-server/src/state/bootstrap.rs crates/mcp-server/src/state/bootstrap.rs:2265 — crates/mcp-server/src/state/bootstrap.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in SharedState::init_workspace_search_engine at line 2265. 20 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/state/bootstrap.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/mcp-server/src/state/embed.rs crates/mcp-server/src/state/embed.rs:1284 — crates/mcp-server/src/state/embed.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in SharedState::spawn_embed_pass at line 1284. 18 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/state/embed.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/mcp-server/src/state/mod.rs crates/mcp-server/src/state/mod.rs:860 — crates/mcp-server/src/state/mod.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in SharedState::workspace_indexing at line 860. 12 of those changes were fix/bug commits, and the other 23 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/state/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/mcp-server/src/lib.rs crates/mcp-server/src/lib.rs:2145 — crates/mcp-server/src/lib.rs changed 65 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in McpServer::graph at line 2145. 26 of those changes were fix/bug commits, and the other 39 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/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/bsl-search/src/engine.rs crates/bsl-search/src/engine.rs:2014 — crates/bsl-search/src/engine.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in SearchEngine::run_embedding_pass_owned at line 2014. 14 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-search/src/engine.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/mcp-server/src/state/sync.rs crates/mcp-server/src/state/sync.rs:318 — crates/mcp-server/src/state/sync.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in SharedState::spawn_search_sink at line 318. 10 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/state/sync.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/mcp-server/src/graph/state.rs crates/mcp-server/src/graph/state.rs:1094 — crates/mcp-server/src/graph/state.rs changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in GraphState::drive_as at line 1094. 19 of those changes were fix/bug commits, and the other 43 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/graph/state.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/hir-def/src/body/lower/expr.rs crates/hir-def/src/body/lower/expr.rs:385 — crates/hir-def/src/body/lower/expr.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in hir_def::body::lower::expr::lower_call_expr at line 385. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-def/src/body/lower/expr.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/mcp-server/src/tools/search/status.rs crates/mcp-server/src/tools/search/status.rs:226 — crates/mcp-server/src/tools/search/status.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in mcp_server::tools::search::status::search_status_with_cap at line 226. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/tools/search/status.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/bsl-analyzer/src/workspace.rs crates/bsl-analyzer/src/workspace.rs:289 — crates/bsl-analyzer/src/workspace.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in GlobalState::process_changes at line 289. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-analyzer/src/workspace.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/mcp-server/src/change_hub.rs crates/mcp-server/src/change_hub.rs:4678 — crates/mcp-server/src/change_hub.rs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in mcp_server::change_hub::run_hub_thread at line 4678. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/change_hub.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/project-model/src/lib.rs crates/project-model/src/lib.rs:822 — crates/project-model/src/lib.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Project::diagnostics_baseline_partition_plan at line 822. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/project-model/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/mcp-server/src/diagnostics_state/resident.rs crates/mcp-server/src/diagnostics_state/resident.rs:805 — crates/mcp-server/src/diagnostics_state/resident.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in DiagnosticsResident::workspace_aggregates at line 805. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/diagnostics_state/resident.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/mcp-server/src/graph/snapshot.rs crates/mcp-server/src/graph/snapshot.rs:404 — crates/mcp-server/src/graph/snapshot.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in GraphStore::checkout_with_admission_wait at line 404. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/graph/snapshot.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/mcp-server/src/workspace_lease.rs crates/mcp-server/src/workspace_lease.rs:896 — crates/mcp-server/src/workspace_lease.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in WorkspaceLease::publish_checkpointed_inner at line 896. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/workspace_lease.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/bsl-search/src/workspace_overlay.rs crates/bsl-search/src/workspace_overlay.rs:1441 — crates/bsl-search/src/workspace_overlay.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in WorkspaceOverlayCache::full_refresh_from_manifest_scanned at line 1441. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-search/src/workspace_overlay.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:2555 — REDACTED changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Store::reindex_file_in_collection_checkpointed_with_reuse at line 2555. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/mcp-server/src/broker/daemon.rs crates/mcp-server/src/broker/daemon.rs:171 — crates/mcp-server/src/broker/daemon.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in mcp_server::broker::daemon::serve_shared at line 171. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/broker/daemon.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:1727 — REDACTED changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in mcp_server::graph_db::compute_body_patch_with_metadata at line 1727. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/hir-ty/src/subtype.rs crates/hir-ty/src/subtype.rs:16 — crates/hir-ty/src/subtype.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in hir_ty::subtype::is_assignable at line 16. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-ty/src/subtype.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/mcp-server/src/tools/diagnostics.rs crates/mcp-server/src/tools/diagnostics.rs:409 — crates/mcp-server/src/tools/diagnostics.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in mcp_server::tools::diagnostics::file_findings at line 409. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/tools/diagnostics.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/bsl-analyzer/src/handlers/notification.rs crates/bsl-analyzer/src/handlers/notification.rs:510 — crates/bsl-analyzer/src/handlers/notification.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in bsl_analyzer::handlers::notification::handle_did_close at line 510. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-analyzer/src/handlers/notification.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.
  • + 61 more in this group — see findings.md.
D2 · Cognitive Complexity · ide_diagnostics · ×70
  • ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::collect_and_check (cognitive 131) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:294 — ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::collect_and_check has cognitive complexity 131 (threshold 15). Drivers by points: if/else 22 (105 pts), loops 7 (21 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 98). 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.
  • ide_diagnostics::handlers::using_hardcode_secret_information::check_body_exprs (cognitive 100) crates/ide-diagnostics/src/handlers/using_hardcode_secret_information.rs:80 — ide_diagnostics::handlers::using_hardcode_secret_information::check_body_exprs has cognitive complexity 100 (threshold 15). Drivers by points: if/else 18 (87 pts), loops 3 (7 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 76). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ide_diagnostics::handlers::server_calls_in_form_events::bfs_find_server_calls (cognitive 83) crates/ide-diagnostics/src/handlers/server_calls_in_form_events.rs:34 — ide_diagnostics::handlers::server_calls_in_form_events::bfs_find_server_calls has cognitive complexity 83 (threshold 15). Drivers by points: if/else 16 (67 pts), loops 4 (9 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::handlers::pairing_broken_transaction::dfs_check_paths (cognitive 67) crates/ide-diagnostics/src/handlers/pairing_broken_transaction.rs:324 — ide_diagnostics::handlers::pairing_broken_transaction::dfs_check_paths has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (37 pts), match/switch 4 (13 pts), loops 6 (12 pts), boolean chains 5 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ide_diagnostics::handlers::unused_parameters::check (cognitive 65) crates/ide-diagnostics/src/handlers/unused_parameters.rs:31 — ide_diagnostics::handlers::unused_parameters::check has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (41 pts), loops 13 (23 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.
  • ide_diagnostics::handlers::rewrite_method_parameter::stmt_uses_binding (cognitive 64) crates/ide-diagnostics/src/handlers/rewrite_method_parameter.rs:478 — ide_diagnostics::handlers::rewrite_method_parameter::stmt_uses_binding has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (39 pts), loops 9 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 36). 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.
  • ide_diagnostics::handlers::unused_local_variable::check_method (cognitive 62) crates/ide-diagnostics/src/handlers/unused_local_variable.rs:262 — ide_diagnostics::handlers::unused_local_variable::check_method has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (51 pts), loops 7 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 38). 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.
  • ide_diagnostics::handlers::timeouts_in_external_resources::check_body_for_timeouts (cognitive 58) crates/ide-diagnostics/src/handlers/timeouts_in_external_resources.rs:97 — ide_diagnostics::handlers::timeouts_in_external_resources::check_body_for_timeouts has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (46 pts), loops 4 (8 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 38). 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.
  • ide_diagnostics::handlers::unused_local_method::collect_called_methods (cognitive 53) crates/ide-diagnostics/src/handlers/unused_local_method.rs:132 — ide_diagnostics::handlers::unused_local_method::collect_called_methods has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 11 (20 pts), match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::handlers::nested_function_in_parameters::find_name_token_range (cognitive 43) crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:150 — ide_diagnostics::handlers::nested_function_in_parameters::find_name_token_range has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (29 pts), match/switch 4 (10 pts), boolean chains 2, loops 2 (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.
  • ide_diagnostics::handlers::rewrite_method_parameter::has_unwritten_entry_path (cognitive 41) crates/ide-diagnostics/src/handlers/rewrite_method_parameter.rs:141 — ide_diagnostics::handlers::rewrite_method_parameter::has_unwritten_entry_path has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::handlers::identical_expressions::check_preprocessor_split_expressions (cognitive 40) crates/ide-diagnostics/src/handlers/identical_expressions.rs:496 — ide_diagnostics::handlers::identical_expressions::check_preprocessor_split_expressions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 4 (8 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::utils::nstr::get_assigned_variable_name (cognitive 39) crates/ide-diagnostics/src/utils/nstr.rs:160 — ide_diagnostics::utils::nstr::get_assigned_variable_name has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (27 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ide_diagnostics::handlers::unused_local_variable::build_attribute_names_to_skip (cognitive 38) crates/ide-diagnostics/src/handlers/unused_local_variable.rs:35 — ide_diagnostics::handlers::unused_local_variable::build_attribute_names_to_skip has cognitive complexity 38 (threshold 15). Drivers by points: loops 8 (17 pts), if/else 5 (14 pts), match/switch 4 (7 pts) (nesting depth added 21). 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.
  • ide_diagnostics::handlers::incorrect_use_of_str_template::check_body (cognitive 37) crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:31 — ide_diagnostics::handlers::incorrect_use_of_str_template::check_body has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 2 (5 pts), loops 2, 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.
  • ide_diagnostics::handlers::missing_code_try_catch_ex::check_stmt_recursive (cognitive 36) crates/ide-diagnostics/src/handlers/missing_code_try_catch_ex.rs:53 — ide_diagnostics::handlers::missing_code_try_catch_ex::check_stmt_recursive has cognitive complexity 36 (threshold 15). Drivers by points: loops 8 (24 pts), if/else 4 (7 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 21). 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.
  • ide_diagnostics::utils::nstr::extract_language_entries (cognitive 36) crates/ide-diagnostics/src/utils/nstr.rs:100 — ide_diagnostics::utils::nstr::extract_language_entries has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 12, loops 6 (11 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::handlers::multiline_string_in_query::query_has_multiline_strings (cognitive 35) crates/ide-diagnostics/src/handlers/multiline_string_in_query.rs:43 — ide_diagnostics::handlers::multiline_string_in_query::query_has_multiline_strings has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (30 pts), loops 2 (4 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.
  • ide_diagnostics::handlers::multilingual_string_has_all_declared_languages::check_body (cognitive 35) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:82 — ide_diagnostics::handlers::multilingual_string_has_all_declared_languages::check_body has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 5 (10 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::handlers::commented_code::strong_statement (cognitive 33) crates/ide-diagnostics/src/handlers/commented_code.rs:534 — ide_diagnostics::handlers::commented_code::strong_statement has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 11 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • ide_diagnostics::handlers::pairing_broken_transaction::compute_begin_guard_flags::walk (cognitive 33) crates/ide-diagnostics/src/handlers/pairing_broken_transaction.rs:151 — ide_diagnostics::handlers::pairing_broken_transaction::compute_begin_guard_flags::walk has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::matches_trailing_pattern (cognitive 32) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:131 — ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::matches_trailing_pattern has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_diagnostics::utils::nstr::is_variable_used_in_template (cognitive 32) crates/ide-diagnostics/src/utils/nstr.rs:193 — ide_diagnostics::utils::nstr::is_variable_used_in_template has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ide_diagnostics::handlers::incorrect_use_of_str_template::compare_template_and_params (cognitive 31) crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:261 — ide_diagnostics::handlers::incorrect_use_of_str_template::compare_template_and_params has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ide_diagnostics::handlers::privileged_module_method_call::check (cognitive 31) crates/ide-diagnostics/src/handlers/privileged_module_method_call.rs:30 — ide_diagnostics::handlers::privileged_module_method_call::check has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • + 45 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×61
  • Repeated repair: crates/ide-diagnostics/src/handlers/unresolved_method_call.rs crates/ide-diagnostics/src/handlers/unresolved_method_call.rs:22 — crates/ide-diagnostics/src/handlers/unresolved_method_call.rs changed 16 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is ide_diagnostics::handlers::unresolved_method_call::from_hir at line 22), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir-ty): keep a form module's own method ahead of the form extension on self calls”; “fix(bsl-metadata): load a common module declared by its XML alone”; “fix(hir-def): a common module without Module.bsl is a module with an unknown surface”; “fix(hir-ty): resolve form extension methods on ЭтотОбъект/ЭтаФорма”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-diagnostics/src/handlers/unresolved_method_call.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/bsl-metadata/src/metadata_object.rs crates/bsl-metadata/src/metadata_object.rs:926 — crates/bsl-metadata/src/metadata_object.rs changed 14 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is MetadataObject::apply_extension_overlay at line 926), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdbl-hir): после Регистратор разрешены только стандартные поля документа”; “fix(sdbl-hir): judge ЗНАЧЕНИЕ predefined items over the known set”; “fix(bsl-metadata,hir-ty): judge a readable empty predefined set as known”; “fix(bsl-metadata): mark predefined items unreadable when Predefined.xml fails to parse”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-metadata/src/metadata_object.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/mcp-server/src/cache.rs crates/mcp-server/src/cache.rs:309 — crates/mcp-server/src/cache.rs changed 16 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 8 (its worst body is WorkspaceCacheLayout::validate_source_placement at line 309), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(project-model): ignore derived *.Queries.bsl extracts by default”; “fix(stdx): match exclude globs under a walk's resolved spelling”; “fix(metadata)!: preserve partial registers and legacy extension scopes”; “fix(mcp): address review findings on workspace cache relocation”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/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.
  • Repeated repair: crates/ide-diagnostics/src/handlers/invalid_character_in_file.rs crates/ide-diagnostics/src/handlers/invalid_character_in_file.rs:210 — crates/ide-diagnostics/src/handlers/invalid_character_in_file.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 11 (its worst body is ide_diagnostics::handlers::invalid_character_in_file::check_body at line 210), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir-def): make unequal line lists impossible when judging replacements”; “fix(ide-diagnostics): judge documentation lines without reparsing the block”; “fix(ide-diagnostics): stop the non-breaking space fix at a line break”; “fix(ide-diagnostics): judge a parameter doc line by the documentation parser”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-diagnostics/src/handlers/invalid_character_in_file.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/bsl-analyzer/src/bin/cli/mcp/shared.rs crates/bsl-analyzer/src/bin/cli/mcp/shared.rs:612 — crates/bsl-analyzer/src/bin/cli/mcp/shared.rs changed 11 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 15 (its worst body is bsl_analyzer::bin::cli::mcp::shared::serve_lsp at line 612), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mcp): занятость графа после остановки демона не выглядит конечным failed”; “fix(mcp-server): tighten executor limit sharing, reaping and validate routing”; “fix(bsl-analyzer): share the check executor worker limit across daemon sessions”; “fix(bsl-analyzer): carry executor-only connections through the shared session context”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-analyzer/src/bin/cli/mcp/shared.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/parser/src/grammar/items.rs crates/parser/src/grammar/items.rs:109 — crates/parser/src/grammar/items.rs changed 10 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is parser::grammar::items::procedure_def_content at line 109), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(parser): hand crossed #Если blocks back after a nested method”; “fix(parser): drop crossed #Если records when a method ends”; “fix(parser): read keyword-spelled labels and Экспорт after any variable name”; “fix(parser): keep a nested #Если from closing the enclosing region”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/parser/src/grammar/items.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/hir-def/src/execution_env.rs crates/hir-def/src/execution_env.rs:322 — crates/hir-def/src/execution_env.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 14 (its worst body is hir_def::execution_env::module_base_env at line 322), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir-def): constrain uncertain regions by enclosing branches”; “fix(hir-def): keep excluded method regions dead under unknown conditions”; “fix(hir-ty): judge arguments in #Если branches that may be compiled”; “fix(hir-def): ordinary forms run in the managed thick client only when the configuration allows it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-def/src/execution_env.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/hir-ty/src/method_resolution.rs crates/hir-ty/src/method_resolution.rs:287 — crates/hir-ty/src/method_resolution.rs changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is hir_ty::method_resolution::resolve_user_call at line 287), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir-ty): reconcile a documented metadata reference inside `Массив из`”; “fix(hir-ty): documented metadata return type does not close the result against the body”; “fix(hir-ty): judge arguments in #Если branches that may be compiled”; “fix(hir-ty): export variables of a constant's ValueManagerModule are fields of its value manager”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-ty/src/method_resolution.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/hir-def/src/lib.rs crates/hir-def/src/lib.rs:448 — crates/hir-def/src/lib.rs changed 10 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 9 (its worst body is ModuleMetadata::estimated_heap_size at line 448), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(metadata): preserve service and command owners for vendor support”; “fix(parser): read keyword-spelled labels and Экспорт after any variable name”; “fix(ide-diagnostics): see form handlers bound by string from another module”; “fix(ide-diagnostics): PlatformMemberNewerThanMinVersion — Асинх/Ждать молчат там же, где члены”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-def/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.
  • Repeated repair: crates/hir-def/src/queries.rs crates/hir-def/src/queries.rs:457 — crates/hir-def/src/queries.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is hir_def::queries::resolved_module_summary_query at line 457), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir-def): fold case when deduplicating a method's query reads”; “fix(graph): treat standard and defined-type hops of a query dereference chain like the first hop”; “fix(graph): follow query dereference chains past the first hop”; “fix(graph): link objects named by VALUE and CAST in queries”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-def/src/queries.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/ide/src/folding.rs crates/ide/src/folding.rs:91 — crates/ide/src/folding.rs changed 10 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 8 (its worst body is ide::folding::string_literal_range at line 91), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ide): start a method fold at Процедура/Функция, not at its compilation directive”; “fix(ide): fold adjacent string literals as one closed literal”; “fix(ide): do not fold an unclosed string literal”; “fix(ide): keep an unclosed literal's fold off the code after it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide/src/folding.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/ide-diagnostics/src/handlers/query_to_missing_metadata.rs crates/ide-diagnostics/src/handlers/query_to_missing_metadata.rs:63 — crates/ide-diagnostics/src/handlers/query_to_missing_metadata.rs changed 9 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 12 (its worst body is ide_diagnostics::handlers::query_to_missing_metadata::is_substituted_template at line 63), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ide-diagnostics): every used replacement must replace the placeholder”; “fix(ide-diagnostics): an identity replacement keeps the template reported”; “fix(ide-diagnostics): end a template only where its overwrite surely runs”; “fix(ide-diagnostics): keep a template that also runs as written reported”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-diagnostics/src/handlers/query_to_missing_metadata.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/ide-diagnostics/src/handlers/unavailable_in_environment.rs crates/ide-diagnostics/src/handlers/unavailable_in_environment.rs:23 — crates/ide-diagnostics/src/handlers/unavailable_in_environment.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is ide_diagnostics::handlers::unavailable_in_environment::from_hir at line 23), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(platform): document and pin the mobile client of sync HTTPConnection methods”; “fix(hir-ty): form data collections keep their client availability”; “fix(platform): COMSafeArray and JobSchedule members run in the thin client”; “fix(platform): SetHTML and PDF grayscale/signature methods run in the thin client”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-diagnostics/src/handlers/unavailable_in_environment.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/parser/src/grammar/statements.rs crates/parser/src/grammar/statements.rs:501 — crates/parser/src/grammar/statements.rs changed 9 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 8 (its worst body is parser::grammar::statements::stmt_list_of at line 501), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(parser): read the end of a torn group before the directives of a crossed block”; “fix(parser): read keyword-spelled labels and Экспорт after any variable name”; “fix(parser): read a conditional group that tears a construct as one variant”; “fix(parser): keep a nested #Если from closing the enclosing region”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/parser/src/grammar/statements.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/bsl-metadata/src/register.rs crates/bsl-metadata/src/register.rs:355 — crates/bsl-metadata/src/register.rs changed 9 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 12 (its worst body is Register::apply_extension_overlay at line 355), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(bsl-metadata): keep extension scalars and trim chart properties”; “fix(bsl-metadata): take correspondence and chart from an extension overlay”; “fix(metadata)!: preserve partial registers and legacy extension scopes”; “fix(hir-ty): expose common attributes as fields of the objects they reach”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/bsl-metadata/src/register.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/stdx/src/path_exclusion.rs crates/stdx/src/path_exclusion.rs:116 — crates/stdx/src/path_exclusion.rs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ExcludedPaths::with_patterns at line 116), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(scope): a Windows verbatim path is the same file, not a file out of scope”; “fix(project-model): ignore derived *.Queries.bsl extracts by default”; “fix(project-model): resolve an extends parent's directory through the file system”; “fix(stdx): match exclude globs under a walk's resolved spelling”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/stdx/src/path_exclusion.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/ide-diagnostics/src/handlers/mismatched_arg_count.rs crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs:21 — crates/ide-diagnostics/src/handlers/mismatched_arg_count.rs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is ide_diagnostics::handlers::mismatched_arg_count::from_hir at line 21), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir-ty): filter possible environments in elsif branches”; “fix(hir-def): constrain uncertain regions by enclosing branches”; “fix(hir-def): keep excluded method regions dead under unknown conditions”; “fix(hir-ty): keep undecided environments when telling dead #Если branches”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-diagnostics/src/handlers/mismatched_arg_count.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/syntax/src/comment_run.rs crates/syntax/src/comment_run.rs:142 — crates/syntax/src/comment_run.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 8 (its worst body is syntax::comment_run::collect_runs at line 142), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(syntax): find the neighbours of comments in one pass”; “fix(syntax): a lone CR is a line break for comment runs”; “fix(lexer): a lone CR ends a line comment, as in the platform”; “fix(ide-diagnostics): не менять молча разбор doc-комментария и не сканировать серию //”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/syntax/src/comment_run.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/ide-host-core/src/lib.rs crates/ide-host-core/src/lib.rs:112 — crates/ide-host-core/src/lib.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is AnalysisHost::request_cancellation at line 112), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mcp-server): apply project config to the diagnostics resident like CLI and LSP”; “fix(mcp-server): apply <DefaultRunMode> in the diagnostics resident”; “fix(ide-host-core): count only ManagedApplication and Auto as the managed run mode”; “fix(bsl-analyzer,mcp-server): take ordinaryAppSupport from what the diagnostics loader yields”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-host-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.
  • Repeated repair: crates/ide-diagnostics/src/handlers/assign_alias_fields_in_query.rs crates/ide-diagnostics/src/handlers/assign_alias_fields_in_query.rs:54 — crates/ide-diagnostics/src/handlers/assign_alias_fields_in_query.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ide_diagnostics::handlers::assign_alias_fields_in_query::dispatch at line 54), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “refactor(ide-diagnostics): drop the unattested alias-fix branch the dialect gate made dead”; “fix(ide-diagnostics): skip foreign comments and quoted identifiers when attesting the SDBL dialect”; “fix(ide-diagnostics): attest a metadata prefix only by an SDBL query-table root”; “fix(ide-diagnostics): attest the SDBL dialect only by a metadata prefix and outside apostrophe literals”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-diagnostics/src/handlers/assign_alias_fields_in_query.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/parser/src/parser.rs crates/parser/src/parser.rs:313 — crates/parser/src/parser.rs 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 10 (its worst body is Parser::match_closers at line 313), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(parser): hand crossed #Если blocks back after a nested method”; “fix(parser): drop crossed #Если records when a method ends”; “fix(sdbl): preserve expression boundaries and totals aliases”; “fix(parser): read a conditional group that tears a construct as one variant”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/parser/src/parser.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/hir-ty/src/manager_lookup.rs crates/hir-ty/src/manager_lookup.rs:157 — crates/hir-ty/src/manager_lookup.rs 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 6 (its worst body is hir_ty::manager_lookup::predefined_ref_kind_for at line 157), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdbl-hir): judge ЗНАЧЕНИЕ predefined items over the known set”; “fix(bsl-metadata,hir-ty): judge a readable empty predefined set as known”; “fix(hir-ty): judge a string predefined value over the set the manager read closes”; “fix(hir-ty): keep manager member set open when a predefined layer is unread”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/hir-ty/src/manager_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.
  • Repeated repair: crates/ide-diagnostics/src/handlers/usage_write_log_event.rs crates/ide-diagnostics/src/handlers/usage_write_log_event.rs:24 — crates/ide-diagnostics/src/handlers/usage_write_log_event.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 9 (its worst body is ide_diagnostics::handlers::usage_write_log_event::from_hir at line 24), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hir-def): UsageWriteLogEvent - оценивать каждый уровень в составном аргументе”; “fix(hir-def): UsageWriteLogEvent - accept Warning level inside Except”; “fix(hir-def): follow error info kept in a field and drop values outdated by their path”; “fix(hir-def): keep string keys and removed text apart when tracing the log comment”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide-diagnostics/src/handlers/usage_write_log_event.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/mcp-server/src/tools/debug.rs crates/mcp-server/src/tools/debug.rs:29 — crates/mcp-server/src/tools/debug.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 10 (its worst body is mcp_server::tools::debug::debug_attach at line 29), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(debug): report a missing evaluation and keep side refusals visible”; “fix(debug): share the default target types, classify step ends, report halts once”; “fix(debug): keep every queued stop, order halted targets, user-private lease”; “fix(debug): find and resume targets halted before the attach”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/mcp-server/src/tools/debug.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/ide/src/convert_method.rs crates/ide/src/convert_method.rs:142 — crates/ide/src/convert_method.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ide::convert_method::may_become_procedure at line 142), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ide): offer the method conversion anywhere on the declaration line”; “fix(ide): count an extension body's calls before turning a function into a procedure”; “fix(ide): keep a function in a module that runs dynamic code”; “fix(ide): see interceptors under #Если and calls assembled in strings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:20:02 +03:00' --until='2026-11-16 21:20:02 +03:00' --full-history --no-merges -- crates/ide/src/convert_method.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.
  • + 36 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×55
  • MethodTooLong: InferenceContext.infer_call crates/hir-ty/src/infer.rs:4963 — MethodTooLong — infer_call runs 369 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 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.
  • MethodTooLong: SharedState.init_workspace_search_engine crates/mcp-server/src/state/bootstrap.rs:2265 — MethodTooLong — init_workspace_search_engine runs 311 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 211 over it, 3.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: SharedState.spawn_embed_pass crates/mcp-server/src/state/embed.rs:1284 — MethodTooLong — spawn_embed_pass runs 274 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 174 over it, 2.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SearchEngine.index_directory crates/bsl-search/src/engine.rs:1284 — MethodTooLong — index_directory runs 258 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 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.
  • MethodTooLong: PostgresBaselineAdapter.populate_serving_semantic_with_progress REDACTED:1807 — MethodTooLong — populate_serving_semantic_with_progress runs 247 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 147 over it, 2.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.
  • MethodTooLong: LoweringContext.build_accounting_register_table crates/sdbl-hir/src/lower/register_tables.rs:187 — MethodTooLong — build_accounting_register_table runs 247 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 147 over it, 2.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.
  • MethodTooLong: SearchEngine.refresh_dirty_contexts_fenced crates/bsl-search/src/engine.rs:4766 — MethodTooLong — refresh_dirty_contexts_fenced runs 243 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 143 over it, 2.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: SharedState.workspace_with_cache_and_prefixes_impl crates/mcp-server/src/state/bootstrap.rs:734 — MethodTooLong — workspace_with_cache_and_prefixes_impl runs 241 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 141 over it, 2.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: InferenceContext.infer_expr crates/hir-ty/src/infer.rs:3971 — MethodTooLong — infer_expr runs 233 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 133 over it, 2.33× 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: InferenceContext.infer_stmt crates/hir-ty/src/infer.rs:3619 — MethodTooLong — infer_stmt runs 230 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SearchEngine.run_embedding_pass_owned crates/bsl-search/src/engine.rs:2014 — MethodTooLong — run_embedding_pass_owned runs 221 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SharedState.run_overlay_warmup crates/mcp-server/src/state/embed.rs:702 — MethodTooLong — run_overlay_warmup runs 201 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 101 over it, 2.01× 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: InferenceContext.resolve_bare_name crates/hir-ty/src/infer.rs:4410 — MethodTooLong — resolve_bare_name runs 200 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 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SharedState.spawn_search_sink crates/mcp-server/src/state/sync.rs:318 — MethodTooLong — spawn_search_sink runs 190 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SharedState.spawn_workspace_search_init crates/mcp-server/src/state/bootstrap.rs:1235 — MethodTooLong — spawn_workspace_search_init runs 188 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 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SharedState.workspace_indexing crates/mcp-server/src/state/mod.rs:860 — MethodTooLong — workspace_indexing 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: DbScopeProvider.get_scope crates/ide/src/completion/sdbl/infrastructure/scope_provider.rs:18 — MethodTooLong — get_scope runs 183 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 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Project.diagnostics_baseline_partition_plan crates/project-model/src/lib.rs:822 — MethodTooLong — diagnostics_baseline_partition_plan runs 179 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 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PlatformDataInner.from_help crates/bsl-platform/src/db.rs:145 — MethodTooLong — from_help runs 177 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 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: McpServer.workspace_search crates/mcp-server/src/lib.rs:1567 — MethodTooLong — workspace_search runs 176 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 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NativeProfile.run_scoped crates/bsl-check-executor/src/native_check/profile.rs:320 — MethodTooLong — run_scoped runs 175 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 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BodyDiagnostic.map_range crates/hir-def/src/body.rs:857 — MethodTooLong — map_range runs 175 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 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DiagnosticsState.refresh_saved_path crates/mcp-server/src/diagnostics_state/drift.rs:106 — MethodTooLong — refresh_saved_path runs 172 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 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PostgresBaselineAdapter.ensure_schema_statements REDACTED:870 — MethodTooLong — ensure_schema_statements runs 170 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 70 over it, 1.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.
  • MethodTooLong: WorkspaceOverlayCache.full_refresh_from_manifest_scanned crates/bsl-search/src/workspace_overlay.rs:1441 — MethodTooLong — full_refresh_from_manifest_scanned runs 168 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 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 30 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×50
  • FunctionTooLong: bsl_analyzer::bin::cli::analyze::analyze_salsa crates/bsl-analyzer/src/bin/cli/analyze.rs:356 — FunctionTooLong — bsl_analyzer::bin::cli::analyze::analyze_salsa runs 585 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 485 over it, 5.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.
  • FunctionTooLong: bsl_check_executor::native_check::profile::run_native_check crates/bsl-check-executor/src/native_check/profile.rs:590 — FunctionTooLong — bsl_check_executor::native_check::profile::run_native_check runs 553 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 453 over it, 5.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: mcp_server::tools::search::status::search_status_with_cap crates/mcp-server/src/tools/search/status.rs:226 — FunctionTooLong — mcp_server::tools::search::status::search_status_with_cap runs 382 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 282 over it, 3.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::bin::cli::diagnostics_baseline::apply_partitioned crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:397 — FunctionTooLong — bsl_analyzer::bin::cli::diagnostics_baseline::apply_partitioned runs 365 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 265 over it, 3.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::bin::cli::deps::run_deps crates/bsl-analyzer/src/bin/cli/deps.rs:68 — FunctionTooLong — bsl_analyzer::bin::cli::deps::run_deps runs 348 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 248 over it, 3.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ide_diagnostics::handlers::get_metadata crates/ide-diagnostics/src/handlers.rs:236 — FunctionTooLong — ide_diagnostics::handlers::get_metadata runs 291 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 191 over it, 2.91× 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: mcp_server::graph_db::write_body_patch REDACTED:2198 — FunctionTooLong — mcp_server::graph_db::write_body_patch runs 282 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 182 over it, 2.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: hir_def::body::lower::expr::lower_call_expr crates/hir-def/src/body/lower/expr.rs:385 — FunctionTooLong — hir_def::body::lower::expr::lower_call_expr runs 269 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 169 over it, 2.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: ide_host_core::metadata::bootstrap_metadata_substrate crates/ide-host-core/src/metadata.rs:48 — FunctionTooLong — ide_host_core::metadata::bootstrap_metadata_substrate runs 267 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 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ide_host_core::metadata::refresh_metadata_substrate crates/ide-host-core/src/metadata.rs:422 — FunctionTooLong — ide_host_core::metadata::refresh_metadata_substrate runs 251 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 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mcp_server::graph_db::compute_body_patch_with_metadata REDACTED:1727 — FunctionTooLong — mcp_server::graph_db::compute_body_patch_with_metadata runs 243 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 143 over it, 2.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.
  • FunctionTooLong: bsl_analyzer::server::handle_task crates/bsl-analyzer/src/server.rs:1243 — FunctionTooLong — bsl_analyzer::server::handle_task runs 213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::bin::cli::search_baseline::publish::run crates/bsl-analyzer/src/bin/cli/search_baseline/publish.rs:58 — FunctionTooLong — bsl_analyzer::bin::cli::search_baseline::publish::run runs 202 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::bin::cli::check_config::build_check_config_report crates/bsl-analyzer/src/bin/cli/check_config.rs:222 — FunctionTooLong — bsl_analyzer::bin::cli::check_config::build_check_config_report runs 194 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 94 over it, 1.94× 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: mcp_server::tools::references::render crates/mcp-server/src/tools/references.rs:452 — FunctionTooLong — mcp_server::tools::references::render runs 193 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 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ide_diagnostics::hir_dispatch::dispatch_hir_diagnostic crates/ide-diagnostics/src/hir_dispatch.rs:118 — FunctionTooLong — ide_diagnostics::hir_dispatch::dispatch_hir_diagnostic 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.
  • FunctionTooLong: ide_diagnostics::handlers::duplicated_insertion_into_collection::check_stmt crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:610 — FunctionTooLong — ide_diagnostics::handlers::duplicated_insertion_into_collection::check_stmt runs 173 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 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_debug::types::events::parse_ping_events crates/bsl-debug/src/types/events.rs:49 — FunctionTooLong — bsl_debug::types::events::parse_ping_events runs 172 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 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: parser::sdbl_token_converter::convert_sdbl_token_kind crates/parser/src/sdbl_token_converter.rs:16 — FunctionTooLong — parser::sdbl_token_converter::convert_sdbl_token_kind runs 169 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 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::server::handle_loader_msg crates/bsl-analyzer/src/server.rs:875 — FunctionTooLong — bsl_analyzer::server::handle_loader_msg runs 167 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 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::bin::cli::lsp::relay_lsp crates/bsl-analyzer/src/bin/cli/lsp.rs:382 — FunctionTooLong — bsl_analyzer::bin::cli::lsp::relay_lsp runs 165 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 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::handlers::request::handle_call_hierarchy_incoming crates/bsl-analyzer/src/handlers/request.rs:441 — FunctionTooLong — bsl_analyzer::handlers::request::handle_call_hierarchy_incoming runs 165 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 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_metadata::loader::load_all_metadata_parallel crates/bsl-metadata/src/loader.rs:145 — FunctionTooLong — bsl_metadata::loader::load_all_metadata_parallel runs 161 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 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bsl_analyzer::bin::cli::mcp::shared::run_daemon crates/bsl-analyzer/src/bin/cli/mcp/shared.rs:411 — FunctionTooLong — bsl_analyzer::bin::cli::mcp::shared::run_daemon runs 155 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 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ide::completion::sdbl::sdbl_completions crates/ide/src/completion/sdbl/mod.rs:16 — FunctionTooLong — ide::completion::sdbl::sdbl_completions runs 155 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 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 25 more in this group — see findings.md.
D2 · Cognitive Complexity · mcp_server · ×49
  • mcp_server::tools::search::status::search_status_with_cap (cognitive 139) crates/mcp-server/src/tools/search/status.rs:226 — mcp_server::tools::search::status::search_status_with_cap has cognitive complexity 139 (threshold 15). Drivers by points: if/else 46 (89 pts), match/switch 15 (44 pts), boolean chains 3, loops 1 (3 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.
  • mcp_server::broker::daemon::serve_shared (cognitive 80) crates/mcp-server/src/broker/daemon.rs:171 — mcp_server::broker::daemon::serve_shared has cognitive complexity 80 (threshold 15). Drivers by points: if/else 18 (49 pts), match/switch 6 (17 pts), loops 6 (13 pts), boolean chains 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::change_hub::run_hub_thread (cognitive 60) crates/mcp-server/src/change_hub.rs:4678 — mcp_server::change_hub::run_hub_thread has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (41 pts), match/switch 5 (11 pts), loops 3 (5 pts), boolean chains 3 (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.
  • mcp_server::graph_db::compute_body_patch_with_metadata (cognitive 58) REDACTED:1727 — mcp_server::graph_db::compute_body_patch_with_metadata has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (43 pts), loops 5 (9 pts), boolean chains 6 (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.
  • mcp_server::change_hub::apply_rearm (cognitive 57) crates/mcp-server/src/change_hub.rs:5725 — mcp_server::change_hub::apply_rearm has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 6, loops 5, match/switch 2 (4 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.
  • mcp_server::drift_classify::classify_drift (cognitive 54) crates/mcp-server/src/drift_classify.rs:72 — mcp_server::drift_classify::classify_drift has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (40 pts), match/switch 4 (12 pts), boolean chains 1, loops 1 (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.
  • mcp_server::tools::metadata::format_filtered_tree (cognitive 51) crates/mcp-server/src/tools/metadata.rs:412 — mcp_server::tools::metadata::format_filtered_tree has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 6 (22 pts), match/switch 1 (2 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.
  • mcp_server::diagnostics_state::resident::apply_resident_changes (cognitive 48) crates/mcp-server/src/diagnostics_state/resident.rs:1498 — mcp_server::diagnostics_state::resident::apply_resident_changes has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (36 pts), match/switch 3 (8 pts), boolean chains 3, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::graph_db::plan_caller_delta (cognitive 47) REDACTED:2746 — mcp_server::graph_db::plan_caller_delta has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 6 (14 pts) (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.
  • mcp_server::tools::redact::redact_targeted_tracking (cognitive 43) crates/mcp-server/src/tools/redact.rs:54 — mcp_server::tools::redact::redact_targeted_tracking has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (10 pts), boolean chains 5, match/switch 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::tools::references::render (cognitive 40) crates/mcp-server/src/tools/references.rs:452 — mcp_server::tools::references::render has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 2, 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.
  • mcp_server::broker::daemon::serve (cognitive 38) crates/mcp-server/src/broker/daemon.rs:342 — mcp_server::broker::daemon::serve has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 4 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::graph_db::write_body_patch (cognitive 38) REDACTED:2198 — mcp_server::graph_db::write_body_patch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 9 (12 pts), match/switch 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::tools::search::semantic::semantic_code_hits (cognitive 38) crates/mcp-server/src/tools/search/semantic.rs:30 — mcp_server::tools::search::semantic::semantic_code_hits has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (25 pts), match/switch 8 (11 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.
  • mcp_server::graph_db::local_metadata_delta (cognitive 37) REDACTED:1579 — mcp_server::graph_db::local_metadata_delta has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::tools::diagnostics::file_findings (cognitive 27) crates/mcp-server/src/tools/diagnostics.rs:409 — mcp_server::tools::diagnostics::file_findings has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::contract::shape_from_value (cognitive 26) crates/mcp-server/src/contract.rs:443 — mcp_server::contract::shape_from_value has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (10 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.
  • mcp_server::tools::search::lexical::lexical_code_hits (cognitive 26) crates/mcp-server/src/tools/search/lexical.rs:25 — mcp_server::tools::search::lexical::lexical_code_hits has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 5 (12 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::tools::metadata::format_metadata_object_structure (cognitive 24) crates/mcp-server/src/tools/metadata.rs:778 — mcp_server::tools::metadata::format_metadata_object_structure has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (12 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.
  • mcp_server::tools::query::render_text (cognitive 24) crates/mcp-server/src/tools/query.rs:445 — mcp_server::tools::query::render_text has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (5 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.
  • mcp_server::change_hub::apply_declaration (cognitive 23) crates/mcp-server/src/change_hub.rs:5071 — mcp_server::change_hub::apply_declaration has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mcp_server::graph_db::incremental_safety_check (cognitive 23) REDACTED:1390 — mcp_server::graph_db::incremental_safety_check has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4, 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.
  • mcp_server::tools::diagnostics::snippet::plan (cognitive 23) crates/mcp-server/src/tools/diagnostics/snippet.rs:191 — mcp_server::tools::diagnostics::snippet::plan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 6 (9 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mcp_server::tools::metadata::forms_in_container (cognitive 23) crates/mcp-server/src/tools/metadata.rs:1111 — mcp_server::tools::metadata::forms_in_container has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (5 pts) (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.
  • mcp_server::tools::search::status::write_summary_block (cognitive 23) crates/mcp-server/src/tools/search/status.rs:843 — mcp_server::tools::search::status::write_summary_block has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3 (5 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.
  • + 24 more in this group — see findings.md.
D2 · Cognitive Complexity · hir_def · ×48
  • hir_def::body::lower::expr::lower_call_expr (cognitive 210) crates/hir-def/src/body/lower/expr.rs:385 — hir_def::body::lower::expr::lower_call_expr has cognitive complexity 210 (threshold 15). Drivers by points: if/else 72 (191 pts), boolean chains 8, match/switch 3 (6 pts), loops 1 (5 pts) (nesting depth added 126). 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.
  • hir_def::body::lower::stmt::lower_stmt_list_with_unreachable (cognitive 60) crates/hir-def/src/body/lower/stmt.rs:246 — hir_def::body::lower::stmt::lower_stmt_list_with_unreachable has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (53 pts), boolean chains 6, loops 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.
  • hir_def::docs::tokens::doc_comment_tokens (cognitive 57) crates/hir-def/src/docs/tokens.rs:33 — hir_def::docs::tokens::doc_comment_tokens has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 4 (13 pts), boolean chains 8 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • hir_def::call_graph::extract_from_body (cognitive 52) crates/hir-def/src/call_graph.rs:917 — hir_def::call_graph::extract_from_body has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (34 pts), match/switch 4 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::docs::parse_parameters_with_roles (cognitive 49) crates/hir-def/src/docs.rs:713 — hir_def::docs::parse_parameters_with_roles has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (47 pts), boolean chains 1, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • hir_def::ty::doc_types::parse_method_doc_types (cognitive 49) crates/hir-def/src/ty/doc_types.rs:21 — hir_def::ty::doc_types::parse_method_doc_types has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (43 pts), match/switch 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • hir_def::docs::fields::parse_fields_at_level (cognitive 46) crates/hir-def/src/docs/fields.rs:23 — hir_def::docs::fields::parse_fields_at_level has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (44 pts), boolean chains 1, loops 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • hir_def::body::lower::expr::determine_magic_number_context (cognitive 43) crates/hir-def/src/body/lower/expr.rs:1855 — hir_def::body::lower::expr::determine_magic_number_context has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 9, match/switch 2 (5 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::body::lower::expr::is_unsafe_safe_mode_context (cognitive 40) crates/hir-def/src/body/lower/expr.rs:2010 — hir_def::body::lower::expr::is_unsafe_safe_mode_context has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (35 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (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.
  • hir_def::graph_index::project_batch_form_edges (cognitive 38) crates/hir-def/src/graph_index.rs:1341 — hir_def::graph_index::project_batch_form_edges has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 7 (11 pts), match/switch 2 (6 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.
  • hir_def::body::lower::diagnostics::check_rollback_transaction_in_try (cognitive 35) crates/hir-def/src/body/lower/diagnostics.rs:394 — hir_def::body::lower::diagnostics::check_rollback_transaction_in_try has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 24). 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.
  • hir_def::docs::parse_returns (cognitive 32) crates/hir-def/src/docs.rs:853 — hir_def::docs::parse_returns has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::body::lower::expr::compare_template_and_params (cognitive 31) crates/hir-def/src/body/lower/expr.rs:1777 — hir_def::body::lower::expr::compare_template_and_params has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • hir_def::graph_index::project_workspace_catalog_edges (cognitive 30) crates/hir-def/src/graph_index.rs:1533 — hir_def::graph_index::project_workspace_catalog_edges has cognitive complexity 30 (threshold 15). Drivers by points: loops 10 (20 pts), if/else 3 (10 pts) (nesting depth added 17). 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.
  • hir_def::body::lower::lower_method_with_externals (cognitive 27) crates/hir-def/src/body/lower/mod.rs:401 — hir_def::body::lower::lower_method_with_externals has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::body::lower::lower_module_code (cognitive 27) crates/hir-def/src/body/lower/mod.rs:564 — hir_def::body::lower::lower_module_code has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::body::lower::query_fragment::has_foreign_markers (cognitive 27) crates/hir-def/src/body/lower/query_fragment.rs:378 — hir_def::body::lower::query_fragment::has_foreign_markers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (7 pts), match/switch 1 (2 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.
  • hir_def::graph_index::extract_unresolved_refs (cognitive 27) crates/hir-def/src/graph_index.rs:822 — hir_def::graph_index::extract_unresolved_refs has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 4 (11 pts), match/switch 1 (2 pts) (nesting depth added 17). 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.
  • hir_def::body::lower::diagnostics::check_parent_block_for_async (cognitive 26) crates/hir-def/src/body/lower/diagnostics.rs:541 — hir_def::body::lower::diagnostics::check_parent_block_for_async has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::body::lower::collect_referenced_externals::collect_declared (cognitive 25) crates/hir-def/src/body/lower/mod.rs:648 — hir_def::body::lower::collect_referenced_externals::collect_declared has cognitive complexity 25 (threshold 15). Drivers by points: loops 10 (22 pts), if/else 1 (2 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • hir_def::docs::see_reference_ranges (cognitive 24) crates/hir-def/src/docs.rs:645 — hir_def::docs::see_reference_ranges has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::body::lower::stmt::lower_assign_stmt (cognitive 23) crates/hir-def/src/body/lower/stmt.rs:491 — hir_def::body::lower::stmt::lower_assign_stmt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_def::body::lower::utils::extract_string_content (cognitive 23) crates/hir-def/src/body/lower/utils.rs:88 — hir_def::body::lower::utils::extract_string_content has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 15). 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.
  • hir_def::graph_index::resolve_summary_via_index (cognitive 23) crates/hir-def/src/graph_index.rs:387 — hir_def::graph_index::resolve_summary_via_index has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 8 (22 pts), loops 1 (nesting depth added 14). 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.
  • hir_def::preproc_condition::tokenize (cognitive 23) crates/hir-def/src/preproc_condition.rs:311 — hir_def::preproc_condition::tokenize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×41
  • Duplicated block (8 lines × 2) crates/bsl-analyzer/src/handlers/request.rs:2257 — crates/bsl-analyzer/src/handlers/request.rs:2257-2264 | crates/bsl-analyzer/src/handlers/request.rs:2403-2410 — both copies are in the same file, so extract the 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/bsl-analyzer/src/workspace.rs:1155 — crates/bsl-analyzer/src/workspace.rs:1155-1162 | crates/bsl-analyzer/src/workspace.rs:1171-1178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/workspace.rs:1155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-analyzer/src/workspace.rs:1164` calls `common_modules` and `crates/bsl-analyzer/src/workspace.rs:1180` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/bsl-check-executor/src/native_check/runtime.rs:156 — crates/bsl-check-executor/src/native_check/runtime.rs:156-163 | crates/bsl-check-executor/src/native_check/runtime.rs:182-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/runtime.rs:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/bsl-check-executor/src/native_check/source.rs:39 — crates/bsl-check-executor/src/native_check/source.rs:39-46 | crates/bsl-check-executor/src/native_check/source.rs:137-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/source.rs:39` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) crates/bsl-launcher/src/use_cases.rs:547 — crates/bsl-launcher/src/use_cases.rs:547-554 | crates/bsl-launcher/src/use_cases.rs:601-608 — both copies are in the same file, so extract the 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/bsl-platform/src/capability/mod.rs:128 — crates/bsl-platform/src/capability/mod.rs:128-135 | crates/bsl-platform/src/security/mod.rs:36-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:555 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:555-562 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:642-649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:555` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/bsl-search/src/engine.rs:2614 — crates/bsl-search/src/engine.rs:2614-2621 | crates/bsl-search/src/engine.rs:2650-2657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:2614` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-search/src/engine.rs:2624` calls `Ok`, `Continue`, `owe_graph_contexts` and `crates/bsl-search/src/engine.rs:2658` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/bsl-search/src/engine.rs:3797 — crates/bsl-search/src/engine.rs:3797-3804 | crates/bsl-search/src/engine.rs:5839-5846 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:3797` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) REDACTED:3785 — REDACTED:3785-3792 | REDACTED:4253-4260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:3793` calls `push` and `REDACTED:4261` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/bsl-search/src/merge.rs:112 — crates/bsl-search/src/merge.rs:112-119 | crates/bsl-search/src/merge.rs:152-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/merge.rs:112` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) crates/bsl-search/src/workspace_overlay.rs:1039 — crates/bsl-search/src/workspace_overlay.rs:1039-1048 | crates/bsl-search/src/workspace_overlay.rs:1939-1946 — both copies are in the same file, so extract the 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/hir-def/src/body/lower/expr.rs:677 — crates/hir-def/src/body/lower/expr.rs:677-684 | crates/hir-def/src/body/lower/expr.rs:706-713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/expr.rs:677` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/hir-ty/src/field_lookup.rs:496 — crates/hir-ty/src/field_lookup.rs:496-503 | crates/hir-ty/src/iteration_lookup.rs:110-117 — 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 (8 lines × 2) crates/hir/src/semantic_symbol.rs:832 — crates/hir/src/semantic_symbol.rs:832-839 | crates/hir/src/semantic_symbol.rs:846-853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir/src/semantic_symbol.rs:832` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) crates/ide-db/src/database.rs:666 — crates/ide-db/src/database.rs:666-673 | crates/ide-db/src/metadata.rs:543-550 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:666` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) crates/ide-db/src/database.rs:2217 — crates/ide-db/src/database.rs:2217-2224 | crates/ide-db/src/database.rs:2280-2287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:2217` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:63 — crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:63-70 | crates/ide-diagnostics/src/handlers/deprecated_find.rs:60-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) crates/ide-diagnostics/src/handlers/unused_local_method.rs:229 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:229-237 | crates/ide-diagnostics/src/handlers/unused_parameters.rs:66-73 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/unused_local_method.rs` and `crates/ide-diagnostics/src/handlers/unused_parameters.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/unused_local_method.rs:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/ide/src/completion/sdbl/use_cases/complete_value_elements.rs:85 — crates/ide/src/completion/sdbl/use_cases/complete_value_elements.rs:85-92 | crates/ide/src/completion/sdbl/use_cases/complete_value_elements.rs:108-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/completion/sdbl/use_cases/complete_value_elements.rs:85` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) crates/ide/src/graph.rs:1961 — crates/ide/src/graph.rs:1961-1968 | crates/ide/src/graph.rs:1985-1992 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/graph.rs:1961` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/ide/src/graph.rs:2557 — crates/ide/src/graph.rs:2557-2564 | crates/mcp-server/src/graph_query.rs:1362-1369 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/graph.rs:2557` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/ide/src/partitioned_diagnostics_baseline.rs:629 — crates/ide/src/partitioned_diagnostics_baseline.rs:629-636 | crates/ide/src/partitioned_diagnostics_baseline.rs:1043-1050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/partitioned_diagnostics_baseline.rs:629` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/ide/src/symbol_info.rs:610 — crates/ide/src/symbol_info.rs:610-618 | crates/ide/src/symbol_info.rs:665-672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/symbol_info.rs:610` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/parser/src/grammar/sdbl/select.rs:852 — crates/parser/src/grammar/sdbl/select.rs:852-859 | crates/parser/src/grammar/sdbl/select.rs:898-905 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×41
  • Duplicated block (6 lines × 2) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:606 — crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:606-611 | crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:672-677 — both copies are in the same file, so extract the 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/bsl-analyzer/src/mcp_install/adapters.rs:165 — crates/bsl-analyzer/src/mcp_install/adapters.rs:165-170 | crates/bsl-analyzer/src/mcp_install/adapters.rs:323-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/mcp_install/adapters.rs:165` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:3085 — crates/bsl-check-executor/src/native_check/profile.rs:3085-3090 | crates/bsl-check-executor/src/native_check/profile.rs:3241-3246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:3085` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-check-executor/src/native_check/windows_acl.rs:134 — crates/bsl-check-executor/src/native_check/windows_acl.rs:134-139 | crates/mcp-server/src/cache_windows.rs:192-197 — before extracting anything, compare `crates/bsl-check-executor/src/native_check/windows_acl.rs` and `crates/mcp-server/src/cache_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/windows_acl.rs:134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-check-executor/src/native_check/windows_acl.rs:132` calls `get_current_user_sid`, `map_err`, `last_os_error` and `crates/mcp-server/src/cache_windows.rs:191` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/bsl-debug/src/dap/mod.rs:446 — crates/bsl-debug/src/dap/mod.rs:446-451 | crates/bsl-debug/src/dap/mod.rs:489-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/dap/mod.rs:446` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-metadata/src/common_attribute.rs:227 — crates/bsl-metadata/src/common_attribute.rs:227-232 | crates/bsl-metadata/src/common_attribute.rs:248-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/common_attribute.rs:227` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-metadata/src/configuration.rs:262 — crates/bsl-metadata/src/configuration.rs:262-267 | crates/bsl-metadata/src/configuration.rs:361-366 — both copies are in the same file, so extract the 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/bsl-metadata/src/metadata_object.rs:1168 — crates/bsl-metadata/src/metadata_object.rs:1168-1173 | crates/sdbl-hir/src/types.rs:327-332 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/bsl-metadata/src/xml_parser/form.rs:27 — crates/bsl-metadata/src/xml_parser/form.rs:27-33 | crates/bsl-metadata/src/xml_parser/form.rs:475-480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/xml_parser/form.rs:27` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) crates/bsl-metadata/src/xml_parser/form.rs:35 — crates/bsl-metadata/src/xml_parser/form.rs:35-40 | crates/bsl-metadata/src/xml_parser/form.rs:499-504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/xml_parser/form.rs:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-search/src/engine.rs:2396 — crates/bsl-search/src/engine.rs:2396-2401 | crates/bsl-search/src/workspace_overlay.rs:2619-2624 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:2396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-search/src/engine.rs:2866 — crates/bsl-search/src/engine.rs:2866-2871 | crates/bsl-search/src/engine.rs:2927-2932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:2866` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-search/src/engine.rs:5882 — crates/bsl-search/src/engine.rs:5882-5887 | crates/bsl-search/src/engine.rs:5937-5942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:5882` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) crates/bsl-search/src/lifecycle.rs:575 — crates/bsl-search/src/lifecycle.rs:575-580 | crates/bsl-search/src/lifecycle.rs:695-700 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/lifecycle.rs:575` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-search/src/workspace_overlay.rs:1482 — crates/bsl-search/src/workspace_overlay.rs:1482-1487 | crates/bsl-search/src/workspace_overlay.rs:1789-1794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/workspace_overlay.rs:1482` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/hir-def/src/body/lower/mod.rs:657 — crates/hir-def/src/body/lower/mod.rs:657-662 | crates/hir-def/src/body/lower/mod.rs:664-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) crates/hir-def/src/graph_index.rs:237 — crates/hir-def/src/graph_index.rs:237-242 | crates/hir-def/src/graph_index.rs:275-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/hir-def/src/graph_index.rs:281` calls `hash` and `crates/hir-def/src/graph_index.rs:243` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/hir-def/src/symbol_tree.rs:255 — crates/hir-def/src/symbol_tree.rs:255-260 | crates/hir-def/src/workspace.rs:59-64 — 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/ide-diagnostics/src/handlers/identical_expressions.rs:213 — crates/ide-diagnostics/src/handlers/identical_expressions.rs:213-218 | crates/ide-diagnostics/src/handlers/identical_expressions.rs:239-244 — both copies are in the same file, so extract the 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/ide/src/diagnostics_baseline.rs:418 — crates/ide/src/diagnostics_baseline.rs:418-423 | crates/ide/src/partitioned_diagnostics_baseline.rs:354-360 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) crates/mcp-server/src/change_hub.rs:5136 — crates/mcp-server/src/change_hub.rs:5136-5146 | crates/mcp-server/src/change_hub.rs:5888-5893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/change_hub.rs:5136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/mcp-server/src/state/embed.rs:1519 — crates/mcp-server/src/state/embed.rs:1519-1524 | crates/mcp-server/src/state/embed.rs:1657-1662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/embed.rs:1519` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/bsl-analyzer/src/handlers/notification.rs:298 — crates/bsl-analyzer/src/handlers/notification.rs:298-303 | crates/bsl-analyzer/src/handlers/notification.rs:494-499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-analyzer/src/handlers/notification.rs:295` calls `insert` and `crates/bsl-analyzer/src/handlers/notification.rs:491` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/bsl-platform/tools/html-parser/src/lib.rs:372 — crates/bsl-platform/tools/html-parser/src/lib.rs:372-377 | crates/platform-help/src/package.rs:141-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:130 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:130-135 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:534-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 16 more in this group — see findings.md.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×40
  • Symbol treated as nullable, then dereferenced unguarded crates/vfs-notify/src/lib.rs:88 — `stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker,"VfsLoader").spawn(move||actor.run(receiver))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/vfs-notify/src/lib.rs:93 — `self.sender.send(Message::Config(config))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `set_config` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/vfs-notify/src/lib.rs:97 — `self.sender.send(Message::WatchOnlyFiles(files))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `set_watch_only_files` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/vfs-notify/src/lib.rs:101 — `self.sender.send(Message::Invalidate(path))` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `invalidate` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/vfs-notify/src/lib.rs:179 — `it` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `next_event` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/vfs-notify/src/lib.rs:533 — `stdx::thread::Builder::new(stdx::thread::ThreadIntent::Worker,format!("VfsReader{i}"),).spawn(move||{while let Ok(path)=paths_rx.recv(){let contents=read(path.as_path());if results_tx.send((path,contents)).is_err(){break;}}})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `load_entry` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/vcs/src/author_filter.rs:214 — `slot.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `lines_kept_cached` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/syntax/src/sdbl_query.rs:710 — `text[pos..end].chars().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `skip_leading_whitespace` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/syntax/src/sdbl_query.rs:742 — `literal_text[pos..end].chars().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `process_content` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/fs.rs:151 — `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_walk_paths` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/fs.rs:198 — `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_read_files` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/fs.rs:253 — `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_read_transform` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/fs.rs:312 — `items.into_inner()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parallel_read_transform_with_progress` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/thread.rs:14 — `Builder::new(intent,name).spawn(f)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/thread.rs:61 — `self.inner.take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/thread/pool.rs:55 — `Builder::new(INITIAL_INTENT,format!("Worker{idx}",)).stack_size(STACK_SIZE).allow_leak(true).spawn({let extant_tasks=Arc::clone(&extant_tasks);let job_receiver:Receiver<Job>=job_receiver.clone();move||{let mut current_intent=INITIAL_INTENT;for job in job_receiver{if job.requested_intent!=current_intent{job.requested_intent.apply_to_current_thread();current_intent=job.requested_intent;}drop(panic::catch_unwind(job.f));extant_tasks.fetch_sub(1,Ordering::SeqCst);}}})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `new` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/thread/pool.rs:76 — `self.job_sender.send(job)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/stdx/src/thread/pool.rs:131 — `self.pool.job_sender.send(job)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `spawn` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/sdbl-hir/src/context_detector.rs:103 — `parts.last()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `parse_nested_field_chain` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/sdbl-hir/src/types.rs:108 — `sdbl_types.into_iter().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `from_attribute_type` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/sdbl-hir/src/lower/from_clause.rs:1397 — `arms.into_iter().next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `resolve_attribute_type_inner` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/project-model/src/diagnostics_baseline_fs.rs:164 — `relative.file_name()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `open_parent` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/project-model/src/extension_topology.rs:676 — `edges[current].iter().map(|id|id.index()).find(|idx|remaining_deps[*idx]>0)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `topological_order` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/project-model/src/lib.rs:1117 — `config.resolve_configuration_path(root)?` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `discover_source_path` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • Symbol treated as nullable, then dereferenced unguarded crates/project-model/src/source_set.rs:114 — `unit_outcomes.next()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `scan_in_scope` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×39
  • Duplicated block (10 lines × 2) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:1000 — crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:1000-1009 | crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:1198-1207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:1000` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:1013 — crates/bsl-check-executor/src/native_check/profile.rs:1013-1022 | crates/bsl-check-executor/src/native_check/profile.rs:1064-1073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:1013` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:2360 — crates/bsl-check-executor/src/native_check/profile.rs:2360-2369 | crates/bsl-check-executor/src/native_check/profile.rs:2387-2396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:2360` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:3015 — crates/bsl-check-executor/src/native_check/profile.rs:3015-3024 | crates/bsl-check-executor/src/native_check/profile.rs:3036-3045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:3015` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-check-executor/src/native_check/profile.rs:3012` calls `file_name` and `crates/bsl-check-executor/src/native_check/profile.rs:3035` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/bsl-debug/src/session.rs:1194 — crates/bsl-debug/src/session.rs:1194-1203 | crates/bsl-debug/src/session.rs:1290-1299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/bsl-platform/tools/html-parser/src/lib.rs:600 — crates/bsl-platform/tools/html-parser/src/lib.rs:600-609 | crates/bsl-platform/tools/html-parser/src/lib.rs:938-947 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/lib.rs:600` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) REDACTED:3564 — REDACTED:3564-3573 | REDACTED:3649-3658 — both copies are in the same file, so extract the 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) REDACTED:5504 — REDACTED:5504-5513 | REDACTED:5527-5536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5504` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/hir-def/src/body/lower/stmt.rs:823 — crates/hir-def/src/body/lower/stmt.rs:823-832 | crates/hir-def/src/body/lower/stmt.rs:874-883 — both copies are in the same file, so extract the 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/hir-ty/src/platform_resolution.rs:216 — crates/hir-ty/src/platform_resolution.rs:216-225 | crates/hir-ty/src/platform_resolution.rs:249-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/platform_resolution.rs:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) crates/ide-diagnostics/src/handlers/order_of_params.rs:24 — crates/ide-diagnostics/src/handlers/order_of_params.rs:24-33 | crates/ide-diagnostics/src/handlers/reserved_parameter_names.rs:31-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/order_of_params.rs:24` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/ide-diagnostics/src/handlers/unused_local_method.rs:33 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:33-42 | crates/ide-diagnostics/src/handlers/unused_parameters.rs:38-47 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/unused_local_method.rs` and `crates/ide-diagnostics/src/handlers/unused_parameters.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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/ide-diagnostics/src/handlers/unused_local_variable.rs:362 — crates/ide-diagnostics/src/handlers/unused_local_variable.rs:362-371 | crates/ide-diagnostics/src/handlers/unused_local_variable.rs:421-430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/unused_local_variable.rs:362` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/ide-diagnostics/src/handlers/weaving_annotation_not_applicable.rs:67 — crates/ide-diagnostics/src/handlers/weaving_annotation_not_applicable.rs:67-76 | crates/ide-diagnostics/src/handlers/weaving_signature_mismatch.rs:74-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/ide-diagnostics/src/sdbl_utils.rs:330 — crates/ide-diagnostics/src/sdbl_utils.rs:330-339 | crates/ide-diagnostics/src/sdbl_utils.rs:341-350 — both copies are in the same file, so extract the 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/ide/src/document_highlight.rs:50 — crates/ide/src/document_highlight.rs:50-59 | crates/ide/src/references.rs:30-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) crates/ide/src/goto_definition.rs:305 — crates/ide/src/goto_definition.rs:305-314 | crates/ide/src/goto_definition.rs:316-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/ide/src/hover.rs:657 — crates/ide/src/hover.rs:657-666 | crates/ide/src/hover.rs:681-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/hover.rs:657` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/mcp-server/src/tools/diagnostics.rs:341 — crates/mcp-server/src/tools/diagnostics.rs:341-350 | crates/mcp-server/src/tools/diagnostics.rs:362-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/diagnostics.rs:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/mcp-server/src/tools/search/docs.rs:197 — crates/mcp-server/src/tools/search/docs.rs:197-206 | crates/mcp-server/src/tools/search/docs.rs:231-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 (10 lines × 2) crates/mcp-server/src/tools/search/semantic.rs:51 — crates/mcp-server/src/tools/search/semantic.rs:51-60 | crates/mcp-server/src/tools/search/semantic.rs:233-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/mcp-server/src/workspace_lease.rs:1011 — crates/mcp-server/src/workspace_lease.rs:1011-1020 | crates/mcp-server/src/workspace_lease.rs:1028-1037 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/workspace_lease.rs:1011` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/sdbl-hir/src/literal.rs:151 — crates/sdbl-hir/src/literal.rs:151-160 | crates/sdbl-hir/src/literal.rs:181-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/literal.rs:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/symbol-info/src/presenters/signature_help.rs:95 — crates/symbol-info/src/presenters/signature_help.rs:95-104 | crates/symbol-info/src/presenters/signature_help.rs:123-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/symbol-info/src/presenters/signature_help.rs:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/project-model/src/source_set.rs:176 — crates/project-model/src/source_set.rs:176-185 | crates/project-model/src/workspace_walk.rs:110-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/project-model/src/source_set.rs:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/project-model/src/source_set.rs:175` calls `max_depth` and `crates/project-model/src/workspace_walk.rs:109` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×38
  • Duplicated block (5 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:3007 — crates/bsl-check-executor/src/native_check/profile.rs:3007-3011 | crates/bsl-check-executor/src/native_check/profile.rs:3031-3035 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:3007` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-check-executor/src/native_check/profile.rs:3012` calls `file_name` and `crates/bsl-check-executor/src/native_check/profile.rs:3036` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) crates/bsl-metadata/src/xml_parser/form.rs:116 — crates/bsl-metadata/src/xml_parser/form.rs:116-120 | crates/bsl-metadata/src/xml_parser/form.rs:165-169 — both copies are in the same file, so extract the 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/bsl-search/src/engine.rs:1929 — crates/bsl-search/src/engine.rs:1929-1933 | crates/bsl-search/src/engine.rs:2043-2049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) crates/bsl-search/src/merge.rs:98 — crates/bsl-search/src/merge.rs:98-102 | crates/bsl-search/src/merge.rs:138-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/merge.rs:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) REDACTED:3490 — REDACTED:3490-3494 | REDACTED:4295-4299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3490` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/hir-def/src/body/lower/diagnostics.rs:722 — crates/hir-def/src/body/lower/diagnostics.rs:722-726 | crates/hir-def/src/body/lower/diagnostics.rs:738-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/diagnostics.rs:722` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/hir-def/src/body/lower/stmt.rs:716 — crates/hir-def/src/body/lower/stmt.rs:716-720 | crates/hir-def/src/body/lower/stmt.rs:737-741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/stmt.rs:716` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/hir-def/src/module_index.rs:55 — crates/hir-def/src/module_index.rs:55-59 | crates/hir-def/src/module_index.rs:66-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/module_index.rs:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/hir-def/src/resolver.rs:432 — crates/hir-def/src/resolver.rs:432-436 | crates/hir-def/src/resolver.rs:447-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/resolver.rs:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/ide-db/src/metadata.rs:1293 — crates/ide-db/src/metadata.rs:1293-1297 | crates/ide-db/src/metadata.rs:1315-1319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/metadata.rs:1293` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/ide-diagnostics/src/handlers/unused_local_method.rs:415 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:415-419 | crates/mcp-server/src/graph_query.rs:85-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/unused_local_method.rs:415` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/ide-diagnostics/src/handlers/unused_local_variable.rs:299 — crates/ide-diagnostics/src/handlers/unused_local_variable.rs:299-303 | crates/ide-diagnostics/src/handlers/unused_local_variable.rs:335-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/unused_local_variable.rs:299` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/ide/src/hover.rs:267 — crates/ide/src/hover.rs:267-271 | crates/ide/src/hover.rs:494-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/hover.rs:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/mcp-server/src/graph/state.rs:1974 — crates/mcp-server/src/graph/state.rs:1974-1978 | crates/mcp-server/src/graph/state.rs:2011-2019 — both copies are in the same file, so extract the 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/mcp-server/src/graph/state.rs:2931 — crates/mcp-server/src/graph/state.rs:2931-2935 | crates/mcp-server/src/graph/state.rs:3002-3006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/graph/state.rs:2931` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/mcp-server/src/state/embed.rs:1576 — crates/mcp-server/src/state/embed.rs:1576-1580 | crates/mcp-server/src/state/embed.rs:1589-1593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/embed.rs:1576` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) crates/mcp-server/src/tools/platform.rs:1433 — crates/mcp-server/src/tools/platform.rs:1433-1437 | crates/mcp-server/src/tools/platform.rs:1458-1462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/platform.rs:1433` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) crates/symbol-info/src/adapters/global_function.rs:65 — crates/symbol-info/src/adapters/global_function.rs:65-69 | crates/symbol-info/src/adapters/platform_method.rs:85-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/symbol-info/src/adapters/global_function.rs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `docs` to `Option<&MethodDocs>` in one and `Option<&bsl_platform::MethodDocs>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) crates/base-db/src/queries.rs:323 — crates/base-db/src/queries.rs:323-327 | crates/hir-def/src/region_tree.rs:147-151 — 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/bsl-metadata/src/metadata_object.rs:513 — crates/bsl-metadata/src/metadata_object.rs:513-517 | crates/bsl-metadata/src/tabular_section.rs:150-154 — 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/bsl-platform/src/overlay_schema.rs:152 — crates/bsl-platform/src/overlay_schema.rs:152-160 | crates/bsl-platform/src/overlay_schema.rs:185-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/src/overlay_schema.rs:152` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/bsl-metadata/src/xml_parser/enum_parser.rs:18 — crates/bsl-metadata/src/xml_parser/enum_parser.rs:18-24 | crates/bsl-metadata/src/xml_parser/subsystem.rs:29-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/xml_parser/enum_parser.rs:18` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:466 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:466-472 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:479-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:466` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/bsl-metadata/src/xml_parser/form.rs:39 — crates/bsl-metadata/src/xml_parser/form.rs:39-45 | crates/bsl-metadata/src/xml_parser/predefined_parser.rs:31-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/xml_parser/form.rs:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:68 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:68-72 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:550-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 13 more in this group — see findings.md.
D2 · Cognitive Complexity · bsl_analyzer · ×34
  • bsl_analyzer::bin::cli::analyze::analyze_salsa (cognitive 142) crates/bsl-analyzer/src/bin/cli/analyze.rs:356 — bsl_analyzer::bin::cli::analyze::analyze_salsa has cognitive complexity 142 (threshold 15). Drivers by points: if/else 67 (104 pts), match/switch 9 (18 pts), boolean chains 13, loops 6 (7 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::bin::cli::deps::run_deps (cognitive 141) crates/bsl-analyzer/src/bin/cli/deps.rs:68 — bsl_analyzer::bin::cli::deps::run_deps has cognitive complexity 141 (threshold 15). Drivers by points: if/else 57 (101 pts), loops 14 (36 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::server::handle_task (cognitive 113) crates/bsl-analyzer/src/server.rs:1243 — bsl_analyzer::server::handle_task has cognitive complexity 113 (threshold 15). Drivers by points: if/else 37 (93 pts), boolean chains 9, match/switch 4 (7 pts), loops 1 (4 pts) (nesting depth added 62). 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.
  • bsl_analyzer::bin::cli::lsp::relay_lsp (cognitive 104) crates/bsl-analyzer/src/bin/cli/lsp.rs:382 — bsl_analyzer::bin::cli::lsp::relay_lsp has cognitive complexity 104 (threshold 15). Drivers by points: if/else 14 (59 pts), match/switch 8 (28 pts), loops 5 (14 pts), boolean chains 3 (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.
  • bsl_analyzer::server::handle_loader_msg (cognitive 74) crates/bsl-analyzer/src/server.rs:875 — bsl_analyzer::server::handle_loader_msg has cognitive complexity 74 (threshold 15). Drivers by points: if/else 14 (43 pts), loops 7 (22 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 45). 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.
  • bsl_analyzer::handlers::notification::handle_did_close (cognitive 61) crates/bsl-analyzer/src/handlers/notification.rs:510 — bsl_analyzer::handlers::notification::handle_did_close has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (51 pts), loops 1 (4 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 37). 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.
  • bsl_analyzer::bin::cli::diagnostics_baseline::apply_partitioned (cognitive 53) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:397 — bsl_analyzer::bin::cli::diagnostics_baseline::apply_partitioned has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (34 pts), match/switch 4 (9 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • bsl_analyzer::diagnostics_baseline::transaction::publish_set_with_hook (cognitive 53) crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:150 — bsl_analyzer::diagnostics_baseline::transaction::publish_set_with_hook has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (36 pts), match/switch 5 (10 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • bsl_analyzer::bin::cli::rules::markdown_to_html (cognitive 35) crates/bsl-analyzer/src/bin/cli/rules.rs:177 — bsl_analyzer::bin::cli::rules::markdown_to_html has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::handlers::request::handle_code_action (cognitive 34) crates/bsl-analyzer/src/handlers/request.rs:1360 — bsl_analyzer::handlers::request::handle_code_action has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::server::handle_vfs_msg (cognitive 29) crates/bsl-analyzer/src/server.rs:2257 — bsl_analyzer::server::handle_vfs_msg has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::bin::cli::bench::run_bench (cognitive 28) crates/bsl-analyzer/src/bin/cli/bench.rs:76 — bsl_analyzer::bin::cli::bench::run_bench has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 9 (21 pts), if/else 2 (7 pts) (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • bsl_analyzer::call_hierarchy_index_service::reconcile::reconcile (cognitive 28) crates/bsl-analyzer/src/call_hierarchy_index_service/reconcile.rs:11 — bsl_analyzer::call_hierarchy_index_service::reconcile::reconcile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 2 (5 pts), loops 2 (3 pts), 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.
  • bsl_analyzer::handlers::notification::handle_did_save (cognitive 26) crates/bsl-analyzer/src/handlers/notification.rs:681 — bsl_analyzer::handlers::notification::handle_did_save has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::bin::cli::diagnostics_baseline::validate_set_for_repair (cognitive 25) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:891 — bsl_analyzer::bin::cli::diagnostics_baseline::validate_set_for_repair has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::bin::cli::search_baseline::snapshot_id::resolve_parent (cognitive 25) crates/bsl-analyzer/src/bin/cli/search_baseline/snapshot_id.rs:31 — bsl_analyzer::bin::cli::search_baseline::snapshot_id::resolve_parent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 16). 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.
  • bsl_analyzer::handlers::notification::handle_did_change_watched_files (cognitive 24) crates/bsl-analyzer/src/handlers/notification.rs:802 — bsl_analyzer::handlers::notification::handle_did_change_watched_files has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, 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.
  • bsl_analyzer::bin::cli::search_baseline::retention::analyze (cognitive 23) crates/bsl-analyzer/src/bin/cli/search_baseline/retention.rs:171 — bsl_analyzer::bin::cli::search_baseline::retention::analyze has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::bin::cli::logging::journal::append_locked (cognitive 22) crates/bsl-analyzer/src/bin/cli/logging/journal.rs:442 — bsl_analyzer::bin::cli::logging::journal::append_locked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::bin::cli::search_baseline::documents::build_workspace_code (cognitive 22) crates/bsl-analyzer/src/bin/cli/search_baseline/documents.rs:90 — bsl_analyzer::bin::cli::search_baseline::documents::build_workspace_code has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (4 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::smoke::run (cognitive 22) crates/bsl-analyzer/src/smoke.rs:219 — bsl_analyzer::smoke::run has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (19 pts), if/else 2, loops 1 (nesting depth added 12). 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.
  • bsl_analyzer::bin::cli::check_config::build_check_config_report (cognitive 21) crates/bsl-analyzer/src/bin/cli/check_config.rs:222 — bsl_analyzer::bin::cli::check_config::build_check_config_report has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (5 pts), match/switch 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_analyzer::bin::cli::mcp::shared::serve_lsp (cognitive 20) crates/bsl-analyzer/src/bin/cli/mcp/shared.rs:612 — bsl_analyzer::bin::cli::mcp::shared::serve_lsp has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (10 pts), loops 4 (6 pts), if/else 3 (4 pts) (nesting depth added 8). 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.
  • bsl_analyzer::bin::cli::search_baseline::publish::run (cognitive 20) crates/bsl-analyzer/src/bin/cli/search_baseline/publish.rs:58 — bsl_analyzer::bin::cli::search_baseline::publish::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 7 (9 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • bsl_analyzer::smoke::run_session_edit_loop (cognitive 19) crates/bsl-analyzer/src/smoke.rs:824 — bsl_analyzer::smoke::run_session_edit_loop has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 7). 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.
  • + 9 more in this group — see findings.md.
D1 · Cyclomatic Complexity · ide_diagnostics · ×31
  • ide_diagnostics::handlers::rewrite_method_parameter::stmt_uses_binding (cyclomatic 42) crates/ide-diagnostics/src/handlers/rewrite_method_parameter.rs:478 — ide_diagnostics::handlers::rewrite_method_parameter::stmt_uses_binding 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.
  • ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::collect_and_check (cyclomatic 40) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:294 — ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::collect_and_check has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ide_diagnostics::handlers::unused_parameters::check (cyclomatic 35) crates/ide-diagnostics/src/handlers/unused_parameters.rs:31 — ide_diagnostics::handlers::unused_parameters::check has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ide_diagnostics::handlers::pairing_broken_transaction::dfs_check_paths (cyclomatic 33) crates/ide-diagnostics/src/handlers/pairing_broken_transaction.rs:324 — ide_diagnostics::handlers::pairing_broken_transaction::dfs_check_paths 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.
  • ide_diagnostics::handlers::unused_local_method::collect_called_methods (cyclomatic 30) crates/ide-diagnostics/src/handlers/unused_local_method.rs:132 — ide_diagnostics::handlers::unused_local_method::collect_called_methods has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ide_diagnostics::handlers::commented_code::strong_statement (cyclomatic 29) crates/ide-diagnostics/src/handlers/commented_code.rs:534 — ide_diagnostics::handlers::commented_code::strong_statement 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.
  • ide_diagnostics::hir_inference_dispatch::dispatch_inference_diagnostic (cyclomatic 28) crates/ide-diagnostics/src/hir_inference_dispatch.rs:139 — ide_diagnostics::hir_inference_dispatch::dispatch_inference_diagnostic has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • ide_diagnostics::handlers::using_hardcode_secret_information::check_body_exprs (cyclomatic 27) crates/ide-diagnostics/src/handlers/using_hardcode_secret_information.rs:80 — ide_diagnostics::handlers::using_hardcode_secret_information::check_body_exprs 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.
  • ide_diagnostics::handlers::server_calls_in_form_events::bfs_find_server_calls (cyclomatic 26) crates/ide-diagnostics/src/handlers/server_calls_in_form_events.rs:34 — ide_diagnostics::handlers::server_calls_in_form_events::bfs_find_server_calls 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.
  • ide_diagnostics::handlers::unused_local_variable::check_method (cyclomatic 25) crates/ide-diagnostics/src/handlers/unused_local_variable.rs:262 — ide_diagnostics::handlers::unused_local_variable::check_method 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.
  • ide_diagnostics::utils::nstr::extract_language_entries (cyclomatic 24) crates/ide-diagnostics/src/utils/nstr.rs:100 — ide_diagnostics::utils::nstr::extract_language_entries has cyclomatic complexity 24 (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.
  • ide_diagnostics::handlers::rewrite_method_parameter::scan_stmt_before_target (cyclomatic 21) crates/ide-diagnostics/src/handlers/rewrite_method_parameter.rs:269 — ide_diagnostics::handlers::rewrite_method_parameter::scan_stmt_before_target 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.
  • ide_diagnostics::handlers::duplicated_insertion_into_collection::check_stmt (cyclomatic 20) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:610 — ide_diagnostics::handlers::duplicated_insertion_into_collection::check_stmt has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • ide_diagnostics::handlers::incorrect_use_of_str_template::check_body (cyclomatic 20) crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:31 — ide_diagnostics::handlers::incorrect_use_of_str_template::check_body has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ide_diagnostics::handlers::unused_local_variable::build_attribute_names_to_skip (cyclomatic 20) crates/ide-diagnostics/src/handlers/unused_local_variable.rs:35 — ide_diagnostics::handlers::unused_local_variable::build_attribute_names_to_skip has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • ide_diagnostics::handlers::identical_expressions::are_exprs_semantically_equal (cyclomatic 19) crates/ide-diagnostics/src/handlers/identical_expressions.rs:35 — ide_diagnostics::handlers::identical_expressions::are_exprs_semantically_equal has cyclomatic complexity 19 (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: ide_diagnostics::handlers::identical_expressions::expr_to_string (cyclomatic 32) 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.
  • ide_diagnostics::handlers::identical_expressions::check_binary_expr_hir (cyclomatic 19) crates/ide-diagnostics/src/handlers/identical_expressions.rs:303 — ide_diagnostics::handlers::identical_expressions::check_binary_expr_hir has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ide_diagnostics::handlers::identical_expressions::expr_to_string (cyclomatic 32) 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.
  • ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::matches_trailing_pattern (cyclomatic 19) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:131 — ide_diagnostics::handlers::latin_and_cyrillic_symbol_in_word::matches_trailing_pattern 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.
  • ide_diagnostics::handlers::missing_code_try_catch_ex::check_stmt_recursive (cyclomatic 19) crates/ide-diagnostics/src/handlers/missing_code_try_catch_ex.rs:53 — ide_diagnostics::handlers::missing_code_try_catch_ex::check_stmt_recursive has cyclomatic complexity 19 (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.
  • ide_diagnostics::handlers::multilingual_string_has_all_declared_languages::check_body (cyclomatic 19) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:82 — ide_diagnostics::handlers::multilingual_string_has_all_declared_languages::check_body has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ide_diagnostics::handlers::nested_function_in_parameters::find_name_token_range (cyclomatic 19) crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:150 — ide_diagnostics::handlers::nested_function_in_parameters::find_name_token_range 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.
  • ide_diagnostics::handlers::timeouts_in_external_resources::check_body_for_timeouts (cyclomatic 19) crates/ide-diagnostics/src/handlers/timeouts_in_external_resources.rs:97 — ide_diagnostics::handlers::timeouts_in_external_resources::check_body_for_timeouts 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.
  • ide_diagnostics::handlers::redundant_access_to_object::from_hir (cyclomatic 17) crates/ide-diagnostics/src/handlers/redundant_access_to_object.rs:32 — ide_diagnostics::handlers::redundant_access_to_object::from_hir has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ide_diagnostics::handlers::redundant_access_to_object::get_plural_collection_name (cyclomatic 18) 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.
  • ide_diagnostics::handlers::using_hardcode_network_address::check_body_literals (cyclomatic 17) crates/ide-diagnostics/src/handlers/using_hardcode_network_address.rs:206 — ide_diagnostics::handlers::using_hardcode_network_address::check_body_literals 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.
  • ide_diagnostics::config::parsed_override (cyclomatic 16) crates/ide-diagnostics/src/config.rs:393 — ide_diagnostics::config::parsed_override 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.
  • + 6 more in this group — see findings.md.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×31
  • Recursive walk over a caller-supplied document has no depth cap crates/stdx/src/thread.rs:31 — `stack_size` is public and takes a `Builder` as its receiver from its caller, and it calls itself at line 31 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `stack_size` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/stdx/src/thread.rs:44 — `spawn` is public and takes a `Builder` as its receiver from its caller, and it calls itself at line 44 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `spawn` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/stdx/src/thread.rs:61 — `join` is public and takes a `JoinHandle` as its receiver from its caller, and it calls itself at line 61 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `join` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/hir.rs:71 — `collect_resolved_tables` is public and takes a `SdblHir` as its receiver from its caller, and it recurses at line 71 through `collect_expr_tables` and back with a piece of the document (and at line 74, line 78, line 82, line 86, line 90, line 94, line 98, line 102, line 511, line 513, line 517, line 520, line 524, line 525, line 527, line 530, line 535, line 538, line 539, line 542, line 546, line 547, line 548, line 551, line 552, line 554, line 557, line 560) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_resolved_tables` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/hir.rs:453 — `collect_resolved_attributes` is public, takes a document from its caller (line 114) and hands it to `walk_level_expr`, which calls itself at line 453 with a piece of the document (and at line 457, line 464, line 465, line 467, line 470, line 475, line 478, line 479, line 482, line 486, line 487, line 488, line 491, line 492, line 494, line 497, line 500) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `walk_level_expr` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/hir.rs:165 — `collect_resolved_attributes` is public and takes a `SdblHir` as its receiver from its caller, and it calls itself at line 165 with a piece of the document (and at line 172) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_resolved_attributes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/hir.rs:251 — `collect_dereference_chains` is public, takes a document from its caller (line 185) and hands it to `referred_object`, which calls itself at line 251 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `referred_object` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/hir.rs:216 — `collect_dereference_chains` is public and takes a `SdblHir` as its receiver from its caller, and it calls itself at line 216 with a piece of the document (and at line 223) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_dereference_chains` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/hir.rs:267 — `collect_referenced_objects` is public and takes a `SdblHir` as its receiver from its caller, and it recurses at line 267 through `collect_expr_objects` and back with a piece of the document (and at line 270, line 274, line 278, line 282, line 286, line 290, line 294, line 298, line 320, line 323, line 325, line 329, line 332, line 336, line 337, line 340, line 344, line 347, line 348, line 351, line 355, line 356, line 357, line 360, line 361, line 363, line 368) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `collect_referenced_objects` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/types.rs:129 — `is_numeric` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 129 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_numeric` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/types.rs:151 — `unwrap_aggregate` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 151 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `unwrap_aggregate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/types.rs:144 — `is_unlimited_string` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 144 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_unlimited_string` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/types.rs:186 — `is_compatible_with` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 186 with a piece of the document (and at line 187) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_compatible_with` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/types.rs:268 — `display_name` is public and takes a `SdblType` as its receiver from its caller, and it calls itself at line 268 with a piece of the document (and at line 277) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `display_name` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/lower/diagnostics.rs:304 — `check_nested_fields_by_dot` is public, takes a document from its caller (line 123) and hands it to `report_dotted_paths`, which calls itself at line 304 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `report_dotted_paths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/lower/diagnostics.rs:896 — `expanded` is public and takes `ty: &SdblType` from its caller, and it calls itself at line 896 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `expanded` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/lower/diagnostics.rs:545 — `check_ref_overuse` is public and takes `hir: &SdblHir` from its caller, and it recurses at line 545 through `check_ref_overuse_in_joins`, `check_ref_overuse_in_order_by`, `check_ref_overuse_in_having`, `check_ref_overuse_in_group_by`, `check_ref_overuse_in_where`, `check_expr_for_ref_overuse`, `check_ref_overuse_in_select` and back with a piece of the document (and at line 537, line 538, line 539, line 540, line 541, line 542, line 551, line 557, line 564, line 571, line 578, line 586, line 598, line 599, line 603, line 608, line 614, line 617, line 618, line 621, line 626, line 630, line 634, line 638, line 644, line 645, line 646, line 650, line 651, line 653, line 658, line 663) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `check_ref_overuse` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/lower/diagnostics.rs:771 — `check_unlimited_string_usage` is public, takes a document from its caller (line 719) and hands it to `check_expr_for_unlimited_string`, which calls itself at line 771 with a piece of the document (and at line 772, line 776, line 781, line 787, line 790, line 791, line 794, line 811, line 815, line 824, line 825, line 826, line 831, line 832, line 834, line 839, line 844) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `check_expr_for_unlimited_string` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/lower/diagnostics.rs:758 — `check_unlimited_string_usage` is public and takes `hir: &SdblHir` from its caller, and it calls itself at line 758 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `check_unlimited_string_usage` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/lower/missing_row.rs:270 — `of_when` is public, takes a document from its caller (line 175) and hands it to `value`, which recurses at line 270 through `propagates_null`, `isnull` and back with a piece of the document (and at line 280, line 287, line 300) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/sdbl-hir/src/lower/missing_row.rs:184 — `of` is public and takes `condition: &ExprHir` from its caller, and it calls itself at line 184 with a piece of the document (and at line 185, line 186) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `of` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/parser/src/parser.rs:636 — `a_line_break_precedes` is public and takes a `Parser` as its receiver from its caller, and it calls itself at line 636 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `a_line_break_precedes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/parser/src/parser.rs:645 — `a_gap_precedes` is public and takes a `Parser` as its receiver from its caller, and it calls itself at line 645 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `a_gap_precedes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/parser/src/grammar/sdbl/expressions.rs:276 — `expression` is public and takes `p: &mut Parser` from its caller, and it recurses at line 276 through `paren_or_subquery_expr`, `when_clause`, `case_expr`, `column_or_function`, `primary_expr`, `unary_expr`, `multiplicative_expr`, `additive_expr`, `predicate_expr`, `comparison_expr`, `not_expr`, `logical_and_expr`, `logical_or_expr` and back with a piece of the document (and at line 282, line 288, line 300, line 306, line 319, line 322, line 329, line 337, line 346, line 354, line 366, line 369, line 379, line 384, line 396, line 423, line 547, line 562, line 629, line 635, line 666, line 692, line 718, line 726, line 732, line 736, line 775, line 914, line 950, line 991, line 997, line 1006, line 1023, line 1031) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `expression` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap crates/parser/src/grammar/sdbl/select.rs:171 — `subquery` is public and takes `p: &mut Parser` from its caller, and it recurses at line 171 through `union_clause`, `join_clause`, `data_source`, `from_clause`, `query_body_clauses`, `query_content`, `query` and back with a piece of the document (and at line 182, line 195, line 212, line 253, line 566, line 579, line 593, line 700, line 748) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `subquery` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×29
  • Duplicated block (7 lines × 2) crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:197 — crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:197-203 | crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:221-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/bsl-check-executor/src/native_check/source.rs:84 — crates/bsl-check-executor/src/native_check/source.rs:84-90 | crates/bsl-check-executor/src/native_check/source.rs:566-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/source.rs:84` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) crates/bsl-platform/src/db.rs:512 — crates/bsl-platform/src/db.rs:512-518 | crates/bsl-platform/src/db.rs:599-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/bsl-search/src/engine.rs:102 — crates/bsl-search/src/engine.rs:102-108 | crates/bsl-search/src/engine.rs:117-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-search/src/engine.rs:109` calls `clone` and `crates/bsl-search/src/engine.rs:124` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) REDACTED:418 — REDACTED:418-424 | REDACTED:443-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:418` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/bsl-search/src/workspace_overlay.rs:980 — crates/bsl-search/src/workspace_overlay.rs:980-986 | crates/bsl-search/src/workspace_overlay.rs:1486-1494 — both copies are in the same file, so extract the 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/hir-def/src/body/lower/expr.rs:686 — crates/hir-def/src/body/lower/expr.rs:686-692 | crates/hir-def/src/body/lower/expr.rs:716-722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/expr.rs:686` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/hir-def/src/body/lower/expr.rs:734 — crates/hir-def/src/body/lower/expr.rs:734-740 | crates/hir-def/src/body/lower/expr.rs:756-762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/expr.rs:734` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/hir-def/src/body/lower/stmt.rs:853 — crates/hir-def/src/body/lower/stmt.rs:853-859 | crates/hir-def/src/body/lower/stmt.rs:920-926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/stmt.rs:853` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/hir-def/src/graph_index.rs:1764 — crates/hir-def/src/graph_index.rs:1764-1771 | crates/hir-def/src/graph_index.rs:1838-1844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:1764` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/hir-def/src/graph_index.rs:1762` calls `sort`, `dedup` and `crates/hir-def/src/graph_index.rs:1837` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/hir-def/src/name_usage_index.rs:196 — crates/hir-def/src/name_usage_index.rs:196-204 | crates/hir-def/src/workspace_index.rs:182-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `source_root_input` to `SourceRootInput` in one and `base_db::SourceRootInput` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) crates/hir-ty/src/field_lookup.rs:54 — crates/hir-ty/src/field_lookup.rs:54-60 | crates/hir-ty/src/field_lookup.rs:93-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/field_lookup.rs:54` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) crates/hir/src/lib.rs:930 — crates/hir/src/lib.rs:930-936 | crates/hir/src/lib.rs:938-944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) crates/ide/src/syntax_highlighting.rs:348 — crates/ide/src/syntax_highlighting.rs:348-354 | crates/ide/src/syntax_highlighting.rs:359-365 — both copies are in the same file, so extract the 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/mcp-server/src/state/bootstrap.rs:1578 — crates/mcp-server/src/state/bootstrap.rs:1578-1584 | crates/mcp-server/src/state/bootstrap.rs:1610-1616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/bootstrap.rs:1578` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/hir-ty/src/method_lookup/union.rs:17 — crates/hir-ty/src/method_lookup/union.rs:17-23 | crates/hir-ty/src/platform_resolution.rs:111-117 — 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/ide/src/graph.rs:1133 — crates/ide/src/graph.rs:1133-1139 | crates/ide/src/graph.rs:1483-1489 — both copies are in the same file, so extract the 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/bsl-analyzer/src/bin/cli/source_set.rs:617 — crates/bsl-analyzer/src/bin/cli/source_set.rs:617-623 | crates/project-model/src/lib.rs:2138-2144 — 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/hir-def/src/body/lower/query_fragment.rs:260 — crates/hir-def/src/body/lower/query_fragment.rs:260-266 | crates/ide-diagnostics/src/handlers/query_to_missing_metadata.rs:201-207 — 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/bsl-platform/tools/html-parser/src/scraper_parser.rs:151 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:151-157 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:1499-1505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) crates/bsl-launcher/src/provider/server.rs:72 — crates/bsl-launcher/src/provider/server.rs:72-78 | crates/bsl-launcher/src/provider/server.rs:87-93 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-launcher/src/provider/server.rs:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/ide/src/hover.rs:386 — crates/ide/src/hover.rs:386-392 | crates/ide/src/hover.rs:395-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) crates/bsl-metadata/src/xml_parser/constant.rs:22 — crates/bsl-metadata/src/xml_parser/constant.rs:22-28 | crates/bsl-metadata/src/xml_parser/enum_parser.rs:39-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/xml_parser/constant.rs:22` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/bsl-metadata/src/configuration.rs:199 — crates/bsl-metadata/src/configuration.rs:199-205 | crates/bsl-metadata/src/configuration.rs:206-212 — both copies are in the same file, so extract the 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/bsl-analyzer/src/task_pool.rs:117 — crates/bsl-analyzer/src/task_pool.rs:117-123 | crates/bsl-analyzer/src/task_pool.rs:135-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/task_pool.rs:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 4 more in this group — see findings.md.
D2 · Cognitive Complexity · ide · ×28
  • ide::completion::platform_completion::platform_completions (cognitive 71) crates/ide/src/completion/platform_completion.rs:72 — ide::completion::platform_completion::platform_completions has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (52 pts), loops 5 (15 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::hover::definition_to_hover (cognitive 45) crates/ide/src/hover.rs:344 — ide::hover::definition_to_hover has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (38 pts), match/switch 3 (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.
  • ide::graph::build_workspace_graph_rows (cognitive 40) crates/ide/src/graph.rs:1112 — ide::graph::build_workspace_graph_rows has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 9 (12 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::partitioned_diagnostics_baseline::classify_partitioned_diagnostics_with (cognitive 38) crates/ide/src/partitioned_diagnostics_baseline.rs:327 — ide::partitioned_diagnostics_baseline::classify_partitioned_diagnostics_with has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 3 (8 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::completion::mdo_completion::mdo_completions (cognitive 33) crates/ide/src/completion/mdo_completion.rs:13 — ide::completion::mdo_completion::mdo_completions has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 6 (11 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.
  • ide::partitioned_diagnostics_baseline::load_diagnostics_baseline_set_once (cognitive 32) crates/ide/src/partitioned_diagnostics_baseline.rs:796 — ide::partitioned_diagnostics_baseline::load_diagnostics_baseline_set_once has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 3, loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::completion::type_string_completion::type_string_completions (cognitive 29) crates/ide/src/completion/type_string_completion.rs:29 — ide::completion::type_string_completion::type_string_completions has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 8 (10 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::references::resolve_by_text (cognitive 28) crates/ide/src/references.rs:667 — ide::references::resolve_by_text has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3 (4 pts), boolean chains 2, match/switch 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.
  • ide::completion::bsl_completion::complete_user_defined_symbols (cognitive 26) crates/ide/src/completion/bsl_completion.rs:750 — ide::completion::bsl_completion::complete_user_defined_symbols has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::declarations::resolve_declarations (cognitive 25) crates/ide/src/declarations.rs:94 — ide::declarations::resolve_declarations has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::symbol_info::weaving_sites (cognitive 25) crates/ide/src/symbol_info.rs:1615 — ide::symbol_info::weaving_sites has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::syntax_highlighting::traverse_node (cognitive 25) crates/ide/src/syntax_highlighting.rs:174 — ide::syntax_highlighting::traverse_node has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::completion::bsl_completion::complete_local_symbols (cognitive 22) crates/ide/src/completion/bsl_completion.rs:332 — ide::completion::bsl_completion::complete_local_symbols has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 4 (5 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::name_lookup::from_metadata_listing (cognitive 21) crates/ide/src/name_lookup.rs:1130 — ide::name_lookup::from_metadata_listing has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (7 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.
  • ide::completion::mdo_completion::detect_from_ident_after_dot (cognitive 20) crates/ide/src/completion/mdo_completion.rs:186 — ide::completion::mdo_completion::detect_from_ident_after_dot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (20 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.
  • ide::hover::hover_field (cognitive 20) crates/ide/src/hover.rs:55 — ide::hover::hover_field has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (20 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.
  • ide::symbol_info::form::card::form_member_card (cognitive 19) crates/ide/src/symbol_info/form/card.rs:143 — ide::symbol_info::form::card::form_member_card has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::syntax_highlighting::highlight_token (cognitive 19) crates/ide/src/syntax_highlighting.rs:281 — ide::syntax_highlighting::highlight_token has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • ide::completion::bsl_completion::bsl_completions (cognitive 18) crates/ide/src/completion/bsl_completion.rs:18 — ide::completion::bsl_completion::bsl_completions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::completion::mdo_completion::detect_from_dot (cognitive 18) crates/ide/src/completion/mdo_completion.rs:155 — ide::completion::mdo_completion::detect_from_dot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (18 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ide::formatting::ir::apply_policy (cognitive 18) crates/ide/src/formatting/ir.rs:176 — ide::formatting::ir::apply_policy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::graph::accumulate_method_edges (cognitive 18) crates/ide/src/graph.rs:837 — ide::graph::accumulate_method_edges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::symbol_info::resolve_triple (cognitive 18) crates/ide/src/symbol_info.rs:1026 — ide::symbol_info::resolve_triple has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::completion::platform_completion::find_type_hints (cognitive 17) crates/ide/src/completion/platform_completion.rs:29 — ide::completion::platform_completion::find_type_hints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide::formatting::ir::decide_inline_gap (cognitive 17) crates/ide/src/formatting/ir.rs:248 — ide::formatting::ir::decide_inline_gap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×28
  • Duplicated block (9 lines × 2) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:321 — crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:321-329 | crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:356-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:3349 — crates/bsl-check-executor/src/native_check/profile.rs:3349-3357 | crates/bsl-check-executor/src/native_check/profile.rs:3364-3372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-check-executor/src/native_check/profile.rs:3347` calls `now`, `saturating_duration_since` and `crates/bsl-check-executor/src/native_check/profile.rs:3363` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/bsl-launcher/src/entities.rs:48 — crates/bsl-launcher/src/entities.rs:48-56 | crates/bsl-launcher/src/entities.rs:74-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-launcher/src/entities.rs:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/bsl-platform/src/db.rs:909 — crates/bsl-platform/src/db.rs:909-917 | crates/bsl-platform/src/db.rs:1007-1017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/src/db.rs:909` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/bsl-search/src/engine.rs:286 — crates/bsl-search/src/engine.rs:286-294 | crates/bsl-search/src/engine.rs:392-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:568 — REDACTED:568-576 | REDACTED:654-662 — both copies are in the same file, so extract the 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/hir-ty/src/infer.rs:899 — crates/hir-ty/src/infer.rs:899-907 | crates/hir-ty/src/infer.rs:933-941 — both copies are in the same file, so extract the 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/ide-db/src/database.rs:1278 — crates/ide-db/src/database.rs:1278-1286 | crates/ide-db/src/database.rs:2214-2223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:1278` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide-db/src/database.rs:2224` calls `Some` and `crates/ide-db/src/database.rs:1287` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/ide-diagnostics/src/handlers/deprecated_platform_facts.rs:57 — crates/ide-diagnostics/src/handlers/deprecated_platform_facts.rs:57-65 | crates/ide-diagnostics/src/handlers/deprecated_platform_facts.rs:72-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/deprecated_platform_facts.rs:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/ide-diagnostics/src/utils/nstr.rs:69 — crates/ide-diagnostics/src/utils/nstr.rs:69-77 | crates/ide-diagnostics/src/utils/nstr.rs:111-119 — both copies are in the same file, so extract the 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/ide-host-core/src/workspace.rs:547 — crates/ide-host-core/src/workspace.rs:547-555 | crates/ide-host-core/src/workspace.rs:561-569 — both copies are in the same file, so extract the 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/ide/src/completion/mdo_completion.rs:81 — crates/ide/src/completion/mdo_completion.rs:81-89 | crates/ide/src/completion/mdo_completion.rs:96-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/mcp-server/src/graph/debt.rs:1287 — crates/mcp-server/src/graph/debt.rs:1287-1295 | crates/mcp-server/src/graph/debt.rs:1850-1858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `super) fn change_answered(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) REDACTED:2800 — REDACTED:2800-2808 | REDACTED:2850-2858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2800` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/mcp-server/src/lib.rs:2856 — crates/mcp-server/src/lib.rs:2856-2864 | crates/mcp-server/src/lib.rs:3042-3050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/lib.rs:2856` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/mcp-server/src/tools/platform.rs:515 — crates/mcp-server/src/tools/platform.rs:515-523 | crates/mcp-server/src/tools/platform.rs:581-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/platform.rs:515` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `item` to `&bsl_platform::PlatformMethod` in one and `&bsl_platform::GlobalFunction` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/mcp-server/src/tools/platform.rs:514` calls `owner_identity`, `as_str` and `crates/mcp-server/src/tools/platform.rs:580` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/symbol-info/src/adapters/global_function.rs:71 — crates/symbol-info/src/adapters/global_function.rs:71-79 | crates/symbol-info/src/adapters/platform_method.rs:91-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/symbol-info/src/adapters/global_function.rs:71` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `docs` to `Option<&MethodDocs>` in one and `Option<&bsl_platform::MethodDocs>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:885 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:885-893 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:899-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:885` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/hir-def/src/body/lower/expr.rs:1714 — crates/hir-def/src/body/lower/expr.rs:1714-1722 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:194-202 — before extracting anything, compare `crates/hir-def/src/body/lower/expr.rs` and `crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/ide/src/partitioned_diagnostics_baseline.rs:1186 — crates/ide/src/partitioned_diagnostics_baseline.rs:1186-1194 | crates/project-model/src/lib.rs:1784-1792 — 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/bsl-search/src/hybrid.rs:53 — crates/bsl-search/src/hybrid.rs:53-61 | crates/bsl-search/src/merge.rs:174-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `hit` to `&SearchHit` in one and `&MergedHit` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:132 — crates/bsl-check-executor/src/native_check/profile.rs:132-140 | crates/bsl-check-executor/src/native_check/profile.rs:2773-2781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/mcp-server/src/cache.rs:312 — crates/mcp-server/src/cache.rs:312-320 | crates/mcp-server/src/cache.rs:329-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/cache.rs:312` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) crates/bsl-analyzer/src/mcp_install/adapters.rs:250 — crates/bsl-analyzer/src/mcp_install/adapters.rs:250-258 | crates/bsl-analyzer/src/mcp_install/adapters.rs:483-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/mcp_install/adapters.rs:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:708 — crates/bsl-check-executor/src/native_check/profile.rs:708-716 | crates/bsl-check-executor/src/native_check/profile.rs:1128-1136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:708` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • + 3 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×25
  • TooManyMethods: SearchEngine crates/bsl-search/src/engine.rs:457 — TooManyMethods — 189 methods. The bar is 30 methods; this is 159 over it, 6.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Store REDACTED:14 — TooManyMethods — 156 methods. The bar is 30 methods; this is 126 over it, 5.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InferenceContext crates/hir-ty/src/infer.rs:670 — TooManyMethods — 133 methods. The bar is 30 methods; this is 103 over it, 4.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RootDatabaseImpl crates/ide-db/src/database.rs:95 — TooManyMethods — 129 methods. The bar is 30 methods; this is 99 over it, 4.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GraphState crates/mcp-server/src/graph/state.rs:285 — TooManyMethods — 115 methods, declared across 2 files: graph/state.rs (100), graph/snapshot.rs (15). The bar is 30 methods; this is 85 over it, 3.83× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SharedState crates/mcp-server/src/state/mod.rs:408 — TooManyMethods — 109 methods, declared across 4 files: state/mod.rs (50), state/bootstrap.rs (37), state/embed.rs (12), state/sync.rs (10). The bar is 30 methods; this is 79 over it, 3.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LoweringContext crates/sdbl-hir/src/lower/context.rs:9 — TooManyMethods — 95 methods, declared across 12 files: lower/diagnostics.rs (31), lower/from_clause.rs (20), expr/mod.rs (10), lower/clauses.rs (9), +8 more file(s). The bar is 30 methods; this is 65 over it, 3.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GlobalState crates/bsl-analyzer/src/global_state.rs:396 — TooManyMethods — 88 methods, declared across 6 files: src/global_state.rs (36), src/workspace.rs (33), src/analysis_scope.rs (9), src/diagnostics_state.rs (5), +2 more file(s). The bar is 30 methods; this is 58 over it, 2.93× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DiagnosticsState crates/mcp-server/src/diagnostics_state/lifecycle.rs:307 — TooManyMethods — 74 methods, declared across 3 files: diagnostics_state/lifecycle.rs (43), diagnostics_state/drift.rs (28), diagnostics_state/snapshot.rs (3). The bar is 30 methods; this is 44 over it, 2.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Parser crates/parser/src/parser.rs:17 — TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AnalysisContext crates/ide-diagnostics/src/context.rs:12 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WorkspaceOverlayCache crates/bsl-search/src/workspace_overlay.rs:168 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DebugSession crates/bsl-debug/src/session.rs:19 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Configuration crates/bsl-metadata/src/configuration.rs:20 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PostgresBaselineAdapter REDACTED:115 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GraphDebt crates/mcp-server/src/graph/debt.rs:871 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Analysis crates/ide/src/lib.rs:118 — TooManyMethods — 45 methods, declared across 2 files: src/lib.rs (39), src/graph.rs (6). The bar is 30 methods; this is 15 over it, 1.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GraphDb crates/mcp-server/src/graph_query.rs:390 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Scope crates/sdbl-hir/src/scope.rs:32 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WorkspaceChangeHub crates/mcp-server/src/change_hub.rs:1877 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Resolver crates/hir-def/src/resolver.rs:10 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Project crates/project-model/src/lib.rs:341 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PlatformDataInner crates/bsl-platform/src/db.rs:50 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GraphCtx crates/ide/src/graph.rs:1707 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WorkspaceLease crates/mcp-server/src/workspace_lease.rs:224 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×25
  • Duplicated block (11 lines × 2) crates/bsl-analyzer/src/bin/cli/search_baseline/documents.rs:98 — crates/bsl-analyzer/src/bin/cli/search_baseline/documents.rs:98-108 | crates/mcp-server/src/project.rs:107-117 — 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/bsl-analyzer/src/handlers/request.rs:445 — crates/bsl-analyzer/src/handlers/request.rs:445-455 | crates/bsl-analyzer/src/handlers/request.rs:652-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `CallHierarchyIncomingCallsParams` in one and `CallHierarchyOutgoingCallsParams` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-analyzer/src/handlers/request.rs:650` calls `entered` and `crates/bsl-analyzer/src/handlers/request.rs:444` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:249 — crates/bsl-check-executor/src/native_check/profile.rs:249-259 | crates/bsl-check-executor/src/native_check/profile.rs:2880-2890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:1001 — crates/bsl-check-executor/src/native_check/profile.rs:1001-1011 | crates/bsl-check-executor/src/native_check/profile.rs:1052-1062 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:1001` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/bsl-check-executor/src/native_check/windows_acl.rs:120 — crates/bsl-check-executor/src/native_check/windows_acl.rs:120-130 | crates/mcp-server/src/cache_windows.rs:181-191 — before extracting anything, compare `crates/bsl-check-executor/src/native_check/windows_acl.rs` and `crates/mcp-server/src/cache_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-check-executor/src/native_check/windows_acl.rs:132` calls `get_current_user_sid`, `map_err`, `last_os_error` and `crates/mcp-server/src/cache_windows.rs:192` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/bsl-platform/tools/html-parser/src/lib.rs:648 — crates/bsl-platform/tools/html-parser/src/lib.rs:648-658 | crates/bsl-platform/tools/html-parser/src/lib.rs:1000-1010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/lib.rs:648` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/bsl-search/src/engine.rs:635 — crates/bsl-search/src/engine.rs:635-645 | crates/bsl-search/src/engine.rs:1181-1191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:635` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:3991 — REDACTED:3991-4001 | REDACTED:4094-4104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3991` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/hir-def/src/docs.rs:295 — crates/hir-def/src/docs.rs:295-305 | crates/hir-def/src/docs.rs:310-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/docs.rs:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/hir-def/src/docs.rs:720 — crates/hir-def/src/docs.rs:720-730 | crates/hir-def/src/docs.rs:872-882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/docs.rs:720` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/ide-db/src/database.rs:1739 — crates/ide-db/src/database.rs:1739-1749 | crates/ide-db/src/database.rs:1890-1900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:1739` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:27 — crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:27-37 | crates/ide-diagnostics/src/handlers/deprecated_find.rs:27-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:27` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:842 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:842-852 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:855-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:855` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/ide-diagnostics/src/handlers/missing_form_event_handler.rs:34 — crates/ide-diagnostics/src/handlers/missing_form_event_handler.rs:34-44 | crates/ide-diagnostics/src/handlers/ordinary_form_dialog_unread.rs:33-43 — 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 (11 lines × 2) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:123 — crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:123-133 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:70-80 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs` and `crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:1168 — REDACTED:1168-1178 | REDACTED:1746-1756 — both copies are in the same file, so extract the 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/mcp-server/src/state/bootstrap.rs:2061 — crates/mcp-server/src/state/bootstrap.rs:2061-2071 | crates/mcp-server/src/state/bootstrap.rs:2117-2127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/bootstrap.rs:2061` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/mcp-server/src/state/embed.rs:1583 — crates/mcp-server/src/state/embed.rs:1583-1593 | crates/mcp-server/src/state/embed.rs:1651-1661 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/parser/src/grammar/statements.rs:243 — crates/parser/src/grammar/statements.rs:243-253 | crates/parser/src/grammar/statements.rs:278-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/parser/src/grammar/statements.rs:243` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/project-model/src/diagnostics_baseline_fs.rs:47 — crates/project-model/src/diagnostics_baseline_fs.rs:47-57 | crates/project-model/src/diagnostics_baseline_fs.rs:168-178 — both copies are in the same file, so extract the 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/ide/src/completion/bsl_completion.rs:776 — crates/ide/src/completion/bsl_completion.rs:776-788 | crates/ide/src/completion/bsl_completion.rs:809-819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/completion/bsl_completion.rs:776` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) REDACTED:1046 — REDACTED:1046-1056 | crates/mcp-server/src/tasks.rs:84-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1046` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) crates/ide-diagnostics/src/handlers/usage_write_log_event.rs:45 — crates/ide-diagnostics/src/handlers/usage_write_log_event.rs:45-55 | crates/ide-diagnostics/src/handlers/usage_write_log_event.rs:56-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/usage_write_log_event.rs:45` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) crates/bsl-metadata/src/xml_parser/role.rs:113 — crates/bsl-metadata/src/xml_parser/role.rs:113-123 | crates/bsl-metadata/src/xml_parser/subsystem.rs:73-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/xml_parser/role.rs:113` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:4680 — REDACTED:4680-4690 | REDACTED:5323-5333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×24
  • Edited copy of a member (14 corresponding lines) crates/hir-def/src/conditional_tree.rs:513 — crates/hir-def/src/conditional_tree.rs:513-529 | crates/hir-def/src/region_tree.rs:373-386 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-search/src/engine.rs:5908 — crates/bsl-search/src/engine.rs:5908-5924 | crates/bsl-search/src/engine.rs:5932-5945 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/mcp-server/src/workspace_lease.rs:1130 — crates/mcp-server/src/workspace_lease.rs:1130-1147 | crates/project-model/src/lib.rs:1218-1231 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/line-index/src/lib.rs:176 — crates/line-index/src/lib.rs:176-189 | crates/line-index/src/lib.rs:269-282 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/mcp-server/src/broker/name.rs:113 — crates/mcp-server/src/broker/name.rs:113-133 | crates/mcp-server/src/broker/name.rs:243-256 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-analyzer/src/handlers/dispatch.rs:138 — crates/bsl-analyzer/src/handlers/dispatch.rs:138-151 | crates/bsl-analyzer/src/handlers/dispatch.rs:161-175 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-check-executor/src/native_check/compiler.rs:277 — crates/bsl-check-executor/src/native_check/compiler.rs:277-292 | crates/bsl-check-executor/src/native_check/profile.rs:2150-2163 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/ide-db/src/queries.rs:168 — crates/ide-db/src/queries.rs:168-181 | crates/ide-db/src/queries.rs:196-209 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-analyzer/src/tracing/hprof.rs:28 — crates/bsl-analyzer/src/tracing/hprof.rs:28-41 | crates/bsl-analyzer/src/tracing/json.rs:33-46 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-metadata/src/common_attribute.rs:226 — crates/bsl-metadata/src/common_attribute.rs:226-239 | crates/bsl-metadata/src/common_attribute.rs:247-264 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/ide-db/src/database.rs:437 — crates/ide-db/src/database.rs:437-450 | crates/ide-db/src/database.rs:476-491 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/ide-diagnostics/src/handlers/commented_code.rs:35 — crates/ide-diagnostics/src/handlers/commented_code.rs:35-48 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:38-58 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/hir-ty/src/infer.rs:896 — crates/hir-ty/src/infer.rs:896-910 | crates/hir-ty/src/infer.rs:930-943 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-check-executor/src/native_check/root_lock.rs:334 — crates/bsl-check-executor/src/native_check/root_lock.rs:334-351 | crates/bsl-launcher/src/cache.rs:166-179 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/syntax/src/ast.rs:60 — crates/syntax/src/ast.rs:60-73 | crates/syntax/src/ast.rs:124-137 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/ide-diagnostics/src/handlers/if_condition_complexity.rs:23 — crates/ide-diagnostics/src/handlers/if_condition_complexity.rs:23-37 | crates/ide-diagnostics/src/handlers/nested_statements.rs:25-38 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-analyzer/src/mem_report.rs:21 — crates/bsl-analyzer/src/mem_report.rs:21-34 | crates/bsl-analyzer/src/mem_report.rs:39-52 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/bsl-search/src/workspace_overlay.rs:403 — crates/bsl-search/src/workspace_overlay.rs:403-417 | crates/bsl-search/src/workspace_overlay.rs:425-438 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:221 — crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:221-238 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:240-253 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/mcp-server/src/tools/diagnostics.rs:358 — crates/mcp-server/src/tools/diagnostics.rs:358-371 | crates/mcp-server/src/tools/graph.rs:334-347 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/hir-def/src/preproc_condition.rs:195 — crates/hir-def/src/preproc_condition.rs:195-210 | crates/hir-def/src/preproc_condition.rs:215-228 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) REDACTED:1520 — REDACTED:1520-1533 | REDACTED:4516-4532 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/ide-diagnostics/src/handlers/missing_code_try_catch_ex.rs:25 — crates/ide-diagnostics/src/handlers/missing_code_try_catch_ex.rs:25-38 | crates/ide-diagnostics/src/handlers/number_of_values_in_structure_constructor.rs:24-37 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/parser/src/grammar/sdbl/expressions.rs:41 — crates/parser/src/grammar/sdbl/expressions.rs:41-55 | crates/parser/src/grammar/sdbl/select.rs:516-529 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
X18 · Disposal-pattern correctness · Explicit release owed and not made on every path · ×24
  • Explicit release owed and not made on every path REDACTED:1185 — `writer` (line 1185) is a `GraphDbWriter` this function owns and never releases: no `finalize()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `GraphDbWriter` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/bad_words.rs:49 — `config` (line 49) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/commented_code.rs:128 — `config` (line 128) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/duplicate_string_literal.rs:46 — `config` (line 46) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/duplicate_string_literal.rs:72 — `config` (line 72) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:467 — `config` (line 467) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/line_length.rs:81 — `config` (line 81) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/magic_date.rs:273 — `config` (line 273) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/magic_number.rs:36 — `config` (line 36) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/missing_space.rs:350 — `config` (line 350) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/missing_temporary_file_deletion.rs:71 — `config` (line 71) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:73 — `config` (line 73) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/timeouts_in_external_resources.rs:92 — `config` (line 92) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/typo.rs:330 — `config` (line 330) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/typo.rs:393 — `config` (line 393) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/using_hardcode_network_address.rs:200 — `config` (line 200) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path crates/ide-diagnostics/src/handlers/using_hardcode_path.rs:126 — `config` (line 126) is a `Config` this function owns and never releases: no `init()` or `init_with_layer()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Config` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
  • Explicit release owed and not made on every path REDACTED:3159 — `tx` (line 3159) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
  • Explicit release owed and not made on every path REDACTED:3773 — `tx` (line 3773) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
  • Explicit release owed and not made on every path REDACTED:4426 — `tx` (line 4426) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 4446; the `return` on line 4437 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path REDACTED:4557 — `tx` (line 4557) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 4610; the `return` on line 4581 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path REDACTED:4683 — `tx` (line 4683) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 4702; the `return` on line 4692 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path REDACTED:5326 — `tx` (line 5326) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 5344; the `return` on line 5335 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
  • Explicit release owed and not made on every path REDACTED:1363 — `tx` (line 1363) is a transaction released by `commit()` (or a deliberate `rollback()`) only on the path that reaches line 1391; the `return` on line 1369 leaves before that with a success value, and on that path a transaction that is dropped rolls back, so every write made through it is silently undone. Release it before that `return` too (or return an error there, if the early exit is a failure).
D1 · Cyclomatic Complexity · hir_def · ×22
  • hir_def::body::lower::expr::lower_call_expr (cyclomatic 85) crates/hir-def/src/body/lower/expr.rs:385 — hir_def::body::lower::expr::lower_call_expr has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • hir_def::body::lower::expr::determine_magic_number_context (cyclomatic 35) crates/hir-def/src/body/lower/expr.rs:1855 — hir_def::body::lower::expr::determine_magic_number_context has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • hir_def::body::lower::stmt::lower_stmt_list_with_unreachable (cyclomatic 29) crates/hir-def/src/body/lower/stmt.rs:246 — hir_def::body::lower::stmt::lower_stmt_list_with_unreachable 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.
  • hir_def::docs::tokens::doc_comment_tokens (cyclomatic 27) crates/hir-def/src/docs/tokens.rs:33 — hir_def::docs::tokens::doc_comment_tokens 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.
  • hir_def::body::lower::expr::lower_binary_expr (cyclomatic 22) crates/hir-def/src/body/lower/expr.rs:246 — hir_def::body::lower::expr::lower_binary_expr has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • hir_def::body::lower::lower_method_with_externals (cyclomatic 21) crates/hir-def/src/body/lower/mod.rs:401 — hir_def::body::lower::lower_method_with_externals 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.
  • hir_def::call_graph::extract_from_body (cyclomatic 21) crates/hir-def/src/call_graph.rs:917 — hir_def::call_graph::extract_from_body 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.
  • hir_def::body::lower::expr::is_unsafe_safe_mode_context (cyclomatic 20) crates/hir-def/src/body/lower/expr.rs:2010 — hir_def::body::lower::expr::is_unsafe_safe_mode_context 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.
  • hir_def::graph_index::project_batch_form_edges (cyclomatic 20) crates/hir-def/src/graph_index.rs:1341 — hir_def::graph_index::project_batch_form_edges 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.
  • hir_def::docs::parse_parameters_with_roles (cyclomatic 19) crates/hir-def/src/docs.rs:713 — hir_def::docs::parse_parameters_with_roles 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.
  • hir_def::docs::parse_returns (cyclomatic 19) crates/hir-def/src/docs.rs:853 — hir_def::docs::parse_returns 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.
  • hir_def::body::lower::collect_referenced_externals::collect_declared (cyclomatic 18) crates/hir-def/src/body/lower/mod.rs:648 — hir_def::body::lower::collect_referenced_externals::collect_declared has cyclomatic complexity 18 (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.
  • hir_def::docs::parse_method_docs (cyclomatic 18) crates/hir-def/src/docs.rs:344 — hir_def::docs::parse_method_docs has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • hir_def::docs::see_reference_ranges (cyclomatic 18) crates/hir-def/src/docs.rs:645 — hir_def::docs::see_reference_ranges has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • hir_def::ty::doc_types::parse_method_doc_types (cyclomatic 18) crates/hir-def/src/ty/doc_types.rs:21 — hir_def::ty::doc_types::parse_method_doc_types has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • hir_def::body::lower::expr::lower_literal (cyclomatic 17) crates/hir-def/src/body/lower/expr.rs:129 — hir_def::body::lower::expr::lower_literal has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • hir_def::graph_index::resolve_summary_via_index (cyclomatic 17) crates/hir-def/src/graph_index.rs:387 — hir_def::graph_index::resolve_summary_via_index has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • hir_def::body::lower::expr::compare_template_and_params (cyclomatic 16) crates/hir-def/src/body/lower/expr.rs:1777 — hir_def::body::lower::expr::compare_template_and_params has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: hir_def::body::lower::expr::lower_expr (cyclomatic 17) 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.
  • hir_def::body::lower::query_fragment::is_substitution_source (cyclomatic 16) crates/hir-def/src/body/lower/query_fragment.rs:119 — hir_def::body::lower::query_fragment::is_substitution_source 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.
  • hir_def::body::lower::query_fragment::completion_after (cyclomatic 16) crates/hir-def/src/body/lower/query_fragment.rs:164 — hir_def::body::lower::query_fragment::completion_after 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.
  • hir_def::body::lower::stmt::lower_assign_stmt (cyclomatic 16) crates/hir-def/src/body/lower/stmt.rs:491 — hir_def::body::lower::stmt::lower_assign_stmt has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: hir_def::body::lower::stmt::lower_stmt (cyclomatic 24) 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.
  • hir_def::metrics::count_logical_ops::walk (cyclomatic 16) crates/hir-def/src/metrics.rs:341 — hir_def::metrics::count_logical_ops::walk has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×22
  • Duplicated block (12 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:3426 — crates/bsl-check-executor/src/native_check/profile.rs:3426-3437 | crates/bsl-check-executor/src/native_check/profile.rs:3449-3460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:3426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/bsl-metadata/src/form.rs:447 — crates/bsl-metadata/src/form.rs:447-458 | crates/bsl-metadata/src/tabular_section.rs:94-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/form.rs:447` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `overlay` to `&Form` in one and `&TabularSection` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-metadata/src/tabular_section.rs:90` calls `take` and `crates/bsl-metadata/src/form.rs:445` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) crates/bsl-search/src/engine.rs:2419 — crates/bsl-search/src/engine.rs:2419-2430 | crates/bsl-search/src/workspace_overlay.rs:2636-2647 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:2419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) crates/bsl-search/src/engine.rs:3167 — crates/bsl-search/src/engine.rs:3167-3178 | crates/bsl-search/src/engine.rs:3223-3236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:3167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/bsl-search/src/engine.rs:4645 — crates/bsl-search/src/engine.rs:4645-4656 | crates/bsl-search/src/engine.rs:4702-4713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:4645` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/bsl-search/src/engine.rs:6189 — crates/bsl-search/src/engine.rs:6189-6202 | crates/bsl-search/src/engine.rs:6287-6298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) REDACTED:4143 — REDACTED:4143-4154 | REDACTED:4244-4255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:803 — REDACTED:803-814 | REDACTED:1055-1066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:803` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/dataflow/src/lib.rs:210 — crates/dataflow/src/lib.rs:210-221 | crates/dataflow/src/lib.rs:324-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/dataflow/src/lib.rs:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/hir-def/src/scope.rs:93 — crates/hir-def/src/scope.rs:93-104 | crates/hir-def/src/scope.rs:107-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) crates/ide-diagnostics/src/sdbl_utils.rs:355 — crates/ide-diagnostics/src/sdbl_utils.rs:355-366 | crates/ide-diagnostics/src/sdbl_utils.rs:368-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/ide/src/completion/bsl_completion.rs:790 — crates/ide/src/completion/bsl_completion.rs:790-802 | crates/ide/src/completion/bsl_completion.rs:830-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/completion/bsl_completion.rs:790` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/mcp-server/src/diagnostics_state/drift.rs:969 — crates/mcp-server/src/diagnostics_state/drift.rs:969-980 | crates/mcp-server/src/diagnostics_state/drift.rs:1103-1114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/diagnostics_state/drift.rs:969` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/mcp-server/src/state/bootstrap.rs:1759 — crates/mcp-server/src/state/bootstrap.rs:1759-1770 | crates/mcp-server/src/state/bootstrap.rs:1775-1786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) crates/parser/src/grammar/statements.rs:434 — crates/parser/src/grammar/statements.rs:434-445 | crates/parser/src/grammar/statements.rs:451-462 — both copies are in the same file, so extract the 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/symbol-info/src/adapters/global_function.rs:20 — crates/symbol-info/src/adapters/global_function.rs:20-31 | crates/symbol-info/src/adapters/platform_method.rs:23-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `docs` to `Option<&MethodDocs>` in one and `Option<&bsl_platform::MethodDocs>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) crates/mcp-server/src/change_hub.rs:3508 — crates/mcp-server/src/change_hub.rs:3508-3519 | crates/mcp-server/src/change_hub.rs:3734-3745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/change_hub.rs:3508` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:180 — REDACTED:180-191 | REDACTED:231-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/ide-diagnostics/src/handlers/duplicate_alias_in_query.rs:29 — crates/ide-diagnostics/src/handlers/duplicate_alias_in_query.rs:29-41 | crates/ide-diagnostics/src/handlers/unavailable_alias_in_query.rs:29-40 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/duplicate_alias_in_query.rs` and `crates/ide-diagnostics/src/handlers/unavailable_alias_in_query.rs` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/duplicate_alias_in_query.rs:29` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/bsl-debug/src/module_index.rs:277 — crates/bsl-debug/src/module_index.rs:277-288 | crates/bsl-debug/src/module_index.rs:325-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/module_index.rs:277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:2464 — REDACTED:2464-2475 | REDACTED:2560-2571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2464` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) crates/bsl-analyzer/src/bench/runner.rs:484 — crates/bsl-analyzer/src/bench/runner.rs:484-495 | crates/bsl-analyzer/src/bench/runner.rs:525-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · mcp_server · ×20
  • mcp_server::tools::search::status::search_status_with_cap (cyclomatic 79) crates/mcp-server/src/tools/search/status.rs:226 — mcp_server::tools::search::status::search_status_with_cap 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.
  • mcp_server::tools::search::semantic::semantic_code_hits (cyclomatic 39) crates/mcp-server/src/tools/search/semantic.rs:30 — mcp_server::tools::search::semantic::semantic_code_hits has cyclomatic complexity 39 (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.
  • mcp_server::graph_db::compute_body_patch_with_metadata (cyclomatic 32) REDACTED:1727 — mcp_server::graph_db::compute_body_patch_with_metadata has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mcp_server::broker::daemon::serve_shared (cyclomatic 31) crates/mcp-server/src/broker/daemon.rs:171 — mcp_server::broker::daemon::serve_shared 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.
  • mcp_server::change_hub::run_hub_thread (cyclomatic 31) crates/mcp-server/src/change_hub.rs:4678 — mcp_server::change_hub::run_hub_thread 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.
  • mcp_server::change_hub::apply_rearm (cyclomatic 31) crates/mcp-server/src/change_hub.rs:5725 — mcp_server::change_hub::apply_rearm 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.
  • mcp_server::diagnostics_state::resident::apply_resident_changes (cyclomatic 27) crates/mcp-server/src/diagnostics_state/resident.rs:1498 — mcp_server::diagnostics_state::resident::apply_resident_changes 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.
  • mcp_server::tools::search::status::write_summary_block (cyclomatic 26) crates/mcp-server/src/tools/search/status.rs:843 — mcp_server::tools::search::status::write_summary_block 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.
  • mcp_server::graph_db::write_body_patch (cyclomatic 24) REDACTED:2198 — mcp_server::graph_db::write_body_patch 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.
  • mcp_server::tools::metadata::format_filtered_tree (cyclomatic 23) crates/mcp-server/src/tools/metadata.rs:412 — mcp_server::tools::metadata::format_filtered_tree 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.
  • mcp_server::tools::references::render (cyclomatic 22) crates/mcp-server/src/tools/references.rs:452 — mcp_server::tools::references::render 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.
  • mcp_server::tools::redact::redact_targeted_tracking (cyclomatic 21) crates/mcp-server/src/tools/redact.rs:54 — mcp_server::tools::redact::redact_targeted_tracking 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.
  • mcp_server::graph_db::plan_caller_delta (cyclomatic 20) REDACTED:2746 — mcp_server::graph_db::plan_caller_delta 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.
  • mcp_server::tools::diagnostics::file_findings (cyclomatic 20) crates/mcp-server/src/tools/diagnostics.rs:409 — mcp_server::tools::diagnostics::file_findings 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.
  • mcp_server::tools::search::docs::search_docs (cyclomatic 19) crates/mcp-server/src/tools/search/docs.rs:163 — mcp_server::tools::search::docs::search_docs has cyclomatic complexity 19 (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.
  • mcp_server::tools::search::lexical::lexical_code_hits (cyclomatic 19) crates/mcp-server/src/tools/search/lexical.rs:25 — mcp_server::tools::search::lexical::lexical_code_hits has cyclomatic complexity 19 (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.
  • mcp_server::drift_classify::classify_drift (cyclomatic 18) crates/mcp-server/src/drift_classify.rs:72 — mcp_server::drift_classify::classify_drift has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mcp_server::graph_db::local_metadata_delta (cyclomatic 18) REDACTED:1579 — mcp_server::graph_db::local_metadata_delta has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mcp_server::broker::daemon::serve (cyclomatic 17) crates/mcp-server/src/broker/daemon.rs:342 — mcp_server::broker::daemon::serve 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.
  • mcp_server::tools::check_executor::execute (cyclomatic 16) crates/mcp-server/src/tools/check_executor.rs:140 — mcp_server::tools::check_executor::execute has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · LoweringContext · ×20
  • LoweringContext::extract_limitations (cognitive 82) crates/sdbl-hir/src/lower/select_fields.rs:23 — LoweringContext::extract_limitations has cognitive complexity 82 (threshold 15). Drivers by points: if/else 11 (63 pts), loops 5 (17 pts), boolean chains 2 (nesting depth added 64). 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.
  • LoweringContext::build_accounting_register_table (cognitive 67) crates/sdbl-hir/src/lower/register_tables.rs:187 — LoweringContext::build_accounting_register_table has cognitive complexity 67 (threshold 15). Drivers by points: loops 16 (43 pts), if/else 6 (13 pts), match/switch 4 (8 pts), boolean chains 3 (nesting depth added 38). 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.
  • LoweringContext::lower_table_ref (cognitive 46) crates/sdbl-hir/src/lower/from_clause.rs:181 — LoweringContext::lower_table_ref has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 4, match/switch 2 (3 pts), loops 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.
  • LoweringContext::lower_column_ref (cognitive 43) crates/sdbl-hir/src/lower/expr/mod.rs:69 — LoweringContext::lower_column_ref has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 4, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::lower_totals_by_clause (cognitive 38) crates/sdbl-hir/src/lower/clauses.rs:263 — LoweringContext::lower_totals_by_clause has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::lower_order_by (cognitive 29) crates/sdbl-hir/src/lower/clauses.rs:112 — LoweringContext::lower_order_by has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::add_metadata_fields (cognitive 29) crates/sdbl-hir/src/lower/from_clause.rs:1045 — LoweringContext::add_metadata_fields has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (12 pts), boolean chains 2, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::lower_function_call (cognitive 28) crates/sdbl-hir/src/lower/expr/mod.rs:282 — LoweringContext::lower_function_call has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::check_expr_for_unlimited_string (cognitive 25) crates/sdbl-hir/src/lower/diagnostics.rs:762 — LoweringContext::check_expr_for_unlimited_string has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 5 (10 pts), match/switch 2 (3 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • LoweringContext::resolve_table (cognitive 24) crates/sdbl-hir/src/lower/from_clause.rs:415 — LoweringContext::resolve_table has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • LoweringContext::lower_value_function_args (cognitive 23) crates/sdbl-hir/src/lower/expr/mod.rs:556 — LoweringContext::lower_value_function_args has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::lower_literal (cognitive 20) crates/sdbl-hir/src/lower/expr/mod.rs:211 — LoweringContext::lower_literal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • LoweringContext::lower_in_expr (cognitive 19) crates/sdbl-hir/src/lower/expr/predicates.rs:97 — LoweringContext::lower_in_expr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::lower_selected_field (cognitive 19) crates/sdbl-hir/src/lower/select_fields.rs:85 — LoweringContext::lower_selected_field has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::check_expr_for_ref_overuse (cognitive 18) crates/sdbl-hir/src/lower/diagnostics.rs:591 — LoweringContext::check_expr_for_ref_overuse has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • LoweringContext::lower_binary_expr (cognitive 18) crates/sdbl-hir/src/lower/expr/ops.rs:6 — LoweringContext::lower_binary_expr has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (7 pts), loops 2 (nesting depth added 8). 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.
  • LoweringContext::check_column_ref_for_ref_overuse (cognitive 17) crates/sdbl-hir/src/lower/diagnostics.rs:671 — LoweringContext::check_column_ref_for_ref_overuse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::check_register_recorder_fields (cognitive 16) crates/sdbl-hir/src/lower/diagnostics.rs:161 — LoweringContext::check_register_recorder_fields has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 5 (6 pts) (nesting depth added 4). 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.
  • LoweringContext::check_order_by_document_date (cognitive 16) crates/sdbl-hir/src/lower/diagnostics.rs:450 — LoweringContext::check_order_by_document_date has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LoweringContext::resolve_external_data_source (cognitive 16) crates/sdbl-hir/src/lower/from_clause.rs:1265 — LoweringContext::resolve_external_data_source has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×20
  • Edited copy of a member (10 corresponding lines) crates/bsl-platform/src/types.rs:61 — crates/bsl-platform/src/types.rs:61-71 | crates/bsl-platform/src/types.rs:107-116 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/ide/src/graph.rs:3228 — crates/ide/src/graph.rs:3228-3237 | crates/mcp-server/src/graph_query.rs:54-63 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:186 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:186-202 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:204-213 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/hir-def/src/method_slab.rs:481 — crates/hir-def/src/method_slab.rs:481-490 | crates/hir-def/src/method_syntax.rs:68-79 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/hir-def/src/queries.rs:235 — crates/hir-def/src/queries.rs:235-244 | crates/hir-def/src/workspace_index.rs:181-196 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) REDACTED:3925 — REDACTED:3925-3934 | REDACTED:3939-3952 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/hir-ty/src/form_attr.rs:109 — crates/hir-ty/src/form_attr.rs:109-118 | crates/hir-ty/src/form_attr.rs:124-136 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/hir-ty/src/min_platform.rs:69 — crates/hir-ty/src/min_platform.rs:69-78 | crates/hir-ty/src/min_platform.rs:81-90 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/hir-ty/src/query_text_dataflow.rs:201 — crates/hir-ty/src/query_text_dataflow.rs:201-210 | crates/hir-ty/src/structure_keys.rs:404-415 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/bsl-analyzer/src/reporters/codequality.rs:25 — crates/bsl-analyzer/src/reporters/codequality.rs:25-34 | crates/bsl-analyzer/src/reporters/sarif.rs:19-28 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/sdbl-hir/src/lower/diagnostics.rs:394 — crates/sdbl-hir/src/lower/diagnostics.rs:394-403 | crates/sdbl-hir/src/lower/diagnostics.rs:405-414 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/parser/src/lib.rs:45 — crates/parser/src/lib.rs:45-54 | crates/parser/src/lib.rs:56-67 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/line-index/src/lib.rs:154 — crates/line-index/src/lib.rs:154-163 | crates/line-index/src/lib.rs:165-174 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/bsl-metadata/src/vendor_support.rs:284 — crates/bsl-metadata/src/vendor_support.rs:284-293 | crates/bsl-metadata/src/vendor_support.rs:295-304 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/bsl-search/src/engine.rs:5192 — crates/bsl-search/src/engine.rs:5192-5204 | crates/bsl-search/src/engine.rs:5207-5216 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/ide-diagnostics/src/handlers/deprecated_platform_facts.rs:56 — crates/ide-diagnostics/src/handlers/deprecated_platform_facts.rs:56-65 | crates/ide-diagnostics/src/handlers/deprecated_platform_facts.rs:70-80 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/ide-diagnostics/src/handlers/disable_safe_mode.rs:24 — crates/ide-diagnostics/src/handlers/disable_safe_mode.rs:24-33 | crates/ide-diagnostics/src/handlers/set_privileged_mode.rs:22-31 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/ide-diagnostics/src/handlers/missing_temporary_file_deletion.rs:64 — crates/ide-diagnostics/src/handlers/missing_temporary_file_deletion.rs:64-75 | crates/ide-diagnostics/src/handlers/missing_temp_storage_deletion.rs:24-33 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/stdx/src/case.rs:145 — crates/stdx/src/case.rs:145-154 | crates/ide-diagnostics/src/handlers/invalid_character_in_file.rs:158-167 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/ide-diagnostics/src/handlers/redundant_access_to_object.rs:112 — crates/ide-diagnostics/src/handlers/redundant_access_to_object.rs:112-121 | crates/ide-diagnostics/src/lib.rs:93-105 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×20
  • Duplicated block (14 lines × 2) crates/bsl-analyzer/src/handlers/request.rs:2275 — crates/bsl-analyzer/src/handlers/request.rs:2275-2288 | crates/bsl-analyzer/src/handlers/request.rs:2365-2378 — both copies are in the same file, so extract the 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/bsl-platform/tools/html-parser/src/lib.rs:660 — crates/bsl-platform/tools/html-parser/src/lib.rs:660-673 | crates/bsl-platform/tools/html-parser/src/lib.rs:1013-1026 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/lib.rs:660` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:655 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:655-668 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:705-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:655` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/bsl-search/src/engine.rs:577 — crates/bsl-search/src/engine.rs:577-590 | crates/bsl-search/src/engine.rs:1147-1160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:577` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/bsl-search/src/engine.rs:1085 — crates/bsl-search/src/engine.rs:1085-1098 | crates/bsl-search/src/engine.rs:1161-1174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:1085` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/bsl-search/src/engine.rs:1936 — crates/bsl-search/src/engine.rs:1936-1949 | crates/bsl-search/src/engine.rs:2268-2281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:1936` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) REDACTED:2840 — REDACTED:2840-2853 | REDACTED:2941-2954 — both copies are in the same file, so extract the 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/hir-def/src/body/lower/expr.rs:640 — crates/hir-def/src/body/lower/expr.rs:640-653 | crates/hir-def/src/body/lower/expr.rs:997-1010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/expr.rs:640` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/hir-def/src/body/lower/expr.rs:1778 — crates/hir-def/src/body/lower/expr.rs:1778-1791 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:262-275 — before extracting anything, compare `crates/hir-def/src/body/lower/expr.rs` and `crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/expr.rs:1778` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) crates/hir-def/src/graph_index.rs:2633 — crates/hir-def/src/graph_index.rs:2633-2646 | crates/hir-def/src/graph_index.rs:2708-2721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:2633` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/hir-def/src/graph_index.rs:2668 — crates/hir-def/src/graph_index.rs:2668-2681 | crates/hir-def/src/graph_index.rs:2688-2701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:2668` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/ide-diagnostics/src/handlers/deprecated_method_call.rs:70 — crates/ide-diagnostics/src/handlers/deprecated_method_call.rs:70-83 | crates/ide-diagnostics/src/handlers/deprecated_method_call.rs:105-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/deprecated_method_call.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `&AnalysisContext) -> (bool` in one and `&AnalysisContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (14 lines × 2) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:700 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:700-713 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:808-821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:700` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:147 — crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:147-160 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:173-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:60 — crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:60-73 | crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs:66-79 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs` and `crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/ide-diagnostics/src/handlers/posting_while_data_exchange_loading.rs:55 — crates/ide-diagnostics/src/handlers/posting_while_data_exchange_loading.rs:55-68 | crates/ide-diagnostics/src/handlers/structure_key_is_not_identifier.rs:82-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/posting_while_data_exchange_loading.rs:55` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/mcp-server/src/baseline.rs:2076 — crates/mcp-server/src/baseline.rs:2076-2089 | crates/mcp-server/src/tools/search/render.rs:775-788 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) crates/mcp-server/src/state/bootstrap.rs:1593 — crates/mcp-server/src/state/bootstrap.rs:1593-1606 | crates/mcp-server/src/state/bootstrap.rs:1625-1638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/bootstrap.rs:1593` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/ide/src/partitioned_diagnostics_baseline.rs:701 — crates/ide/src/partitioned_diagnostics_baseline.rs:701-714 | crates/ide/src/partitioned_diagnostics_baseline.rs:1099-1112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/partitioned_diagnostics_baseline.rs:701` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) crates/mcp-server/src/baseline.rs:1477 — crates/mcp-server/src/baseline.rs:1477-1490 | crates/mcp-server/src/baseline.rs:1505-1518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X25 · Inert configuration knob · Configuration option is read nowhere · ×20
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:106 — `Commands::Analyze.workspace_dir` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:109 — `Commands::Analyze.output_dir` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:118 — `Commands::Analyze.quiet` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:136 — `Commands::Analyze.only_diagnostic` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:175 — `Commands::Format.spaces` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:222 — `Commands::Deps.sample` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:228 — `Commands::Deps.quiet` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:234 — `Commands::Deps.report_mem` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:237 — `Commands::Deps.bench` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:240 — `Commands::Deps.multi_open` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:243 — `Commands::Deps.bench_index` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/bin/main.rs:246 — `Commands::Deps.index_workers` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/bsl-analyzer/src/smoke.rs:184 — `SessionResult.interned_trend` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/mcp-server/src/graph/state.rs:382 — `GraphState.probe_window_hook` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/mcp-server/src/graph/state.rs:390 — `GraphState.scan_receipt_hook` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/mcp-server/src/lib.rs:679 — `EventLogParams.date_from` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/mcp-server/src/lib.rs:681 — `EventLogParams.date_to` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/project-model/src/lib.rs:4292 — `CredentialHelperResponse.lease_id` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/project-model/src/lib.rs:4294 — `CredentialHelperResponse.expires_at` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is read nowhere crates/project-model/src/lib.rs:4296 — `CredentialHelperResponse.renewable` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
D3 · God Classes · ClassTooLong · ×19
  • ClassTooLong: SearchEngine crates/bsl-search/src/engine.rs:457 — ClassTooLong — 4049 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 189 methods, 3 blocks, lines 457-6660. The bar is 400 significant lines; this is 3649 over it, 10.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: InferenceContext crates/hir-ty/src/infer.rs:670 — ClassTooLong — 3272 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 133 methods, 2 blocks, lines 670-6513. The bar is 400 significant lines; this is 2872 over it, 8.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RootDatabaseImpl crates/ide-db/src/database.rs:95 — ClassTooLong — 2316 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 129 methods, 11 blocks, lines 95-4041. The bar is 400 significant lines; this is 1916 over it, 5.79× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PostgresBaselineAdapter REDACTED:115 — ClassTooLong — 2068 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 50 methods, 9 blocks, lines 115-2969. The bar is 400 significant lines; this is 1668 over it, 5.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: McpServer crates/mcp-server/src/lib.rs:1254 — ClassTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 5 blocks, lines 1254-3467. The bar is 400 significant lines; this is 967 over it, 3.42× 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: WorkspaceOverlayCache crates/bsl-search/src/workspace_overlay.rs:168 — ClassTooLong — 1335 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 63 methods, 3 blocks, lines 168-2473. The bar is 400 significant lines; this is 935 over it, 3.34× 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: GraphDb crates/mcp-server/src/graph_query.rs:390 — ClassTooLong — 851 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 2 blocks, lines 390-1733. The bar is 400 significant lines; this is 451 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Project crates/project-model/src/lib.rs:341 — ClassTooLong — 766 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 341-1610. The bar is 400 significant lines; this is 366 over it, 1.92× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DebugSession crates/bsl-debug/src/session.rs:19 — ClassTooLong — 762 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 2 blocks, lines 19-1322. The bar is 400 significant lines; this is 362 over it, 1.91× 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: GraphCtx crates/ide/src/graph.rs:1707 — ClassTooLong — 750 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 1707-2705. The bar is 400 significant lines; this is 350 over it, 1.88× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NotifyActor crates/vfs-notify/src/lib.rs:119 — ClassTooLong — 596 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 119-1180. The bar is 400 significant lines; this is 196 over it, 1.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Configuration crates/bsl-metadata/src/configuration.rs:20 — ClassTooLong — 554 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 52 methods, 3 blocks, lines 20-840. The bar is 400 significant lines; this is 154 over it, 1.39× 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: GlobalState crates/bsl-analyzer/src/global_state.rs:396 — ClassTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 88 methods, 2 blocks, lines 396-1401. The bar is 400 significant lines; this is 153 over it, 1.38× 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: Resolver crates/hir-def/src/resolver.rs:10 — ClassTooLong — 511 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 2 blocks, lines 10-920. The bar is 400 significant lines; this is 111 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SharedState crates/mcp-server/src/state/mod.rs:408 — ClassTooLong — 468 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 109 methods, 2 blocks, lines 408-1432. The bar is 400 significant lines; this is 68 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DiagnosticsBaselineSnapshot crates/ide-host-core/src/diagnostics_baseline.rs:17 — ClassTooLong — 440 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 17-627. The bar is 400 significant lines; this is 40 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BodyDiagnostic crates/hir-def/src/body.rs:531 — ClassTooLong — 436 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 4 blocks, lines 531-1369. The bar is 400 significant lines; this is 36 over it, 1.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Scope crates/sdbl-hir/src/scope.rs:32 — ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 3 blocks, lines 32-784. The bar is 400 significant lines; this is 25 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FileSymbolCtx crates/hir/src/semantic_symbol.rs:129 — ClassTooLong — 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 2 blocks, lines 129-809. The bar is 400 significant lines; this is 6 over it, 1.02× 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.
D1 · Cyclomatic Complexity · bsl_analyzer · ×18
  • bsl_analyzer::bin::cli::analyze::analyze_salsa (cyclomatic 83) crates/bsl-analyzer/src/bin/cli/analyze.rs:356 — bsl_analyzer::bin::cli::analyze::analyze_salsa has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_analyzer::server::handle_task (cyclomatic 67) crates/bsl-analyzer/src/server.rs:1243 — bsl_analyzer::server::handle_task has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_analyzer::bin::cli::deps::run_deps (cyclomatic 59) crates/bsl-analyzer/src/bin/cli/deps.rs:68 — bsl_analyzer::bin::cli::deps::run_deps has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_analyzer::bin::cli::lsp::relay_lsp (cyclomatic 40) crates/bsl-analyzer/src/bin/cli/lsp.rs:382 — bsl_analyzer::bin::cli::lsp::relay_lsp has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_analyzer::server::handle_loader_msg (cyclomatic 35) crates/bsl-analyzer/src/server.rs:875 — bsl_analyzer::server::handle_loader_msg has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_analyzer::diagnostics_baseline::transaction::publish_set_with_hook (cyclomatic 30) crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:150 — bsl_analyzer::diagnostics_baseline::transaction::publish_set_with_hook has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_analyzer::bin::cli::diagnostics_baseline::apply_partitioned (cyclomatic 24) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:397 — bsl_analyzer::bin::cli::diagnostics_baseline::apply_partitioned 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.
  • bsl_analyzer::handlers::notification::handle_did_close (cyclomatic 23) crates/bsl-analyzer/src/handlers/notification.rs:510 — bsl_analyzer::handlers::notification::handle_did_close 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.
  • bsl_analyzer::bin::cli::search_baseline::publish::run (cyclomatic 20) crates/bsl-analyzer/src/bin/cli/search_baseline/publish.rs:58 — bsl_analyzer::bin::cli::search_baseline::publish::run has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • bsl_analyzer::bin::cli::rules::markdown_to_html (cyclomatic 19) crates/bsl-analyzer/src/bin/cli/rules.rs:177 — bsl_analyzer::bin::cli::rules::markdown_to_html 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.
  • bsl_analyzer::bin::cli::rules::export_rules (cyclomatic 18) crates/bsl-analyzer/src/bin/cli/rules.rs:73 — bsl_analyzer::bin::cli::rules::export_rules has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • bsl_analyzer::server::handle_vfs_msg (cyclomatic 18) crates/bsl-analyzer/src/server.rs:2257 — bsl_analyzer::server::handle_vfs_msg has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_analyzer::bin::cli::mcp::validate_serve_args (cyclomatic 17) crates/bsl-analyzer/src/bin/cli/mcp.rs:655 — bsl_analyzer::bin::cli::mcp::validate_serve_args 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.
  • bsl_analyzer::handlers::request::handle_code_action (cyclomatic 17) crates/bsl-analyzer/src/handlers/request.rs:1360 — bsl_analyzer::handlers::request::handle_code_action 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.
  • bsl_analyzer::bin::cli::diagnostics_baseline::validate_set_for_repair (cyclomatic 16) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:891 — bsl_analyzer::bin::cli::diagnostics_baseline::validate_set_for_repair 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.
  • bsl_analyzer::bin::cli::logging::journal::append_locked (cyclomatic 16) crates/bsl-analyzer/src/bin/cli/logging/journal.rs:442 — bsl_analyzer::bin::cli::logging::journal::append_locked 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.
  • bsl_analyzer::handlers::notification::handle_did_save (cyclomatic 16) crates/bsl-analyzer/src/handlers/notification.rs:681 — bsl_analyzer::handlers::notification::handle_did_save 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.
  • bsl_analyzer::server::handle_latency_request_finished (cyclomatic 16) crates/bsl-analyzer/src/server.rs:1581 — bsl_analyzer::server::handle_latency_request_finished 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.
D2 · Cognitive Complexity · hir_ty · ×18
  • hir_ty::structure_keys::collect_structure_shapes (cognitive 93) crates/hir-ty/src/structure_keys.rs:122 — hir_ty::structure_keys::collect_structure_shapes has cognitive complexity 93 (threshold 15). Drivers by points: if/else 20 (83 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 67). 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.
  • hir_ty::subtype::is_assignable (cognitive 52) crates/hir-ty/src/subtype.rs:16 — hir_ty::subtype::is_assignable has cognitive complexity 52 (threshold 15). Drivers by points: if/else 31 (43 pts), boolean chains 9 (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.
  • hir_ty::definite_init::collect (cognitive 51) crates/hir-ty/src/definite_init.rs:129 — hir_ty::definite_init::collect has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 4 (7 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::subtype::is_coercible_to (cognitive 28) crates/hir-ty/src/subtype.rs:392 — hir_ty::subtype::is_coercible_to has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::structure_keys::invalidate_expression_escapes (cognitive 26) crates/hir-ty/src/structure_keys.rs:613 — hir_ty::structure_keys::invalidate_expression_escapes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::query_in_loop::query_in_loop_candidates (cognitive 22) crates/hir-ty/src/query_in_loop.rs:75 — hir_ty::query_in_loop::query_in_loop_candidates has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::field_lookup::lookup_field_raw (cognitive 21) crates/hir-ty/src/field_lookup.rs:155 — hir_ty::field_lookup::lookup_field_raw has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1, match/switch 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.
  • hir_ty::platform_global_lookup::bare_global_name_claim (cognitive 21) crates/hir-ty/src/platform_global_lookup.rs:150 — hir_ty::platform_global_lookup::bare_global_name_claim has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::query_text_dataflow::executed_query_texts (cognitive 21) crates/hir-ty/src/query_text_dataflow.rs:143 — hir_ty::query_text_dataflow::executed_query_texts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::query_text_dataflow::value_table_parameters (cognitive 21) crates/hir-ty/src/query_text_dataflow.rs:276 — hir_ty::query_text_dataflow::value_table_parameters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::field_enum::enumerate_projected_fields (cognitive 20) crates/hir-ty/src/field_enum.rs:82 — hir_ty::field_enum::enumerate_projected_fields has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (5 pts), match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::definite_init::path_kind (cognitive 19) crates/hir-ty/src/definite_init.rs:390 — hir_ty::definite_init::path_kind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (5 pts), boolean chains 3, 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.
  • hir_ty::infer::infer_weaving (cognitive 18) crates/hir-ty/src/infer.rs:6926 — hir_ty::infer::infer_weaving has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::form_items::body_may_change_items (cognitive 17) crates/hir-ty/src/form_items.rs:168 — hir_ty::form_items::body_may_change_items has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (8 pts), boolean chains 7, if/else 1, loops 1 (nesting depth added 3). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • hir_ty::method_resolution::materialise_signature_enriched (cognitive 17) crates/hir-ty/src/method_resolution.rs:458 — hir_ty::method_resolution::materialise_signature_enriched has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
  • hir_ty::narrow::refine_by_ternary_guard (cognitive 17) crates/hir-ty/src/narrow.rs:586 — hir_ty::narrow::refine_by_ternary_guard has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • hir_ty::module_implicit::module_implicit_fields (cognitive 16) crates/hir-ty/src/module_implicit.rs:12 — hir_ty::module_implicit::module_implicit_fields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • hir_ty::sdbl_bridge::query_to_projection (cognitive 16) crates/hir-ty/src/sdbl_bridge.rs:72 — hir_ty::sdbl_bridge::query_to_projection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bsl_check_executor · ×18
  • bsl_check_executor::native_check::profile::run_native_check (cognitive 81) crates/bsl-check-executor/src/native_check/profile.rs:590 — bsl_check_executor::native_check::profile::run_native_check has cognitive complexity 81 (threshold 15). Drivers by points: if/else 33 (52 pts), loops 10 (19 pts), boolean chains 5, match/switch 5 (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.
  • bsl_check_executor::native_check::source::parse_metadata_form_type (cognitive 28) crates/bsl-check-executor/src/native_check/source.rs:539 — bsl_check_executor::native_check::source::parse_metadata_form_type has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 6, match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::compiler::run_bounded_with_log (cognitive 26) crates/bsl-check-executor/src/native_check/compiler.rs:439 — bsl_check_executor::native_check::compiler::run_bounded_with_log has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 8 (10 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::source::flat_module_export_name (cognitive 26) crates/bsl-check-executor/src/native_check/source.rs:270 — bsl_check_executor::native_check::source::flat_module_export_name has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 5 (6 pts), boolean chains 4 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • bsl_check_executor::native_check::profile::cleanup_owned_jobs (cognitive 24) crates/bsl-check-executor/src/native_check/profile.rs:3060 — bsl_check_executor::native_check::profile::cleanup_owned_jobs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::profile::recover_process_group (cognitive 24) crates/bsl-check-executor/src/native_check/profile.rs:3307 — bsl_check_executor::native_check::profile::recover_process_group has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::compiler::safe_message (cognitive 22) crates/bsl-check-executor/src/native_check/compiler.rs:184 — bsl_check_executor::native_check::compiler::safe_message has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::runtime::parse_connection_identity (cognitive 22) crates/bsl-check-executor/src/native_check/runtime.rs:246 — bsl_check_executor::native_check::runtime::parse_connection_identity has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::profile::signal_verified_leaderless_members (cognitive 19) crates/bsl-check-executor/src/native_check/profile.rs:3475 — bsl_check_executor::native_check::profile::signal_verified_leaderless_members has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::source::parse_configuration_boolean (cognitive 18) crates/bsl-check-executor/src/native_check/source.rs:110 — bsl_check_executor::native_check::source::parse_configuration_boolean has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::source::resolve_form_kind (cognitive 18) crates/bsl-check-executor/src/native_check/source.rs:451 — bsl_check_executor::native_check::source::resolve_form_kind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::profile::add_synthetic_owner (cognitive 17) crates/bsl-check-executor/src/native_check/profile.rs:2165 — bsl_check_executor::native_check::profile::add_synthetic_owner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 5, loops 2 (3 pts), match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • bsl_check_executor::native_check::profile::leaderless_group_members (cognitive 17) crates/bsl-check-executor/src/native_check/profile.rs:3530 — bsl_check_executor::native_check::profile::leaderless_group_members has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::source::parse_compatibility_mode (cognitive 17) crates/bsl-check-executor/src/native_check/source.rs:66 — bsl_check_executor::native_check::source::parse_compatibility_mode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::profile::parse_ibcmd_extension_list (cognitive 16) crates/bsl-check-executor/src/native_check/profile.rs:1563 — bsl_check_executor::native_check::profile::parse_ibcmd_extension_list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::profile::cleanup_owned_processes (cognitive 16) crates/bsl-check-executor/src/native_check/profile.rs:3210 — bsl_check_executor::native_check::profile::cleanup_owned_processes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::source::parse_script_variant (cognitive 16) crates/bsl-check-executor/src/native_check/source.rs:19 — bsl_check_executor::native_check::source::parse_script_variant has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_check_executor::native_check::windows_acl::verify_private_directory (cognitive 16) crates/bsl-check-executor/src/native_check/windows_acl.rs:73 — bsl_check_executor::native_check::windows_acl::verify_private_directory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×18
  • Edited copy of a member (16 corresponding lines) crates/mcp-server/src/change_hub.rs:3498 — crates/mcp-server/src/change_hub.rs:3498-3519 | crates/mcp-server/src/change_hub.rs:3730-3745 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/bsl-check-executor/src/native_check/profile.rs:3006 — crates/bsl-check-executor/src/native_check/profile.rs:3006-3024 | crates/bsl-check-executor/src/native_check/profile.rs:3030-3045 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/bsl-check-executor/src/native_check/windows_acl.rs:56 — crates/bsl-check-executor/src/native_check/windows_acl.rs:56-71 | crates/mcp-server/src/cache_windows.rs:72-93 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/bsl-metadata/src/loader.rs:771 — crates/bsl-metadata/src/loader.rs:771-798 | crates/bsl-metadata/src/loader.rs:874-889 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/ide-db/src/database.rs:655 — crates/ide-db/src/database.rs:655-675 | crates/ide-db/src/metadata.rs:537-552 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/ide-db/src/salsa_events.rs:167 — crates/ide-db/src/salsa_events.rs:167-182 | crates/ide-db/src/salsa_events.rs:226-242 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/parser/src/lib.rs:69 — crates/parser/src/lib.rs:69-84 | crates/parser/src/lib.rs:86-102 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/bsl-metadata/src/event_subscription.rs:67 — crates/bsl-metadata/src/event_subscription.rs:67-82 | crates/bsl-metadata/src/scheduled_job.rs:74-89 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/mcp-server/src/change_hub.rs:5296 — crates/mcp-server/src/change_hub.rs:5296-5311 | crates/mcp-server/src/change_hub.rs:5476-5491 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/mcp-server/src/graph_query.rs:1781 — crates/mcp-server/src/graph_query.rs:1781-1798 | crates/mcp-server/src/graph_query.rs:1806-1821 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/bsl-analyzer/src/global_state.rs:1136 — crates/bsl-analyzer/src/global_state.rs:1136-1155 | crates/bsl-analyzer/src/global_state.rs:1160-1175 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/sdbl-hir/src/context_detector.rs:527 — crates/sdbl-hir/src/context_detector.rs:527-542 | crates/sdbl-hir/src/context_detector.rs:544-560 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/ide-diagnostics/src/handlers/disable_safe_mode.rs:42 — crates/ide-diagnostics/src/handlers/disable_safe_mode.rs:42-61 | crates/ide-diagnostics/src/handlers/set_privileged_mode.rs:40-55 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/ide-diagnostics/src/handlers/type_mismatch.rs:71 — crates/ide-diagnostics/src/handlers/type_mismatch.rs:71-86 | crates/ide-diagnostics/src/handlers/type_mismatch_by_doc_comment.rs:27-48 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/parser/src/grammar/statements.rs:433 — crates/parser/src/grammar/statements.rs:433-448 | crates/parser/src/grammar/statements.rs:450-465 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/parser/src/grammar/sdbl/expressions.rs:326 — crates/parser/src/grammar/sdbl/expressions.rs:326-341 | crates/parser/src/grammar/sdbl/expressions.rs:343-358 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/bsl-analyzer/src/reporters/sarif.rs:250 — crates/bsl-analyzer/src/reporters/sarif.rs:250-265 | crates/bsl-analyzer/src/reporters/sarif.rs:277-292 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/mcp-server/src/state/bootstrap.rs:1827 — crates/mcp-server/src/state/bootstrap.rs:1827-1845 | crates/mcp-server/src/state/bootstrap.rs:1847-1862 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×18
  • Edited copy of a member (9 corresponding lines) crates/dataflow/src/security_state.rs:45 — crates/dataflow/src/security_state.rs:45-53 | crates/dataflow/src/security_state.rs:55-67 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/bsl-platform/tools/html-parser/src/lib.rs:371 — crates/bsl-platform/tools/html-parser/src/lib.rs:371-379 | crates/platform-help/src/package.rs:140-148 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/dataflow/src/reaching_defs.rs:604 — crates/dataflow/src/reaching_defs.rs:604-612 | crates/dataflow/src/reaching_defs.rs:620-632 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/hir/src/semantic_symbol.rs:526 — crates/hir/src/semantic_symbol.rs:526-534 | crates/hir/src/semantic_symbol.rs:536-544 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/mcp-server/src/tools/debug.rs:259 — crates/mcp-server/src/tools/debug.rs:259-267 | crates/mcp-server/src/tools/debug.rs:452-466 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/ide/src/graph.rs:625 — crates/ide/src/graph.rs:625-633 | REDACTED:585-599 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/bsl-types/src/builders.rs:92 — crates/bsl-types/src/builders.rs:92-100 | crates/bsl-types/src/builders.rs:103-114 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/bsl-metadata/src/xml_parser/form.rs:153 — crates/bsl-metadata/src/xml_parser/form.rs:153-161 | crates/bsl-metadata/src/xml_parser/form.rs:163-171 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/hir-def/src/preproc_condition.rs:358 — crates/hir-def/src/preproc_condition.rs:358-366 | crates/hir-def/src/preproc_condition.rs:368-376 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/hir-def/src/name_usage_index.rs:129 — crates/hir-def/src/name_usage_index.rs:129-137 | crates/hir-def/src/name_usage_index.rs:180-189 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/mcp-server/src/tools/platform.rs:1494 — crates/mcp-server/src/tools/platform.rs:1494-1502 | crates/mcp-server/src/tools/platform.rs:1504-1513 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:833 — crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:833-844 | crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:341-349 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:3358 — REDACTED:3358-3366 | REDACTED:3579-3590 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/hir-ty/src/method_lookup.rs:246 — crates/hir-ty/src/method_lookup.rs:246-254 | crates/hir-ty/src/method_lookup.rs:259-267 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/bsl-analyzer/src/mcp_install/adapters.rs:850 — crates/bsl-analyzer/src/mcp_install/adapters.rs:850-860 | crates/bsl-analyzer/src/mcp_install/adapters.rs:867-875 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/bsl-metadata/src/dimension.rs:86 — crates/bsl-metadata/src/dimension.rs:86-94 | crates/bsl-metadata/src/register.rs:81-89 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/code-chunk/src/lib.rs:231 — crates/code-chunk/src/lib.rs:231-239 | crates/ide-diagnostics/src/sdbl_utils.rs:448-458 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) scripts/lsp-bench/bench_lsp.py:393 — scripts/lsp-bench/bench_lsp.py:393-401 | scripts/perf-nightly/scenarios.py:371-379 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×17
  • Edited copy of a member (13 corresponding lines) REDACTED:412 — REDACTED:412-424 | REDACTED:433-449 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/ide-diagnostics/src/handlers/using_hardcode_network_address.rs:78 — crates/ide-diagnostics/src/handlers/using_hardcode_network_address.rs:78-90 | crates/ide-diagnostics/src/handlers/using_hardcode_path.rs:82-94 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/dataflow/src/reaching_defs.rs:279 — crates/dataflow/src/reaching_defs.rs:279-291 | crates/dataflow/src/reaching_defs.rs:415-430 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/bsl-search/src/engine.rs:100 — crates/bsl-search/src/engine.rs:100-113 | crates/bsl-search/src/engine.rs:115-127 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/symbol-info/src/presenters/signature_help.rs:92 — crates/symbol-info/src/presenters/signature_help.rs:92-104 | crates/symbol-info/src/presenters/signature_help.rs:119-132 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/bsl-platform/src/capability/mod.rs:39 — crates/bsl-platform/src/capability/mod.rs:39-51 | crates/bsl-platform/src/deprecation/mod.rs:27-39 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/mcp-server/src/broker/name.rs:738 — crates/mcp-server/src/broker/name.rs:738-753 | crates/mcp-server/src/broker/name.rs:765-777 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/syntax/src/ast_utils.rs:475 — crates/syntax/src/ast_utils.rs:475-487 | crates/syntax/src/ast_utils.rs:489-501 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/bsl-metadata/src/scoped_fs.rs:81 — crates/bsl-metadata/src/scoped_fs.rs:81-94 | crates/bsl-metadata/src/scoped_fs.rs:96-108 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/parser/src/parser.rs:667 — crates/parser/src/parser.rs:667-681 | crates/parser/src/parser.rs:687-699 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/bsl-analyzer/src/mcp_install/adapters.rs:576 — crates/bsl-analyzer/src/mcp_install/adapters.rs:576-588 | crates/bsl-analyzer/src/mcp_install/adapters.rs:614-626 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/hir-ty/src/infer.rs:128 — crates/hir-ty/src/infer.rs:128-141 | crates/hir-ty/src/infer.rs:143-155 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/hir-def/src/resolver.rs:863 — crates/hir-def/src/resolver.rs:863-875 | crates/hir-def/src/resolver.rs:883-899 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/bsl-analyzer/src/bin/cli/logging/journal.rs:261 — crates/bsl-analyzer/src/bin/cli/logging/journal.rs:261-274 | crates/mcp-server/src/broker/name.rs:303-315 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/ide-diagnostics/src/handlers/canonical_spelling_keywords.rs:26 — crates/ide-diagnostics/src/handlers/canonical_spelling_keywords.rs:26-41 | crates/ide-diagnostics/src/utils/literal_context.rs:4-16 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/ide-diagnostics/src/handlers/register_recorder_field_in_query.rs:25 — crates/ide-diagnostics/src/handlers/register_recorder_field_in_query.rs:25-37 | crates/ide-diagnostics/src/handlers/unlimited_length_string_usage_in_query.rs:26-38 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:283 — crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:283-298 | crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:92-104 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×17
  • Duplicated block (15 lines × 2) crates/bsl-metadata/src/metadata_object.rs:629 — crates/bsl-metadata/src/metadata_object.rs:629-643 | crates/bsl-platform/src/standard_mdo_attributes.rs:67-81 — 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 (15 lines × 2) crates/bsl-metadata/src/metadata_object.rs:659 — crates/bsl-metadata/src/metadata_object.rs:659-673 | crates/bsl-platform/src/standard_mdo_attributes.rs:98-112 — 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 (15 lines × 2) REDACTED:3827 — REDACTED:3827-3841 | crates/bsl-search/src/workspace_overlay.rs:2960-2974 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3827` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/bsl-search/src/workspace_overlay.rs:1401 — crates/bsl-search/src/workspace_overlay.rs:1401-1415 | crates/bsl-search/src/workspace_overlay.rs:2373-2387 — both copies are in the same file, so extract the 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/hir-ty/src/platform_manager_lookup/record_resolution.rs:23 — crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:23-37 | crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:72-86 — both copies are in the same file, so extract the 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/ide-db/src/database.rs:1385 — crates/ide-db/src/database.rs:1385-1399 | crates/ide-db/src/database.rs:2272-2286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:1385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide-db/src/database.rs:2287` calls `Some` and `crates/ide-db/src/database.rs:1400` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) crates/ide-db/src/database.rs:1758 — crates/ide-db/src/database.rs:1758-1772 | crates/ide-db/src/database.rs:1904-1918 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:1758` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:72 — crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:72-86 | crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:137-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/ide/src/completion/sdbl/use_cases/complete_cast_fields.rs:109 — crates/ide/src/completion/sdbl/use_cases/complete_cast_fields.rs:109-123 | crates/ide/src/completion/sdbl/use_cases/complete_nested_fields.rs:70-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) crates/ide/src/lib.rs:340 — crates/ide/src/lib.rs:340-354 | crates/ide/src/lib.rs:440-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/lib.rs:340` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/mcp-server/src/tools/platform.rs:1623 — crates/mcp-server/src/tools/platform.rs:1623-1637 | crates/mcp-server/src/tools/platform.rs:1723-1737 — both copies are in the same file, so extract the 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/mcp-server/src/tools/search/render.rs:674 — crates/mcp-server/src/tools/search/render.rs:674-688 | crates/mcp-server/src/tools/search/render.rs:719-733 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/search/render.rs:674` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/mcp-server/src/workspace_lease.rs:698 — crates/mcp-server/src/workspace_lease.rs:698-712 | crates/mcp-server/src/workspace_lease.rs:842-856 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) crates/bsl-launcher/src/use_cases.rs:359 — crates/bsl-launcher/src/use_cases.rs:359-373 | crates/bsl-launcher/src/use_cases.rs:449-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-launcher/src/use_cases.rs:359` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/bsl-metadata/src/loader.rs:1559 — crates/bsl-metadata/src/loader.rs:1559-1573 | crates/bsl-metadata/src/loader.rs:1601-1615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:1559` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/ide-diagnostics/src/handlers/cognitive_complexity.rs:39 — crates/ide-diagnostics/src/handlers/cognitive_complexity.rs:39-53 | crates/ide-diagnostics/src/handlers/cyclomatic_complexity.rs:37-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/cognitive_complexity.rs:39` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) scripts/lsp-bench/bench_lsp.py:683 — scripts/lsp-bench/bench_lsp.py:683-697 | scripts/lsp-bench/bench_lsp.py:729-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/lsp-bench/bench_lsp.py:683` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
D5 · Coupling · Off the main sequence · ×16
  • Off the main sequence: html-parser — html-parser: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: lexer — lexer: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: onec-client — onec-client: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: paths — paths: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: profile — profile: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: bsl-platform — bsl-platform: abstractness 0.00, instability 0.07, distance 0.93 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
  • Off the main sequence: naparnik — naparnik: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: stdx — stdx: abstractness 0.12, instability 0.00, distance 0.88 — zone of pain — concrete and depended on by 23 project(s), so it's rigid to change.
  • Off the main sequence: syntax — syntax: abstractness 0.02, instability 0.11, distance 0.87 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
  • Off the main sequence: bsl-config — bsl-config: abstractness 0.00, instability 0.14, distance 0.86 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: cfg-types — cfg-types: abstractness 0.14, instability 0.00, distance 0.86 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: intern — intern: abstractness 0.00, instability 0.14, distance 0.86 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: vfs — vfs: abstractness 0.10, instability 0.13, distance 0.77 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
  • Off the main sequence: bsl-conventions — bsl-conventions: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
  • Off the main sequence: line-index — line-index: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: bsl-metadata — bsl-metadata: abstractness 0.05, instability 0.21, distance 0.74 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
IC1 · Incompleteness & stubs · Hollow method · ×16
  • Hollow method — returns a constant without doing the work crates/bsl-platform/src/security/mod.rs:122 — `lifetime_pair` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/hir-def/src/body.rs:495 — `body_arc_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/effects.rs:81 — `shared_effect_summary_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:162 — `shared_mdo_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:168 — `shared_register_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:191 — `shared_common_module_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:198 — `shared_http_service_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:205 — `shared_web_service_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:212 — `shared_integration_service_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:220 — `shared_event_subscription_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:228 — `shared_scheduled_job_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:234 — `shared_role_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-db/src/metadata.rs:240 — `shared_subsystem_heap` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/ide-diagnostics/src/handlers/missing_common_module_method.rs:22 — `from_hir` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/stdx/src/heap.rs:46 — `zero` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
  • Hollow method — returns a constant without doing the work crates/vfs/src/lib.rs:278 — `file_content` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×15
  • Duplicated block (13 lines × 2) crates/bsl-check-executor/src/native_check/windows_acl.rs:92 — crates/bsl-check-executor/src/native_check/windows_acl.rs:92-104 | crates/mcp-server/src/cache_windows.rs:147-159 — before extracting anything, compare `crates/bsl-check-executor/src/native_check/windows_acl.rs` and `crates/mcp-server/src/cache_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/windows_acl.rs:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/bsl-search/src/engine.rs:1868 — crates/bsl-search/src/engine.rs:1868-1880 | crates/bsl-search/src/engine.rs:1911-1923 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:1868` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:4436 — REDACTED:4436-4448 | REDACTED:5334-5346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4436` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/hir-def/src/body/lower/expr.rs:1978 — crates/hir-def/src/body/lower/expr.rs:1978-1990 | crates/ide-diagnostics/src/utils/literal_context.rs:35-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&SyntaxNode` in one and `&syntax::SyntaxNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) crates/ide-db/src/effects.rs:292 — crates/ide-db/src/effects.rs:292-304 | crates/ide-db/src/queries.rs:697-709 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/effects.rs:292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/ide-diagnostics/src/handlers/deny_incomplete_values.rs:51 — crates/ide-diagnostics/src/handlers/deny_incomplete_values.rs:51-63 | crates/ide-diagnostics/src/handlers/wrong_web_service_handler.rs:79-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/deny_incomplete_values.rs:51` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/ide-diagnostics/src/handlers/wrong_http_service_handler.rs:59 — crates/ide-diagnostics/src/handlers/wrong_http_service_handler.rs:59-71 | crates/ide-diagnostics/src/handlers/wrong_web_service_handler.rs:57-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/wrong_http_service_handler.rs:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:396 — REDACTED:396-408 | REDACTED:1519-1531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:396` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:411` calls `commit`, `context` and `REDACTED:1532` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) crates/naparnik/src/http_client.rs:117 — crates/naparnik/src/http_client.rs:117-129 | crates/naparnik/src/http_client.rs:215-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/naparnik/src/http_client.rs:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/sdbl-hir/src/lower/from_clause.rs:965 — crates/sdbl-hir/src/lower/from_clause.rs:965-977 | crates/sdbl-hir/src/lower/from_clause.rs:991-1003 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/lower/from_clause.rs:965` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/hir-def/src/body/lower/expr.rs:1725 — crates/hir-def/src/body/lower/expr.rs:1725-1737 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:205-217 — before extracting anything, compare `crates/hir-def/src/body/lower/expr.rs` and `crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) crates/ide-diagnostics/src/handlers/query_condition_without_index.rs:25 — crates/ide-diagnostics/src/handlers/query_condition_without_index.rs:25-38 | crates/ide-diagnostics/src/handlers/query_order_by_document_date.rs:25-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/query_condition_without_index.rs:25` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/mcp-server/src/tools/diagnostics.rs:632 — crates/mcp-server/src/tools/diagnostics.rs:632-645 | crates/mcp-server/src/tools/diagnostics/snippet.rs:418-430 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/diagnostics.rs:632` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/ide-diagnostics/src/handlers/order_of_params.rs:60 — crates/ide-diagnostics/src/handlers/order_of_params.rs:60-72 | crates/ide-diagnostics/src/handlers/reserved_parameter_names.rs:73-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/order_of_params.rs:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:329 — crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:329-341 | crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:433-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · parser · ×14
  • parser::grammar::sdbl::expressions::column_or_function (cognitive 66) crates/parser/src/grammar/sdbl/expressions.rs:855 — parser::grammar::sdbl::expressions::column_or_function has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (52 pts), boolean chains 9, loops 2 (5 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • parser::grammar::sdbl::select::recover_field_to_alias_or_delimiter (cognitive 62) crates/parser/src/grammar/sdbl/select.rs:26 — parser::grammar::sdbl::select::recover_field_to_alias_or_delimiter has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (52 pts), boolean chains 9, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • parser::grammar::sdbl::expressions::recover_to_delimiter (cognitive 60) crates/parser/src/grammar/sdbl/expressions.rs:94 — parser::grammar::sdbl::expressions::recover_to_delimiter has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (53 pts), boolean chains 6, loops 1 (nesting depth added 28). 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.
  • parser::grammar::sdbl::expressions::predicate_expr (cognitive 56) crates/parser/src/grammar/sdbl/expressions.rs:632 — parser::grammar::sdbl::expressions::predicate_expr has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (45 pts), boolean chains 8, loops 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • parser::parser::torn_if::walk (cognitive 56) crates/parser/src/parser/torn_if.rs:227 — parser::parser::torn_if::walk has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (38 pts), match/switch 4 (11 pts), loops 2 (4 pts), boolean chains 3 (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.
  • parser::grammar::sdbl::expressions::parse_cast_type (cognitive 31) crates/parser/src/grammar/sdbl/expressions.rs:786 — parser::grammar::sdbl::expressions::parse_cast_type has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 16). 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.
  • parser::grammar::expressions::postfix_expr_with_call_info (cognitive 20) crates/parser/src/grammar/expressions.rs:171 — parser::grammar::expressions::postfix_expr_with_call_info has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • parser::grammar::sdbl::select::virtual_table_args_body (cognitive 20) crates/parser/src/grammar/sdbl/select.rs:1369 — parser::grammar::sdbl::select::virtual_table_args_body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • parser::reparse::merge_errors (cognitive 19) crates/parser/src/reparse.rs:329 — parser::reparse::merge_errors has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • parser::grammar::sdbl::expressions::paren_or_subquery_expr (cognitive 18) crates/parser/src/grammar/sdbl/expressions.rs:535 — parser::grammar::sdbl::expressions::paren_or_subquery_expr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (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.
  • parser::grammar::sdbl::select::totals_by_clause (cognitive 18) crates/parser/src/grammar/sdbl/select.rs:1094 — parser::grammar::sdbl::select::totals_by_clause has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • parser::grammar::sdbl::query_package (cognitive 16) crates/parser/src/grammar/sdbl.rs:51 — parser::grammar::sdbl::query_package has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • parser::grammar::sdbl::select::totals_periods_modifier (cognitive 16) crates/parser/src/grammar/sdbl/select.rs:1241 — parser::grammar::sdbl::select::totals_periods_modifier has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 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.
  • parser::parser::torn_if::conditionals (cognitive 16) crates/parser/src/parser/torn_if.rs:50 — parser::parser::torn_if::conditionals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×14
  • Edited copy of a member (8 corresponding lines) crates/hir-ty/src/this_object_attr.rs:17 — crates/hir-ty/src/this_object_attr.rs:17-31 | crates/hir-ty/src/this_object_attr.rs:37-44 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/ide-diagnostics/src/handlers/unused_local_method.rs:412 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:412-419 | crates/mcp-server/src/graph_query.rs:82-89 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/bsl-search/src/lifecycle.rs:573 — crates/bsl-search/src/lifecycle.rs:573-580 | crates/bsl-search/src/lifecycle.rs:693-700 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/hir-def/src/conditional_tree.rs:430 — crates/hir-def/src/conditional_tree.rs:430-437 | crates/hir-def/src/region_tree.rs:357-364 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/ide-db/src/salsa_events.rs:82 — crates/ide-db/src/salsa_events.rs:82-91 | crates/ide-db/src/salsa_events.rs:93-100 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/mcp-server/src/broker/name.rs:423 — crates/mcp-server/src/broker/name.rs:423-431 | crates/mcp-server/src/broker/name.rs:491-498 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/mcp-server/src/diagnostics_state/resident.rs:711 — crates/mcp-server/src/diagnostics_state/resident.rs:711-718 | crates/mcp-server/src/diagnostics_state/session.rs:84-102 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/ide-host-core/src/workspace.rs:190 — crates/ide-host-core/src/workspace.rs:190-204 | crates/ide-host-core/src/workspace.rs:206-213 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/project-model/src/lib.rs:3014 — crates/project-model/src/lib.rs:3014-3021 | crates/project-model/src/lib.rs:3029-3036 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/cfg/src/builder.rs:239 — crates/cfg/src/builder.rs:239-246 | crates/cfg/src/builder.rs:248-255 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/ide-db/src/salsa_provider.rs:387 — crates/ide-db/src/salsa_provider.rs:387-394 | crates/ide-db/src/salsa_provider.rs:400-407 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/bsl-search/src/progress.rs:174 — crates/bsl-search/src/progress.rs:174-181 | crates/bsl-search/src/progress.rs:199-207 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/mcp-server/src/graph/debt.rs:1827 — crates/mcp-server/src/graph/debt.rs:1827-1834 | crates/mcp-server/src/graph/debt.rs:1836-1845 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/ide-diagnostics/src/handlers/read_only_property.rs:33 — crates/ide-diagnostics/src/handlers/read_only_property.rs:33-40 | crates/ide-diagnostics/src/handlers/unresolved_field.rs:27-34 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D2 · Cognitive Complexity · SharedState · ×13
  • SharedState::spawn_embed_pass (cognitive 126) crates/mcp-server/src/state/embed.rs:1284 — SharedState::spawn_embed_pass has cognitive complexity 126 (threshold 15). Drivers by points: if/else 37 (96 pts), match/switch 8 (22 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SharedState::spawn_search_sink (cognitive 94) crates/mcp-server/src/state/sync.rs:318 — SharedState::spawn_search_sink has cognitive complexity 94 (threshold 15). Drivers by points: if/else 27 (74 pts), match/switch 5 (15 pts), boolean chains 3, loops 2 (nesting depth added 57). 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.
  • SharedState::workspace_indexing (cognitive 85) crates/mcp-server/src/state/mod.rs:860 — SharedState::workspace_indexing has cognitive complexity 85 (threshold 15). Drivers by points: if/else 31 (43 pts), match/switch 10 (34 pts), boolean chains 8 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SharedState::init_workspace_search_engine (cognitive 83) crates/mcp-server/src/state/bootstrap.rs:2265 — SharedState::init_workspace_search_engine has cognitive complexity 83 (threshold 15). Drivers by points: if/else 35 (52 pts), match/switch 11 (30 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SharedState::run_overlay_warmup (cognitive 41) crates/mcp-server/src/state/embed.rs:702 — SharedState::run_overlay_warmup has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 10 (19 pts), boolean chains 1, loops 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.
  • SharedState::spawn_workspace_search_init (cognitive 35) crates/mcp-server/src/state/bootstrap.rs:1235 — SharedState::spawn_workspace_search_init has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 7 (10 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.
  • SharedState::refresh_search_roots_after_graph (cognitive 31) crates/mcp-server/src/state/embed.rs:360 — SharedState::refresh_search_roots_after_graph has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (18 pts), match/switch 11 (13 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • SharedState::start_scope_guard (cognitive 24) crates/mcp-server/src/state/bootstrap.rs:1150 — SharedState::start_scope_guard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SharedState::apply_prepared_search_drift (cognitive 22) crates/mcp-server/src/state/sync.rs:935 — SharedState::apply_prepared_search_drift has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • SharedState::boot_graph_generation (cognitive 19) crates/mcp-server/src/state/bootstrap.rs:1749 — SharedState::boot_graph_generation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SharedState::workspace_with_cache_and_prefixes_impl (cognitive 18) crates/mcp-server/src/state/bootstrap.rs:734 — SharedState::workspace_with_cache_and_prefixes_impl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • SharedState::prepare_search_drift (cognitive 18) crates/mcp-server/src/state/sync.rs:687 — SharedState::prepare_search_drift has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • SharedState::init_reference_search_engine_at (cognitive 17) crates/mcp-server/src/state/bootstrap.rs:2812 — SharedState::init_reference_search_engine_at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×13
  • Edited copy of a member (11 corresponding lines) crates/bsl-metadata/src/form.rs:415 — crates/bsl-metadata/src/form.rs:415-425 | crates/bsl-metadata/src/register.rs:448-465 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/hir-def/src/region_tree.rs:260 — crates/hir-def/src/region_tree.rs:260-270 | crates/hir-def/src/region_tree.rs:272-287 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/bsl-platform/src/db.rs:499 — crates/bsl-platform/src/db.rs:499-509 | crates/bsl-platform/src/db.rs:577-587 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/sdbl-hir/src/lower/diagnostics.rs:328 — crates/sdbl-hir/src/lower/diagnostics.rs:328-342 | crates/sdbl-hir/src/lower/diagnostics.rs:345-355 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/hir-def/src/resolver.rs:646 — crates/hir-def/src/resolver.rs:646-661 | crates/hir-def/src/resolver.rs:716-726 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:50 — crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:50-60 | crates/ide-diagnostics/src/handlers/deprecated_find.rs:47-57 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/bsl-platform/src/snapshot.rs:631 — crates/bsl-platform/src/snapshot.rs:631-642 | crates/bsl-platform/src/snapshot.rs:644-654 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:878 — crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:878-889 | crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:405-415 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/hir-def/src/workspace_index.rs:89 — crates/hir-def/src/workspace_index.rs:89-99 | crates/hir-def/src/workspace_index.rs:101-111 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/stdx/src/case.rs:100 — crates/stdx/src/case.rs:100-110 | crates/syntax/src/ast_utils.rs:462-473 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/bsl-search/src/engine.rs:6008 — crates/bsl-search/src/engine.rs:6008-6020 | crates/bsl-search/src/engine.rs:6026-6036 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/hir-ty/src/field_enum.rs:185 — crates/hir-ty/src/field_enum.rs:185-198 | crates/hir-ty/src/field_lookup.rs:478-488 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) scripts/graph_ready_probe.py:28 — scripts/graph_ready_probe.py:28-42 | scripts/perf-nightly/scenarios.py:748-758 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×13
  • Edited copy of a member (5 corresponding lines) crates/bsl-check-executor/src/native_check/compiler.rs:1076 — crates/bsl-check-executor/src/native_check/compiler.rs:1076-1080 | crates/bsl-check-executor/src/native_check/profile.rs:3621-3629 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/bsl-platform/src/types.rs:77 — crates/bsl-platform/src/types.rs:77-81 | crates/bsl-platform/src/types.rs:122-126 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/bsl-debug/src/types/xml.rs:130 — crates/bsl-debug/src/types/xml.rs:130-134 | crates/bsl-debug/src/types/xml.rs:136-142 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/bsl-launcher/src/cache.rs:57 — crates/bsl-launcher/src/cache.rs:57-61 | crates/bsl-search/src/vector_persist.rs:357-363 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/hir-def/src/ty/doc_types.rs:303 — crates/hir-def/src/ty/doc_types.rs:303-308 | crates/hir-def/src/docs/type_expr.rs:244-248 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/mcp-server/src/tools/references.rs:1297 — crates/mcp-server/src/tools/references.rs:1297-1301 | crates/mcp-server/src/tools/search/types.rs:231-235 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/hir-def/src/body/lower/diagnostics.rs:124 — crates/hir-def/src/body/lower/diagnostics.rs:124-128 | crates/hir-def/src/body/lower/expr.rs:1213-1217 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/ide-diagnostics/src/handlers/calculation_register_virtual_table_without_recorder.rs:72 — crates/ide-diagnostics/src/handlers/calculation_register_virtual_table_without_recorder.rs:72-77 | crates/syntax/src/ast_utils.rs:447-451 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:986 — crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:986-991 | crates/ide/src/partitioned_diagnostics_baseline.rs:975-979 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:368 — crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:368-372 | crates/ide/src/partitioned_diagnostics_baseline.rs:1005-1010 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/hir-def/src/graph_index.rs:74 — crates/hir-def/src/graph_index.rs:74-79 | crates/vcs/src/author_filter.rs:386-390 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) scripts/lsp-bench/bench_lsp.py:47 — scripts/lsp-bench/bench_lsp.py:47-51 | scripts/perf-nightly/common.py:32-36 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) scripts/perf-nightly/gate.py:146 — scripts/perf-nightly/gate.py:146-150 | scripts/perf-nightly/perf_nightly.py:154-171 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×13
  • Edited copy of a member (6 corresponding lines) crates/project-model/src/diagnostics_baseline_fs.rs:99 — crates/project-model/src/diagnostics_baseline_fs.rs:99-104 | crates/project-model/src/diagnostics_baseline_fs.rs:106-111 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/hir-def/src/conditional_tree.rs:535 — crates/hir-def/src/conditional_tree.rs:535-540 | crates/hir-def/src/region_tree.rs:392-397 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/base-db/src/queries.rs:255 — crates/base-db/src/queries.rs:255-262 | crates/ide/src/name_lookup.rs:364-369 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/hir-def/src/module_interface.rs:234 — crates/hir-def/src/module_interface.rs:234-239 | crates/hir-def/src/symbol_tree.rs:202-207 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/syntax/src/comment_run.rs:236 — crates/syntax/src/comment_run.rs:236-242 | crates/sdbl-hir/src/lower/expr/mod.rs:729-734 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/syntax/src/ast.rs:797 — crates/syntax/src/ast.rs:797-807 | crates/hir-def/src/body/lower/diagnostics.rs:488-493 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/ide-diagnostics/src/handlers/structure_key_is_not_identifier.rs:144 — crates/ide-diagnostics/src/handlers/structure_key_is_not_identifier.rs:144-149 | crates/hir-ty/src/lower/type_string.rs:148-154 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/ide/src/completion/bsl_completion.rs:938 — crates/ide/src/completion/bsl_completion.rs:938-943 | crates/ide/src/completion/platform_completion.rs:687-692 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/ide/src/convert_method.rs:206 — crates/ide/src/convert_method.rs:206-211 | crates/mcp-server/src/tools/diagnostics/snippet.rs:587-593 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/bsl-analyzer/src/handlers/workspace_batch.rs:115 — crates/bsl-analyzer/src/handlers/workspace_batch.rs:115-121 | crates/bsl-analyzer/src/server.rs:708-713 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/hir-ty/src/field_lookup.rs:466 — crates/hir-ty/src/field_lookup.rs:466-471 | crates/ide/src/completion/mdo_completion.rs:332-338 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/hir-def/src/call_hierarchy_index.rs:199 — crates/hir-def/src/call_hierarchy_index.rs:199-204 | crates/hir-def/src/graph_index.rs:2333-2338 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/mcp-server/src/graph/content_hash.rs:144 — crates/mcp-server/src/graph/content_hash.rs:144-149 | crates/mcp-server/src/tools/platform.rs:261-267 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · ide · ×12
  • ide::completion::platform_completion::platform_completions (cyclomatic 32) crates/ide/src/completion/platform_completion.rs:72 — ide::completion::platform_completion::platform_completions has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ide::hover::definition_to_hover (cyclomatic 28) crates/ide/src/hover.rs:344 — ide::hover::definition_to_hover has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ide::graph::build_workspace_graph_rows (cyclomatic 26) crates/ide/src/graph.rs:1112 — ide::graph::build_workspace_graph_rows 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.
  • ide::partitioned_diagnostics_baseline::load_diagnostics_baseline_set_once (cyclomatic 24) crates/ide/src/partitioned_diagnostics_baseline.rs:796 — ide::partitioned_diagnostics_baseline::load_diagnostics_baseline_set_once 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.
  • ide::completion::mdo_completion::mdo_completions (cyclomatic 22) crates/ide/src/completion/mdo_completion.rs:13 — ide::completion::mdo_completion::mdo_completions 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.
  • ide::references::resolve_by_text (cyclomatic 19) crates/ide/src/references.rs:667 — ide::references::resolve_by_text 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.
  • ide::completion::type_string_completion::type_string_completions (cyclomatic 18) crates/ide/src/completion/type_string_completion.rs:29 — ide::completion::type_string_completion::type_string_completions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • ide::partitioned_diagnostics_baseline::classify_partitioned_diagnostics_with (cyclomatic 17) crates/ide/src/partitioned_diagnostics_baseline.rs:327 — ide::partitioned_diagnostics_baseline::classify_partitioned_diagnostics_with 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.
  • ide::syntax_highlighting::highlight_name_semantic (cyclomatic 17) crates/ide/src/syntax_highlighting.rs:217 — ide::syntax_highlighting::highlight_name_semantic has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: HlTag::as_str (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • ide::completion::platform_completion::collect_platform_items (cyclomatic 16) crates/ide/src/completion/platform_completion.rs:349 — ide::completion::platform_completion::collect_platform_items has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • ide::formatting::ir::decide_inline_gap (cyclomatic 16) crates/ide/src/formatting/ir.rs:248 — ide::formatting::ir::decide_inline_gap has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ide::graph::classify_graph_id (cyclomatic 16) crates/ide/src/graph.rs:3067 — ide::graph::classify_graph_id has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×12
  • Edited copy of a member (12 corresponding lines) crates/ide-db/src/metadata.rs:938 — crates/ide-db/src/metadata.rs:938-955 | crates/ide-db/src/metadata.rs:1265-1276 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) REDACTED:3736 — REDACTED:3736-3749 | REDACTED:3754-3765 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/ide-diagnostics/src/handlers/unknown_preprocessor_symbol_corpus.rs:10 — crates/ide-diagnostics/src/handlers/unknown_preprocessor_symbol_corpus.rs:10-21 | crates/mcp-server/src/tools/outline.rs:422-433 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/hir-def/src/resolver.rs:668 — crates/hir-def/src/resolver.rs:668-679 | crates/hir-def/src/resolver.rs:907-919 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/bsl-search/src/embedder.rs:307 — crates/bsl-search/src/embedder.rs:307-318 | crates/bsl-search/src/embedder.rs:581-592 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/ide-host-core/src/workspace.rs:546 — crates/ide-host-core/src/workspace.rs:546-557 | crates/ide-host-core/src/workspace.rs:559-572 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/parser/src/grammar.rs:447 — crates/parser/src/grammar.rs:447-458 | crates/parser/src/grammar.rs:460-471 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) REDACTED:4472 — REDACTED:4472-4483 | REDACTED:4488-4509 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/mcp-server/src/broker/daemon.rs:792 — crates/mcp-server/src/broker/daemon.rs:792-803 | crates/mcp-server/src/broker/daemon.rs:846-858 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/ide/src/completion/templates.rs:266 — crates/ide/src/completion/templates.rs:266-279 | crates/ide/src/completion/templates.rs:281-292 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/ide-diagnostics/src/runner.rs:148 — crates/ide-diagnostics/src/runner.rs:148-159 | crates/ide-diagnostics/src/runner.rs:508-522 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/ide/src/folding.rs:141 — crates/ide/src/folding.rs:141-155 | crates/ide/src/formatting/ir.rs:316-327 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D2 · Cognitive Complexity · html_parser · ×11
  • html_parser::scraper_parser::extract_examples (cognitive 136) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:629 — html_parser::scraper_parser::extract_examples has cognitive complexity 136 (threshold 15). Drivers by points: if/else 25 (117 pts), loops 4 (17 pts), boolean chains 2 (nesting depth added 105). 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.
  • html_parser::parse_method_html (cognitive 41) crates/bsl-platform/tools/html-parser/src/lib.rs:623 — html_parser::parse_method_html has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 1 (7 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • html_parser::scraper_parser::extract_see_also (cognitive 38) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:1497 — html_parser::scraper_parser::extract_see_also has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (3 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.
  • html_parser::scraper_parser::extract_chapter_content (cognitive 36) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:479 — html_parser::scraper_parser::extract_chapter_content has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (30 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 24). 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.
  • html_parser::scraper_parser::extract_return_type (cognitive 34) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:99 — html_parser::scraper_parser::extract_return_type has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • html_parser::parse_global_function_html (cognitive 33) crates/bsl-platform/tools/html-parser/src/lib.rs:978 — html_parser::parse_global_function_html has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 1 (6 pts) (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.
  • html_parser::scraper_parser::extract_parameter_descriptions (cognitive 31) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:544 — html_parser::scraper_parser::extract_parameter_descriptions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (26 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • html_parser::scraper_parser::extract_parameter_variants (cognitive 25) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:242 — html_parser::scraper_parser::extract_parameter_variants has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • html_parser::scraper_parser::extract_iter_element_types (cognitive 21) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:149 — html_parser::scraper_parser::extract_iter_element_types has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • html_parser::scraper_parser::collect_param_description (cognitive 18) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:587 — html_parser::scraper_parser::collect_param_description has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • html_parser::scraper_parser::extract_param_type (cognitive 17) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:320 — html_parser::scraper_parser::extract_param_type has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×11
  • Edited copy of a member (15 corresponding lines) crates/ide/src/hover.rs:652 — crates/ide/src/hover.rs:652-666 | crates/ide/src/hover.rs:675-690 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/hir-def/src/resolver.rs:234 — crates/hir-def/src/resolver.rs:234-251 | crates/hir-def/src/resolver.rs:253-267 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/bsl-search/src/engine.rs:2391 — crates/bsl-search/src/engine.rs:2391-2405 | crates/bsl-search/src/workspace_overlay.rs:2614-2628 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/bsl-analyzer/src/mcp_install/adapters.rs:556 — crates/bsl-analyzer/src/mcp_install/adapters.rs:556-570 | crates/bsl-analyzer/src/mcp_install/adapters.rs:594-608 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/ide/src/completion/mdo_completion.rs:533 — crates/ide/src/completion/mdo_completion.rs:533-547 | crates/ide/src/completion/mdo_completion.rs:552-568 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/hir-def/src/body/lower/diagnostics.rs:721 — crates/hir-def/src/body/lower/diagnostics.rs:721-735 | crates/hir-def/src/body/lower/diagnostics.rs:737-751 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/bsl-analyzer/src/smoke.rs:569 — crates/bsl-analyzer/src/smoke.rs:569-583 | crates/bsl-analyzer/src/smoke.rs:661-676 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/mcp-server/src/tools/metadata.rs:16 — crates/mcp-server/src/tools/metadata.rs:16-31 | crates/mcp-server/src/tools/metadata.rs:39-53 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/ide/src/symbol_info.rs:1569 — crates/ide/src/symbol_info.rs:1569-1584 | crates/symbol-info/src/adapters/common_module.rs:21-35 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/ide-diagnostics/src/body_context.rs:146 — crates/ide-diagnostics/src/body_context.rs:146-161 | crates/ide-diagnostics/src/body_context.rs:166-180 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/bsl-metadata/src/xml_parser/role.rs:109 — crates/bsl-metadata/src/xml_parser/role.rs:109-123 | crates/bsl-metadata/src/xml_parser/subsystem.rs:66-83 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · SharedState · ×10
  • SharedState::init_workspace_search_engine (cyclomatic 54) crates/mcp-server/src/state/bootstrap.rs:2265 — SharedState::init_workspace_search_engine has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SharedState::workspace_indexing (cyclomatic 53) crates/mcp-server/src/state/mod.rs:860 — SharedState::workspace_indexing has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SharedState::spawn_embed_pass (cyclomatic 52) crates/mcp-server/src/state/embed.rs:1284 — SharedState::spawn_embed_pass has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SharedState::spawn_search_sink (cyclomatic 44) crates/mcp-server/src/state/sync.rs:318 — SharedState::spawn_search_sink has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SharedState::refresh_search_roots_after_graph (cyclomatic 35) crates/mcp-server/src/state/embed.rs:360 — SharedState::refresh_search_roots_after_graph has cyclomatic complexity 35 (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.
  • SharedState::run_overlay_warmup (cyclomatic 33) crates/mcp-server/src/state/embed.rs:702 — SharedState::run_overlay_warmup has cyclomatic complexity 33 (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.
  • SharedState::spawn_workspace_search_init (cyclomatic 30) crates/mcp-server/src/state/bootstrap.rs:1235 — SharedState::spawn_workspace_search_init has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SharedState::apply_prepared_search_drift (cyclomatic 28) crates/mcp-server/src/state/sync.rs:935 — SharedState::apply_prepared_search_drift has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • SharedState::prepare_search_drift (cyclomatic 18) crates/mcp-server/src/state/sync.rs:687 — SharedState::prepare_search_drift has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • SharedState::workspace_with_cache_and_prefixes_impl (cyclomatic 16) crates/mcp-server/src/state/bootstrap.rs:734 — SharedState::workspace_with_cache_and_prefixes_impl has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · hir_ty · ×10
  • hir_ty::subtype::is_assignable (cyclomatic 41) crates/hir-ty/src/subtype.rs:16 — hir_ty::subtype::is_assignable has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • hir_ty::structure_keys::collect_structure_shapes (cyclomatic 35) crates/hir-ty/src/structure_keys.rs:122 — hir_ty::structure_keys::collect_structure_shapes has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • hir_ty::form_items::body_may_change_items (cyclomatic 23) crates/hir-ty/src/form_items.rs:168 — hir_ty::form_items::body_may_change_items has cyclomatic complexity 23 (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.
  • hir_ty::iteration_lookup::resolve_iter_element_ty_inner (cyclomatic 21) crates/hir-ty/src/iteration_lookup.rs:31 — hir_ty::iteration_lookup::resolve_iter_element_ty_inner has cyclomatic complexity 21 (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.
  • hir_ty::definite_init::collect (cyclomatic 20) crates/hir-ty/src/definite_init.rs:129 — hir_ty::definite_init::collect 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.
  • hir_ty::field_enum::enumerate_projected_fields (cyclomatic 19) crates/hir-ty/src/field_enum.rs:82 — hir_ty::field_enum::enumerate_projected_fields has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • hir_ty::platform_global_lookup::bare_global_name_claim (cyclomatic 19) crates/hir-ty/src/platform_global_lookup.rs:150 — hir_ty::platform_global_lookup::bare_global_name_claim 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.
  • hir_ty::subtype::is_coercible_to (cyclomatic 19) crates/hir-ty/src/subtype.rs:392 — hir_ty::subtype::is_coercible_to 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.
  • hir_ty::field_lookup::lookup_field_raw (cyclomatic 17) crates/hir-ty/src/field_lookup.rs:155 — hir_ty::field_lookup::lookup_field_raw 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.
  • hir_ty::structure_keys::invalidate_expression_escapes (cyclomatic 16) crates/hir-ty/src/structure_keys.rs:613 — hir_ty::structure_keys::invalidate_expression_escapes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LoweringContext · ×10
  • LoweringContext::build_accounting_register_table (cyclomatic 37) crates/sdbl-hir/src/lower/register_tables.rs:187 — LoweringContext::build_accounting_register_table has cyclomatic complexity 37 (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.
  • LoweringContext::lower_function_call (cyclomatic 30) crates/sdbl-hir/src/lower/expr/mod.rs:282 — LoweringContext::lower_function_call has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LoweringContext::lower_table_ref (cyclomatic 24) crates/sdbl-hir/src/lower/from_clause.rs:181 — LoweringContext::lower_table_ref 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.
  • LoweringContext::lower_column_ref (cyclomatic 23) crates/sdbl-hir/src/lower/expr/mod.rs:69 — LoweringContext::lower_column_ref 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.
  • LoweringContext::check_expr_for_unlimited_string (cyclomatic 22) crates/sdbl-hir/src/lower/diagnostics.rs:762 — LoweringContext::check_expr_for_unlimited_string has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • LoweringContext::check_expr_for_ref_overuse (cyclomatic 20) crates/sdbl-hir/src/lower/diagnostics.rs:591 — LoweringContext::check_expr_for_ref_overuse has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • LoweringContext::extract_limitations (cyclomatic 19) crates/sdbl-hir/src/lower/select_fields.rs:23 — LoweringContext::extract_limitations 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.
  • LoweringContext::lower_totals_by_clause (cyclomatic 18) crates/sdbl-hir/src/lower/clauses.rs:263 — LoweringContext::lower_totals_by_clause has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LoweringContext::lower_literal (cyclomatic 18) crates/sdbl-hir/src/lower/expr/mod.rs:211 — LoweringContext::lower_literal 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. This is NOT this file's highest cyclomatic complexity: LoweringContext::lower_expr (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • LoweringContext::resolve_table (cyclomatic 18) crates/sdbl-hir/src/lower/from_clause.rs:415 — LoweringContext::resolve_table 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.
D2 · Cognitive Complexity · InferenceContext · ×10
  • InferenceContext::infer_call (cognitive 254) crates/hir-ty/src/infer.rs:4963 — InferenceContext::infer_call has cognitive complexity 254 (threshold 15). Drivers by points: if/else 68 (193 pts), loops 9 (35 pts), match/switch 6 (16 pts), boolean chains 10 (nesting depth added 161). 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.
  • InferenceContext::infer_expr (cognitive 91) crates/hir-ty/src/infer.rs:3971 — InferenceContext::infer_expr has cognitive complexity 91 (threshold 15). Drivers by points: if/else 23 (52 pts), match/switch 8 (20 pts), boolean chains 13, loops 3 (6 pts) (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.
  • InferenceContext::resolve_bare_name (cognitive 88) crates/hir-ty/src/infer.rs:4410 — InferenceContext::resolve_bare_name has cognitive complexity 88 (threshold 15). Drivers by points: if/else 42 (71 pts), boolean chains 17 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InferenceContext::infer_stmt (cognitive 76) crates/hir-ty/src/infer.rs:3619 — InferenceContext::infer_stmt has cognitive complexity 76 (threshold 15). Drivers by points: if/else 22 (55 pts), match/switch 5 (11 pts), boolean chains 6, loops 2 (4 pts) (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.
  • InferenceContext::dispatch_bare_ident_field_call (cognitive 32) crates/hir-ty/src/infer.rs:6228 — InferenceContext::dispatch_bare_ident_field_call has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 6 (11 pts), boolean chains 3, match/switch 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.
  • InferenceContext::types_on_every_path (cognitive 25) crates/hir-ty/src/infer.rs:3095 — InferenceContext::types_on_every_path has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (8 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InferenceContext::infer_qualified_call (cognitive 25) crates/hir-ty/src/infer.rs:6072 — InferenceContext::infer_qualified_call has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InferenceContext::global_export_map (cognitive 18) crates/hir-ty/src/infer.rs:1325 — InferenceContext::global_export_map has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (7 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InferenceContext::register_records_element_ty (cognitive 16) crates/hir-ty/src/infer.rs:2854 — InferenceContext::register_records_element_ty has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • InferenceContext::infer_binary_op (cognitive 16) crates/hir-ty/src/infer.rs:4787 — InferenceContext::infer_binary_op has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchEngine · ×10
  • SearchEngine::index_directory (cognitive 87) crates/bsl-search/src/engine.rs:1284 — SearchEngine::index_directory has cognitive complexity 87 (threshold 15). Drivers by points: if/else 26 (56 pts), match/switch 7 (16 pts), loops 8 (14 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SearchEngine::refresh_dirty_contexts_fenced (cognitive 76) crates/bsl-search/src/engine.rs:4766 — SearchEngine::refresh_dirty_contexts_fenced has cognitive complexity 76 (threshold 15). Drivers by points: if/else 17 (37 pts), match/switch 10 (28 pts), loops 5 (8 pts), boolean chains 3 (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.
  • SearchEngine::run_embedding_pass_owned (cognitive 59) crates/bsl-search/src/engine.rs:2014 — SearchEngine::run_embedding_pass_owned has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (38 pts), match/switch 8 (17 pts), loops 4 (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.
  • SearchEngine::sync_indexed_documents_in_collection_with_embeddings (cognitive 56) crates/bsl-search/src/engine.rs:6372 — SearchEngine::sync_indexed_documents_in_collection_with_embeddings has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 6 (13 pts) (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.
  • SearchEngine::stage_validated_workspace_roots_transition (cognitive 36) crates/bsl-search/src/engine.rs:3556 — SearchEngine::stage_validated_workspace_roots_transition has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 10, loops 4 (5 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SearchEngine::run_fenced_embedding_pass (cognitive 22) crates/bsl-search/src/engine.rs:1845 — SearchEngine::run_fenced_embedding_pass has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SearchEngine::embed_documents (cognitive 20) crates/bsl-search/src/engine.rs:3266 — SearchEngine::embed_documents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 4, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • SearchEngine::ingest_files_fts (cognitive 19) crates/bsl-search/src/engine.rs:2934 — SearchEngine::ingest_files_fts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 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.
  • SearchEngine::embed_missing_overlay_chunks (cognitive 19) crates/bsl-search/src/engine.rs:5679 — SearchEngine::embed_missing_overlay_chunks has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (7 pts), loops 2 (3 pts) (nesting depth added 9). 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.
  • SearchEngine::prime_workspace_overlay_standalone_retrying (cognitive 16) crates/bsl-search/src/engine.rs:5559 — SearchEngine::prime_workspace_overlay_standalone_retrying has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), match/switch 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.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×10
  • Edited copy of a member (18 corresponding lines) crates/hir-ty/src/this_object.rs:68 — crates/hir-ty/src/this_object.rs:68-85 | crates/hir-ty/src/this_object.rs:90-107 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/bsl-debug/src/types/xml.rs:347 — crates/bsl-debug/src/types/xml.rs:347-368 | crates/bsl-debug/src/types/xml.rs:376-393 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/mcp-server/src/tools/platform.rs:513 — crates/mcp-server/src/tools/platform.rs:513-531 | crates/mcp-server/src/tools/platform.rs:580-597 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/project-model/src/diagnostics_baseline_fs.rs:42 — crates/project-model/src/diagnostics_baseline_fs.rs:42-59 | crates/project-model/src/diagnostics_baseline_fs.rs:162-181 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/ide/src/symbol_info.rs:964 — crates/ide/src/symbol_info.rs:964-981 | crates/ide/src/type_definition.rs:141-159 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/bsl-analyzer/src/global_state.rs:848 — crates/bsl-analyzer/src/global_state.rs:848-865 | crates/bsl-analyzer/src/workspace.rs:590-607 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/hir-ty/src/arg_diagnostics.rs:323 — crates/hir-ty/src/arg_diagnostics.rs:323-341 | crates/hir-ty/src/arg_diagnostics.rs:350-367 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/hir-def/src/graph_index.rs:2225 — crates/hir-def/src/graph_index.rs:2225-2242 | crates/ide/src/graph.rs:3279-3298 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/parser/src/grammar/items.rs:23 — crates/parser/src/grammar/items.rs:23-40 | crates/parser/src/grammar/items.rs:188-205 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/bsl-analyzer/src/bin/cli/rules.rs:157 — crates/bsl-analyzer/src/bin/cli/rules.rs:157-175 | crates/ide/src/diagnostics_catalog.rs:136-153 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×10
  • Edited copy of a member (7 corresponding lines) crates/bsl-platform/src/types.rs:144 — crates/bsl-platform/src/types.rs:144-150 | crates/bsl-platform/src/types.rs:171-178 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/bsl-metadata/src/http_service.rs:62 — crates/bsl-metadata/src/http_service.rs:62-72 | crates/bsl-metadata/src/web_service.rs:56-62 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/mcp-server/src/broker/name.rs:65 — crates/mcp-server/src/broker/name.rs:65-79 | crates/mcp-server/src/broker/name.rs:176-182 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/bsl-search/src/embedder.rs:39 — crates/bsl-search/src/embedder.rs:39-45 | crates/bsl-search/src/embedder.rs:60-66 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/hir-def/src/graph_index.rs:2433 — crates/hir-def/src/graph_index.rs:2433-2439 | crates/ide/src/graph.rs:2307-2313 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/hir-def/src/queries.rs:162 — crates/hir-def/src/queries.rs:162-168 | crates/hir-def/src/symbol_tree.rs:293-299 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/hir/src/definition.rs:118 — crates/hir/src/definition.rs:118-126 | crates/hir/src/definition.rs:149-155 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/ide-diagnostics/src/handlers/unused_local_method.rs:395 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:395-409 | crates/ide-diagnostics/src/handlers/unused_parameters/remove_parameter.rs:209-215 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/hir-ty/src/field_enum.rs:601 — crates/hir-ty/src/field_enum.rs:601-610 | crates/sdbl-hir/src/lower/register_tables.rs:35-41 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) REDACTED:526 — REDACTED:526-533 | crates/bsl-search/src/engine.rs:652-658 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · bsl_check_executor · ×9
  • bsl_check_executor::native_check::profile::run_native_check (cyclomatic 53) crates/bsl-check-executor/src/native_check/profile.rs:590 — bsl_check_executor::native_check::profile::run_native_check has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_check_executor::native_check::compiler::run_bounded_with_log (cyclomatic 28) crates/bsl-check-executor/src/native_check/compiler.rs:439 — bsl_check_executor::native_check::compiler::run_bounded_with_log has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • bsl_check_executor::native_check::source::parse_metadata_form_type (cyclomatic 23) crates/bsl-check-executor/src/native_check/source.rs:539 — bsl_check_executor::native_check::source::parse_metadata_form_type 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.
  • bsl_check_executor::native_check::profile::add_synthetic_owner (cyclomatic 19) crates/bsl-check-executor/src/native_check/profile.rs:2165 — bsl_check_executor::native_check::profile::add_synthetic_owner has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • bsl_check_executor::native_check::source::flat_module_export_name (cyclomatic 19) crates/bsl-check-executor/src/native_check/source.rs:270 — bsl_check_executor::native_check::source::flat_module_export_name 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.
  • bsl_check_executor::native_check::profile::recover_process_group (cyclomatic 18) crates/bsl-check-executor/src/native_check/profile.rs:3307 — bsl_check_executor::native_check::profile::recover_process_group has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • bsl_check_executor::native_check::profile::cleanup_owned_jobs (cyclomatic 17) crates/bsl-check-executor/src/native_check/profile.rs:3060 — bsl_check_executor::native_check::profile::cleanup_owned_jobs 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.
  • bsl_check_executor::native_check::runtime::parse_connection_identity (cyclomatic 17) crates/bsl-check-executor/src/native_check/runtime.rs:246 — bsl_check_executor::native_check::runtime::parse_connection_identity 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.
  • bsl_check_executor::native_check::source::parse_configuration_boolean (cyclomatic 17) crates/bsl-check-executor/src/native_check/source.rs:110 — bsl_check_executor::native_check::source::parse_configuration_boolean has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: bsl_check_executor::native_check::source::metadata_collection_directory (cyclomatic 18) 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.
D1 · Cyclomatic Complexity · SearchEngine · ×9
  • SearchEngine::run_embedding_pass_owned (cyclomatic 45) crates/bsl-search/src/engine.rs:2014 — SearchEngine::run_embedding_pass_owned has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SearchEngine::refresh_dirty_contexts_fenced (cyclomatic 43) crates/bsl-search/src/engine.rs:4766 — SearchEngine::refresh_dirty_contexts_fenced 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.
  • SearchEngine::index_directory (cyclomatic 40) crates/bsl-search/src/engine.rs:1284 — SearchEngine::index_directory has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SearchEngine::stage_validated_workspace_roots_transition (cyclomatic 27) crates/bsl-search/src/engine.rs:3556 — SearchEngine::stage_validated_workspace_roots_transition 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.
  • SearchEngine::sync_indexed_documents_in_collection_with_embeddings (cyclomatic 21) crates/bsl-search/src/engine.rs:6372 — SearchEngine::sync_indexed_documents_in_collection_with_embeddings 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.
  • SearchEngine::run_fenced_embedding_pass (cyclomatic 18) crates/bsl-search/src/engine.rs:1845 — SearchEngine::run_fenced_embedding_pass has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SearchEngine::embed_documents (cyclomatic 17) crates/bsl-search/src/engine.rs:3266 — SearchEngine::embed_documents 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.
  • SearchEngine::apply_staged_workspace_roots_transition (cyclomatic 17) crates/bsl-search/src/engine.rs:3743 — SearchEngine::apply_staged_workspace_roots_transition has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • SearchEngine::embed_missing_overlay_chunks (cyclomatic 17) crates/bsl-search/src/engine.rs:5679 — SearchEngine::embed_missing_overlay_chunks has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · Store · ×9
  • Store::reindex_file_in_collection_checkpointed_with_reuse (cognitive 44) REDACTED:2555 — Store::reindex_file_in_collection_checkpointed_with_reuse has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (31 pts), match/switch 3 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Store::apply_workspace_roots_transition (cognitive 40) REDACTED:2220 — Store::apply_workspace_roots_transition has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 7 (10 pts), match/switch 1 (3 pts), boolean chains 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.
  • Store::apply_overlay_publication_with_token_layout (cognitive 28) REDACTED:5214 — Store::apply_overlay_publication_with_token_layout has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 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.
  • Store::migrate_structural_schema (cognitive 24) REDACTED:856 — Store::migrate_structural_schema has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (3 pts) (nesting depth added 14). 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.
  • Store::migrate_embed_text_version_checkpointed (cognitive 21) REDACTED:1037 — Store::migrate_embed_text_version_checkpointed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Store::hydrate_reusable_embedding_plan_from_conn (cognitive 20) REDACTED:3446 — Store::hydrate_reusable_embedding_plan_from_conn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Store::apply_context_refresh_batch_with_token_layout (cognitive 18) REDACTED:1899 — Store::apply_context_refresh_batch_with_token_layout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 5 (8 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Store::clear_workspace_overlay_checkpointed (cognitive 18) REDACTED:5465 — Store::clear_workspace_overlay_checkpointed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Store::rebuild_root_keyed_tables (cognitive 16) REDACTED:773 — Store::rebuild_root_keyed_tables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×9
  • Duplicated block (17 lines × 2) crates/bsl-analyzer/src/bin/cli/rules.rs:159 — crates/bsl-analyzer/src/bin/cli/rules.rs:159-175 | crates/ide/src/diagnostics_catalog.rs:137-153 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/bin/cli/rules.rs:159` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `tag` to `&ide::MetadataTag` in one and `MetadataTag` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) crates/bsl-check-executor/src/native_check/windows_acl.rs:38 — crates/bsl-check-executor/src/native_check/windows_acl.rs:38-54 | crates/mcp-server/src/cache_windows.rs:47-63 — before extracting anything, compare `crates/bsl-check-executor/src/native_check/windows_acl.rs` and `crates/mcp-server/src/cache_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/windows_acl.rs:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/bsl-debug/src/session.rs:908 — crates/bsl-debug/src/session.rs:908-924 | crates/bsl-debug/src/session.rs:1024-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/session.rs:908` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) REDACTED:2010 — REDACTED:2010-2026 | REDACTED:2308-2324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2010` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) REDACTED:5189 — REDACTED:5189-5205 | REDACTED:5241-5257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5189` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/hir-def/src/graph_index.rs:2226 — crates/hir-def/src/graph_index.rs:2226-2242 | crates/ide/src/graph.rs:3282-3298 — before extracting anything, compare `crates/hir-def/src/graph_index.rs` and `crates/ide/src/graph.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:85 — crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:85-101 | crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs:95-111 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs` and `crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs:93` calls `entry`, `clone`, `or_default` and `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:83` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) crates/mcp-server/src/tools/search/lexical.rs:258 — crates/mcp-server/src/tools/search/lexical.rs:258-274 | crates/mcp-server/src/tools/search/semantic.rs:381-397 — before extracting anything, compare `crates/mcp-server/src/tools/search/lexical.rs` and `crates/mcp-server/src/tools/search/semantic.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/search/lexical.rs:258` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/hir-def/src/item_tree/lower.rs:76 — crates/hir-def/src/item_tree/lower.rs:76-92 | crates/hir-def/src/item_tree/lower.rs:110-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×9
  • Duplicated block (16 lines × 2) crates/bsl-debug/src/dap/mod.rs:459 — crates/bsl-debug/src/dap/mod.rs:459-474 | crates/bsl-debug/src/dap/mod.rs:498-513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/dap/mod.rs:459` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/bsl-debug/src/module_index.rs:345 — crates/bsl-debug/src/module_index.rs:345-360 | crates/bsl-debug/src/module_index.rs:447-462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/module_index.rs:345` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/bsl-platform/tools/html-parser/src/lib.rs:731 — crates/bsl-platform/tools/html-parser/src/lib.rs:731-746 | crates/bsl-platform/tools/html-parser/src/lib.rs:792-807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/lib.rs:731` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/hir-def/src/conditional_tree.rs:337 — crates/hir-def/src/conditional_tree.rs:337-352 | crates/hir-def/src/conditional_tree.rs:370-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/conditional_tree.rs:337` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/ide-diagnostics/src/handlers/at_client_at_server_form_method.rs:33 — crates/ide-diagnostics/src/handlers/at_client_at_server_form_method.rs:33-48 | crates/ide-diagnostics/src/handlers/server_side_export_form_method.rs:29-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16 lines × 2) crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:113 — crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:113-128 | crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:160-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) crates/mcp-server/src/lib.rs:1697 — crates/mcp-server/src/lib.rs:1697-1712 | crates/mcp-server/src/lib.rs:3266-3281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/lib.rs:1697` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) REDACTED:4052 — REDACTED:4052-4067 | REDACTED:4070-4085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4052` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/mcp-server/src/tools/search/gating.rs:137 — crates/mcp-server/src/tools/search/gating.rs:137-152 | crates/mcp-server/src/tools/search/gating.rs:170-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/search/gating.rs:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
IC1 · Incompleteness & stubs · Empty method body · ×9
  • Empty method body — does nothing with its inputs crates/bsl-analyzer/src/bin/cli/check_config.rs:464 — `append_baseline_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/bsl-analyzer/src/smoke.rs:548 — `semantic_tokens_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/bsl-analyzer/src/smoke.rs:552 — `document_symbols_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/bsl-analyzer/src/smoke.rs:556 — `folding_ranges_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/bsl-analyzer/src/smoke.rs:560 — `diagnostics_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs REDACTED:4276 — `log_snapshot_publish_phase_timings` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/bsl-search/src/lifecycle.rs:24 — `set_process_id` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/mcp-server/src/contract.rs:532 — `register_cli_surface` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
  • Empty method body — does nothing with its inputs crates/stdx/src/thread/intent.rs:129 — `set_current_thread_qos_class` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
D1 · Cyclomatic Complexity · parser · ×8
  • parser::grammar::sdbl::select::recover_field_to_alias_or_delimiter (cyclomatic 34) crates/parser/src/grammar/sdbl/select.rs:26 — parser::grammar::sdbl::select::recover_field_to_alias_or_delimiter 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.
  • parser::parser::torn_if::walk (cyclomatic 34) crates/parser/src/parser/torn_if.rs:227 — parser::parser::torn_if::walk 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.
  • parser::grammar::sdbl::expressions::recover_to_delimiter (cyclomatic 29) crates/parser/src/grammar/sdbl/expressions.rs:94 — parser::grammar::sdbl::expressions::recover_to_delimiter 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.
  • parser::grammar::sdbl::expressions::predicate_expr (cyclomatic 29) crates/parser/src/grammar/sdbl/expressions.rs:632 — parser::grammar::sdbl::expressions::predicate_expr 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.
  • parser::grammar::sdbl::expressions::column_or_function (cyclomatic 28) crates/parser/src/grammar/sdbl/expressions.rs:855 — parser::grammar::sdbl::expressions::column_or_function has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • parser::grammar::sdbl::expressions::primary_expr (cyclomatic 19) crates/parser/src/grammar/sdbl/expressions.rs:373 — parser::grammar::sdbl::expressions::primary_expr has cyclomatic complexity 19 (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.
  • parser::grammar::preproc_content (cyclomatic 18) crates/parser/src/grammar.rs:348 — parser::grammar::preproc_content has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • parser::reparse::reparse_method_guarded (cyclomatic 17) crates/parser/src/reparse.rs:149 — parser::reparse::reparse_method_guarded has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D17 · Explicit Debt · TodoComment · ×8
  • TodoComment crates/ide-diagnostics/src/handlers/bad_words.rs:205 — // TODO inline — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/ide-diagnostics/src/handlers/bad_words.rs:407 — // TODO: Доделать функцию — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/ide-diagnostics/src/handlers/if_else_if_ends_with_else.rs:30 — // TODO right before it, matching its indentation. It leaves a placeholder for the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/ide-diagnostics/src/handlers/if_else_if_ends_with_else.rs:72 — // TODO: обработать остальные случаи — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/ide-diagnostics/src/handlers/using_service_tag.rs:209 — // TODO: удалить после внедрения БСП — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/ide-diagnostics/src/handlers/using_service_tag.rs:395 — // TODO: удалить после внедрения БСП — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/ide-diagnostics/src/handlers/using_service_tag.rs:229 — // TODO: просто проверка? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/ide-diagnostics/src/handlers/using_service_tag.rs:415 — // TODO: просто проверка? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · sdbl_hir · ×8
  • sdbl_hir::literal::map_offset_to_query (cognitive 53) crates/sdbl-hir/src/literal.rs:97 — sdbl_hir::literal::map_offset_to_query has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (48 pts), boolean chains 4, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • sdbl_hir::context_detector::detect_context (cognitive 36) crates/sdbl-hir/src/context_detector.rs:242 — sdbl_hir::context_detector::detect_context has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (31 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • sdbl_hir::hir::collect_expr_objects (cognitive 34) crates/sdbl-hir/src/hir.rs:304 — sdbl_hir::hir::collect_expr_objects has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (9 pts), match/switch 2 (3 pts) (nesting depth added 20). 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.
  • sdbl_hir::lower::lower_sdbl_to_hir_with_resolver (cognitive 33) crates/sdbl-hir/src/lower/mod.rs:47 — sdbl_hir::lower::lower_sdbl_to_hir_with_resolver has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 2 (3 pts), match/switch 1 (2 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.
  • sdbl_hir::hir::walk_level_expr (cognitive 18) crates/sdbl-hir/src/hir.rs:444 — sdbl_hir::hir::walk_level_expr has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • sdbl_hir::hir::collect_expr_tables (cognitive 18) crates/sdbl-hir/src/hir.rs:509 — sdbl_hir::hir::collect_expr_tables has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • sdbl_hir::context_detector::find_last_as_keyword (cognitive 16) crates/sdbl-hir/src/context_detector.rs:212 — sdbl_hir::context_detector::find_last_as_keyword has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (7 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • sdbl_hir::lower::from_clause::collect_equality_fields (cognitive 16) crates/sdbl-hir/src/lower/from_clause.rs:1615 — sdbl_hir::lower::from_clause::collect_equality_fields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), match/switch 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ide_db · ×8
  • ide_db::effective_exports::effective_module_exports_query (cognitive 36) crates/ide-db/src/effective_exports.rs:92 — ide_db::effective_exports::effective_module_exports_query has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 1 (5 pts), loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_db::metadata::load_configuration_from_prepared_inputs (cognitive 34) crates/ide-db/src/metadata.rs:672 — ide_db::metadata::load_configuration_from_prepared_inputs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 10 (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.
  • ide_db::metadata::build_module_metadata (cognitive 33) crates/ide-db/src/metadata.rs:2415 — ide_db::metadata::build_module_metadata has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (30 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ide_db::metadata::get_module_type_from_uri (cognitive 21) crates/ide-db/src/metadata.rs:2118 — ide_db::metadata::get_module_type_from_uri has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, match/switch 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • ide_db::effects::detect_recursive_methods (cognitive 19) crates/ide-db/src/effects.rs:277 — ide_db::effects::detect_recursive_methods has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_db::queries::module_recursive_methods_query (cognitive 19) crates/ide-db/src/queries.rs:674 — ide_db::queries::module_recursive_methods_query has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_db::effects::module_effect_summaries_query (cognitive 17) crates/ide-db/src/effects.rs:97 — ide_db::effects::module_effect_summaries_query has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (5 pts), match/switch 1 (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.
  • ide_db::queries::module_metadata_query (cognitive 16) crates/ide-db/src/queries.rs:212 — ide_db::queries::module_metadata_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bsl_metadata · ×8
  • bsl_metadata::loader::build_configuration (cognitive 26) crates/bsl-metadata/src/loader.rs:353 — bsl_metadata::loader::build_configuration has cognitive complexity 26 (threshold 15). Drivers by points: loops 26. 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.
  • bsl_metadata::vendor_support::tokenize (cognitive 24) crates/bsl-metadata/src/vendor_support.rs:203 — bsl_metadata::vendor_support::tokenize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (8 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_metadata::xml_parser::catalog::parse_metadata_object_xml (cognitive 22) crates/bsl-metadata/src/xml_parser/catalog.rs:77 — bsl_metadata::xml_parser::catalog::parse_metadata_object_xml has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 3 (6 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • bsl_metadata::xml_parser::role::parse_objects (cognitive 22) crates/bsl-metadata/src/xml_parser/role.rs:80 — bsl_metadata::xml_parser::role::parse_objects has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_metadata::xml_parser::subsystem::parse_subsystem_xml (cognitive 19) crates/bsl-metadata/src/xml_parser/subsystem.rs:11 — bsl_metadata::xml_parser::subsystem::parse_subsystem_xml has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_metadata::xml_parser::form::parse_form_xml (cognitive 18) crates/bsl-metadata/src/xml_parser/form.rs:13 — bsl_metadata::xml_parser::form::parse_form_xml has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • bsl_metadata::loader::discover_dir_with_predefined (cognitive 16) crates/bsl-metadata/src/loader.rs:800 — bsl_metadata::loader::discover_dir_with_predefined has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 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.
  • bsl_metadata::xml_parser::common_attribute::parse_common_attribute_xml (cognitive 16) crates/bsl-metadata/src/xml_parser/common_attribute.rs:16 — bsl_metadata::xml_parser::common_attribute::parse_common_attribute_xml has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7 (11 pts), if/else 2, loops 1 (2 pts), boolean chains 1 (nesting depth added 5). 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.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×8
  • Edited copy of a member (22 corresponding lines) crates/hir-ty/src/narrow.rs:757 — crates/hir-ty/src/narrow.rs:757-778 | crates/hir-ty/src/narrow.rs:890-912 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/hir-def/src/graph_index.rs:236 — crates/hir-def/src/graph_index.rs:236-260 | crates/hir-def/src/graph_index.rs:274-295 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/mcp-server/src/workspace_lease.rs:697 — crates/mcp-server/src/workspace_lease.rs:697-726 | crates/mcp-server/src/workspace_lease.rs:841-862 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/bsl-metadata/src/xml_parser/register.rs:170 — crates/bsl-metadata/src/xml_parser/register.rs:170-191 | crates/bsl-metadata/src/xml_parser/register.rs:196-219 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/bsl-types/src/testing.rs:32 — crates/bsl-types/src/testing.rs:32-53 | crates/ide-db/src/type_kernel.rs:32-53 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/vcs/src/lib.rs:63 — crates/vcs/src/lib.rs:63-84 | crates/vcs/src/lib.rs:92-113 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/mcp-server/src/baseline.rs:201 — crates/mcp-server/src/baseline.rs:201-222 | crates/mcp-server/src/baseline.rs:227-254 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/ide-diagnostics/src/runner.rs:337 — crates/ide-diagnostics/src/runner.rs:337-358 | crates/ide-diagnostics/src/runner.rs:360-382 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×8
  • Edited copy of a member (17 corresponding lines) crates/mcp-server/src/tools/debug.rs:472 — crates/mcp-server/src/tools/debug.rs:472-488 | crates/mcp-server/src/tools/execution.rs:210-230 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/bsl-analyzer/src/bench/discover.rs:452 — crates/bsl-analyzer/src/bench/discover.rs:452-468 | crates/bsl-analyzer/src/smoke.rs:643-659 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/ide/src/completion/mdo_completion.rs:308 — crates/ide/src/completion/mdo_completion.rs:308-330 | crates/ide/src/completion/mdo_completion.rs:375-391 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:1734 — REDACTED:1734-1753 | REDACTED:1764-1780 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/hir-ty/src/lower/type_string.rs:25 — crates/hir-ty/src/lower/type_string.rs:25-41 | crates/hir-ty/src/lower/type_string.rs:43-59 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:2194 — REDACTED:2194-2213 | REDACTED:2477-2493 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/ide-diagnostics/src/handlers/double_negatives.rs:85 — crates/ide-diagnostics/src/handlers/double_negatives.rs:85-101 | crates/ide-diagnostics/src/handlers/double_negatives.rs:103-119 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:265 — crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:265-281 | crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:22-39 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×8
  • Duplicated block (5 lines × 3) crates/ide/src/name_lookup.rs:1132 — crates/ide/src/name_lookup.rs:1132-1136 | crates/ide/src/symbol_info.rs:965-969 | crates/ide/src/type_definition.rs:144-148 — 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 (5 lines × 3) crates/mcp-server/src/change_hub.rs:5137 — crates/mcp-server/src/change_hub.rs:5137-5146 | crates/mcp-server/src/change_hub.rs:5212-5216 | crates/mcp-server/src/change_hub.rs:5889-5893 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/change_hub.rs:5137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) crates/mcp-server/src/tools/search/lexical.rs:40 — crates/mcp-server/src/tools/search/lexical.rs:40-44 | crates/mcp-server/src/tools/search/semantic.rs:50-54 | crates/mcp-server/src/tools/search/semantic.rs:232-236 — before extracting anything, compare `crates/mcp-server/src/tools/search/lexical.rs` and `crates/mcp-server/src/tools/search/semantic.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/search/lexical.rs:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) crates/mcp-server/src/tools/metadata.rs:969 — crates/mcp-server/src/tools/metadata.rs:969-973 | crates/mcp-server/src/tools/metadata.rs:980-984 | crates/mcp-server/src/tools/metadata.rs:990-997 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/metadata.rs:969` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 3) crates/ide-diagnostics/src/handlers/form_data_has_no_metadata_method.rs:83 — crates/ide-diagnostics/src/handlers/form_data_has_no_metadata_method.rs:83-87 | crates/ide-diagnostics/src/handlers/value_is_filled_of_boolean.rs:123-127 | crates/ide-diagnostics/src/handlers/value_is_filled_of_boolean.rs:129-133 — 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 (5 lines × 3) crates/bsl-platform/src/overlay_schema.rs:348 — crates/bsl-platform/src/overlay_schema.rs:348-352 | crates/bsl-platform/src/overlay_schema.rs:540-547 | crates/bsl-platform/src/overlay_schema.rs:675-682 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/src/overlay_schema.rs:348` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 3) crates/bsl-search/src/engine.rs:577 — crates/bsl-search/src/engine.rs:577-581 | crates/bsl-search/src/engine.rs:1079-1083 | crates/bsl-search/src/engine.rs:1147-1151 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-search/src/engine.rs:575` calls `validate` and `crates/bsl-search/src/engine.rs:1077` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) crates/bsl-search/src/engine.rs:1289 — crates/bsl-search/src/engine.rs:1289-1293 | crates/bsl-search/src/engine.rs:3057-3061 | crates/bsl-search/src/engine.rs:6379-6383 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:1289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
X25 · Inert configuration knob · Configuration option is only ever logged · ×8
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:155 — `DepsResult.roots_sampled` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:156 — `DepsResult.cold_ms_p50` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:173 — `SessionResult.rss_boot_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:174 — `SessionResult.rss_warm_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:176 — `SessionResult.rss_post_edits_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:177 — `SessionResult.rss_post_trim_bytes` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:181 — `SessionResult.edit_rounds` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
  • Configuration option is only ever logged crates/bsl-analyzer/src/smoke.rs:200 — `InternedTrendRow.count_max` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
D2 · Cognitive Complexity · WorkspaceOverlayCache · ×7
  • WorkspaceOverlayCache::full_refresh_from_manifest_scanned (cognitive 86) crates/bsl-search/src/workspace_overlay.rs:1441 — WorkspaceOverlayCache::full_refresh_from_manifest_scanned has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (64 pts), match/switch 4 (13 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 51). 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.
  • WorkspaceOverlayCache::full_refresh_scanned (cognitive 52) crates/bsl-search/src/workspace_overlay.rs:963 — WorkspaceOverlayCache::full_refresh_scanned has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (35 pts), match/switch 3 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • WorkspaceOverlayCache::plan_full_refresh_from_manifest_scanned_with_embedder (cognitive 33) crates/bsl-search/src/workspace_overlay.rs:1765 — WorkspaceOverlayCache::plan_full_refresh_from_manifest_scanned_with_embedder has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WorkspaceOverlayCache::apply_plan_in_memory (cognitive 33) crates/bsl-search/src/workspace_overlay.rs:2120 — WorkspaceOverlayCache::apply_plan_in_memory has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 6 (10 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.
  • WorkspaceOverlayCache::plan_full_refresh_from_local_scanned_with_embedder (cognitive 27) crates/bsl-search/src/workspace_overlay.rs:1916 — WorkspaceOverlayCache::plan_full_refresh_from_local_scanned_with_embedder has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (7 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WorkspaceOverlayCache::finish_publication (cognitive 23) crates/bsl-search/src/workspace_overlay.rs:1195 — WorkspaceOverlayCache::finish_publication has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WorkspaceOverlayCache::transition_roots (cognitive 16) crates/bsl-search/src/workspace_overlay.rs:478 — WorkspaceOverlayCache::transition_roots has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bsl_debug · ×7
  • bsl_debug::types::events::parse_ping_events (cognitive 71) crates/bsl-debug/src/types/events.rs:49 — bsl_debug::types::events::parse_ping_events has cognitive complexity 71 (threshold 15). Drivers by points: if/else 16 (38 pts), match/switch 8 (28 pts), loops 2 (5 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.
  • bsl_debug::types::responses::parse_targets (cognitive 31) crates/bsl-debug/src/types/responses.rs:98 — bsl_debug::types::responses::parse_targets has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (24 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_debug::types::responses::parse_call_stack (cognitive 21) crates/bsl-debug/src/types/responses.rs:169 — bsl_debug::types::responses::parse_call_stack has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (16 pts), if/else 2 (4 pts), loops 1 (nesting depth added 13). 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.
  • bsl_debug::dap::handle_request (cognitive 20) crates/bsl-debug/src/dap/mod.rs:105 — bsl_debug::dap::handle_request has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 10 (15 pts), if/else 2 (5 pts) (nesting depth added 8). 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.
  • bsl_debug::module_index::read_command_uuids (cognitive 20) crates/bsl-debug/src/module_index.rs:516 — bsl_debug::module_index::read_command_uuids has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_debug::types::responses::parse_eval_result (cognitive 20) crates/bsl-debug/src/types/responses.rs:267 — bsl_debug::types::responses::parse_eval_result has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 4 (7 pts), loops 1 (nesting depth added 11). 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.
  • bsl_debug::dap::spawn_event_listener (cognitive 17) crates/bsl-debug/src/dap/mod.rs:524 — bsl_debug::dap::spawn_event_listener has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphState · ×7
  • GraphState::drive_as (cognitive 36) crates/mcp-server/src/graph/state.rs:1094 — GraphState::drive_as has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphState::acquire_graph_access (cognitive 25) crates/mcp-server/src/graph/state.rs:1593 — GraphState::acquire_graph_access has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphState::recovery_proof_with_roots (cognitive 24) crates/mcp-server/src/graph/snapshot.rs:1522 — GraphState::recovery_proof_with_roots has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 4, match/switch 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.
  • GraphState::status_report_with_indexing (cognitive 22) crates/mcp-server/src/graph/state.rs:2604 — GraphState::status_report_with_indexing has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • GraphState::invalidate_scan_on_hub_drift (cognitive 19) crates/mcp-server/src/graph/snapshot.rs:1802 — GraphState::invalidate_scan_on_hub_drift has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • GraphState::kick_first_build_without_a_watcher (cognitive 19) crates/mcp-server/src/graph/state.rs:2854 — GraphState::kick_first_build_without_a_watcher has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphState::indexing_from_inner (cognitive 18) crates/mcp-server/src/graph/state.rs:2406 — GraphState::indexing_from_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×7
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/bsl-analyzer/src/frozen_context.rs:35 — crates/bsl-analyzer/src/frozen_context.rs:35-49 | crates/ide-host-core/src/workspace.rs:358-380 | crates/ide-host-core/src/workspace.rs:382-417 | crates/ide-host-core/src/workspace.rs:435-483 — 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/bsl-check-executor/src/native_check/source.rs:21 — crates/bsl-check-executor/src/native_check/source.rs:21-64 | crates/bsl-check-executor/src/native_check/source.rs:66-108 | crates/bsl-check-executor/src/native_check/source.rs:113-162 | crates/bsl-check-executor/src/native_check/source.rs:539-597 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:1557 — REDACTED:1557-1590 | REDACTED:2569-2811 | REDACTED:3059-3134 | REDACTED:4877-4978 — 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/hir-def/src/conditional_tree.rs:90 — crates/hir-def/src/conditional_tree.rs:90-106 | crates/hir-def/src/conditional_tree.rs:108-124 | crates/hir-def/src/region_tree.rs:82-98 | crates/hir-def/src/region_tree.rs:100-116 — 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/hir-ty/src/method_resolution.rs:39 — crates/hir-ty/src/method_resolution.rs:39-55 | crates/hir-ty/src/method_resolution.rs:162-181 | crates/hir-ty/src/method_resolution.rs:189-208 | crates/hir-ty/src/method_resolution.rs:216-233 — 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/ide-db/src/metadata.rs:1467 — crates/ide-db/src/metadata.rs:1467-1491 | crates/ide-db/src/metadata.rs:1582-1597 | crates/ide-db/src/metadata.rs:1672-1687 | crates/ide-db/src/metadata.rs:1762-1777 — 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/ide-diagnostics/src/handlers/deny_incomplete_values.rs:24 — crates/ide-diagnostics/src/handlers/deny_incomplete_values.rs:24-63 | crates/ide-diagnostics/src/handlers/wrong_data_path_for_form_elements.rs:27-67 | crates/ide-diagnostics/src/handlers/wrong_http_service_handler.rs:24-119 | crates/ide-diagnostics/src/handlers/wrong_web_service_handler.rs:24-91 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×7
  • Edited copy of a member (29 corresponding lines) crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:192 — crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:192-225 | crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:232-260 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/parser/src/grammar/items.rs:109 — crates/parser/src/grammar/items.rs:109-143 | crates/parser/src/grammar/items.rs:158-186 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/bsl-check-executor/src/native_check/profile.rs:2762 — crates/bsl-check-executor/src/native_check/profile.rs:2762-2790 | crates/bsl-check-executor/src/native_check/profile.rs:2842-2871 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/bsl-metadata/src/metadata_object.rs:617 — crates/bsl-metadata/src/metadata_object.rs:617-645 | crates/bsl-platform/src/standard_mdo_attributes.rs:55-84 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/bsl-metadata/src/metadata_object.rs:647 — crates/bsl-metadata/src/metadata_object.rs:647-675 | crates/bsl-platform/src/standard_mdo_attributes.rs:86-115 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/sdbl-hir/src/lower/clauses.rs:12 — crates/sdbl-hir/src/lower/clauses.rs:12-42 | crates/sdbl-hir/src/lower/clauses.rs:47-75 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/mcp-server/src/tools/search/gating.rs:115 — crates/mcp-server/src/tools/search/gating.rs:115-152 | crates/mcp-server/src/tools/search/gating.rs:157-185 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×7
  • Edited copy of a member (19 corresponding lines) crates/bsl-debug/src/session.rs:509 — crates/bsl-debug/src/session.rs:509-530 | crates/bsl-debug/src/session.rs:537-555 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/mcp-server/src/tools/platform.rs:1621 — crates/mcp-server/src/tools/platform.rs:1621-1643 | crates/mcp-server/src/tools/platform.rs:1721-1739 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/bsl-analyzer/src/task_pool.rs:170 — crates/bsl-analyzer/src/task_pool.rs:170-189 | crates/vfs-notify/src/lib.rs:41-59 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/bsl-check-executor/src/native_check/windows_acl.rs:35 — crates/bsl-check-executor/src/native_check/windows_acl.rs:35-54 | crates/mcp-server/src/cache_windows.rs:45-63 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/ide/src/completion/sdbl/use_cases/complete_value_elements.rs:79 — crates/ide/src/completion/sdbl/use_cases/complete_value_elements.rs:79-97 | crates/ide/src/completion/sdbl/use_cases/complete_value_elements.rs:102-121 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/base-db/src/lib.rs:260 — crates/base-db/src/lib.rs:260-288 | crates/base-db/src/lib.rs:438-456 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/ide-diagnostics/src/handlers/empty_statement.rs:21 — crates/ide-diagnostics/src/handlers/empty_statement.rs:21-39 | crates/ide-diagnostics/src/handlers/semicolon_presence.rs:21-39 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×7
  • Edited copy of a member (4 corresponding lines) crates/base-db/src/queries.rs:158 — crates/base-db/src/queries.rs:158-161 | crates/ide-diagnostics/src/slab.rs:266-269 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/hir-def/src/body/lower/query_fragment.rs:329 — crates/hir-def/src/body/lower/query_fragment.rs:329-332 | crates/ide-diagnostics/src/handlers/query_to_missing_metadata.rs:242-245 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/base-db/src/queries.rs:62 — crates/base-db/src/queries.rs:62-65 | crates/ide-db/src/metadata.rs:270-275 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/bsl-metadata/src/configuration.rs:850 — crates/bsl-metadata/src/configuration.rs:850-853 | crates/ide-db/src/metadata.rs:256-259 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) scripts/user2/choose-prefix.py:14 — scripts/user2/choose-prefix.py:14-17 | scripts/user2/compare.py:15-18 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/ide/src/graph.rs:1729 — crates/ide/src/graph.rs:1729-1732 | crates/ide/src/symbol_info.rs:1726-1730 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/hir-def/src/module_interface.rs:229 — crates/hir-def/src/module_interface.rs:229-232 | crates/hir-def/src/symbol_tree.rs:197-200 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×7
  • Duplicated block (8–9 lines × 2) crates/bsl-launcher/src/use_cases.rs:533 — crates/bsl-launcher/src/use_cases.rs:533-541 | crates/bsl-launcher/src/use_cases.rs:589-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-launcher/src/use_cases.rs:533` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) crates/bsl-search/src/workspace_overlay.rs:867 — crates/bsl-search/src/workspace_overlay.rs:867-875 | crates/bsl-search/src/workspace_overlay.rs:885-892 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/workspace_overlay.rs:885` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–9 lines × 2) crates/bsl-search/src/workspace_overlay.rs:917 — crates/bsl-search/src/workspace_overlay.rs:917-925 | crates/bsl-search/src/workspace_overlay.rs:936-943 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/workspace_overlay.rs:936` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-search/src/workspace_overlay.rs:915` calls `full_refresh`, `is_empty` and `crates/bsl-search/src/workspace_overlay.rs:935` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 2) crates/hir-ty/src/infer.rs:5022 — crates/hir-ty/src/infer.rs:5022-5029 | crates/hir-ty/src/infer.rs:6309-6317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/infer.rs:5022` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) crates/mcp-server/src/tools/platform.rs:1482 — crates/mcp-server/src/tools/platform.rs:1482-1489 | crates/mcp-server/src/tools/platform.rs:1525-1533 — both copies are in the same file, so extract the 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/symbol-info/src/presenters/completion.rs:42 — crates/symbol-info/src/presenters/completion.rs:42-49 | crates/symbol-info/src/presenters/hover.rs:41-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/symbol-info/src/presenters/completion.rs:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) crates/bsl-analyzer/src/bin/cli/source_set.rs:364 — crates/bsl-analyzer/src/bin/cli/source_set.rs:364-371 | crates/bsl-analyzer/src/bin/cli/source_set.rs:512-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/bin/cli/source_set.rs:364` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · InferenceContext · ×6
  • InferenceContext::infer_call (cyclomatic 93) crates/hir-ty/src/infer.rs:4963 — InferenceContext::infer_call has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InferenceContext::resolve_bare_name (cyclomatic 60) crates/hir-ty/src/infer.rs:4410 — InferenceContext::resolve_bare_name has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InferenceContext::infer_expr (cyclomatic 57) crates/hir-ty/src/infer.rs:3971 — InferenceContext::infer_expr has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InferenceContext::infer_stmt (cyclomatic 48) crates/hir-ty/src/infer.rs:3619 — InferenceContext::infer_stmt has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InferenceContext::dispatch_bare_ident_field_call (cyclomatic 26) crates/hir-ty/src/infer.rs:6228 — InferenceContext::dispatch_bare_ident_field_call has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: InferenceContext::push_inference_diagnostic (cyclomatic 29) 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.
  • InferenceContext::types_on_every_path (cyclomatic 20) crates/hir-ty/src/infer.rs:3095 — InferenceContext::types_on_every_path has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: InferenceContext::push_inference_diagnostic (cyclomatic 29) 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.
D1 · Cyclomatic Complexity · WorkspaceOverlayCache · ×6
  • WorkspaceOverlayCache::full_refresh_from_manifest_scanned (cyclomatic 34) crates/bsl-search/src/workspace_overlay.rs:1441 — WorkspaceOverlayCache::full_refresh_from_manifest_scanned 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.
  • WorkspaceOverlayCache::full_refresh_scanned (cyclomatic 20) crates/bsl-search/src/workspace_overlay.rs:963 — WorkspaceOverlayCache::full_refresh_scanned 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.
  • WorkspaceOverlayCache::plan_full_refresh_from_manifest_scanned_with_embedder (cyclomatic 18) crates/bsl-search/src/workspace_overlay.rs:1765 — WorkspaceOverlayCache::plan_full_refresh_from_manifest_scanned_with_embedder has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • WorkspaceOverlayCache::finish_publication (cyclomatic 16) crates/bsl-search/src/workspace_overlay.rs:1195 — WorkspaceOverlayCache::finish_publication 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.
  • WorkspaceOverlayCache::plan_full_refresh_from_local_scanned_with_embedder (cyclomatic 16) crates/bsl-search/src/workspace_overlay.rs:1916 — WorkspaceOverlayCache::plan_full_refresh_from_local_scanned_with_embedder 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.
  • WorkspaceOverlayCache::apply_plan_in_memory (cyclomatic 16) crates/bsl-search/src/workspace_overlay.rs:2120 — WorkspaceOverlayCache::apply_plan_in_memory has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bsl_metadata · ×6
  • bsl_metadata::xml_parser::catalog::parse_metadata_object_xml (cyclomatic 28) crates/bsl-metadata/src/xml_parser/catalog.rs:77 — bsl_metadata::xml_parser::catalog::parse_metadata_object_xml has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • bsl_metadata::loader::build_configuration (cyclomatic 27) crates/bsl-metadata/src/loader.rs:353 — bsl_metadata::loader::build_configuration has cyclomatic complexity 27 (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.
  • bsl_metadata::xml_parser::common_attribute::parse_common_attribute_xml (cyclomatic 21) crates/bsl-metadata/src/xml_parser/common_attribute.rs:16 — bsl_metadata::xml_parser::common_attribute::parse_common_attribute_xml has cyclomatic complexity 21 (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.
  • bsl_metadata::vendor_support::tokenize (cyclomatic 16) crates/bsl-metadata/src/vendor_support.rs:203 — bsl_metadata::vendor_support::tokenize 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.
  • bsl_metadata::xml_parser::form::parse_form_xml (cyclomatic 16) crates/bsl-metadata/src/xml_parser/form.rs:13 — bsl_metadata::xml_parser::form::parse_form_xml 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.
  • bsl_metadata::xml_parser::standard_attributes::build_attr_type (cyclomatic 16) crates/bsl-metadata/src/xml_parser/standard_attributes.rs:115 — bsl_metadata::xml_parser::standard_attributes::build_attr_type has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · sdbl_hir · ×6
  • sdbl_hir::context_detector::detect_context (cyclomatic 23) crates/sdbl-hir/src/context_detector.rs:242 — sdbl_hir::context_detector::detect_context 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.
  • sdbl_hir::hir::collect_expr_objects (cyclomatic 23) crates/sdbl-hir/src/hir.rs:304 — sdbl_hir::hir::collect_expr_objects 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. This is NOT this file's highest cyclomatic complexity: FunctionKind::name_ru (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.
  • sdbl_hir::literal::map_offset_to_query (cyclomatic 21) crates/sdbl-hir/src/literal.rs:97 — sdbl_hir::literal::map_offset_to_query 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.
  • sdbl_hir::hir::walk_level_expr (cyclomatic 20) crates/sdbl-hir/src/hir.rs:444 — sdbl_hir::hir::walk_level_expr has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: FunctionKind::name_ru (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.
  • sdbl_hir::hir::collect_expr_tables (cyclomatic 19) crates/sdbl-hir/src/hir.rs:509 — sdbl_hir::hir::collect_expr_tables has cyclomatic complexity 19 (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: FunctionKind::name_ru (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.
  • sdbl_hir::lower::lower_sdbl_to_hir_with_resolver (cyclomatic 16) crates/sdbl-hir/src/lower/mod.rs:47 — sdbl_hir::lower::lower_sdbl_to_hir_with_resolver 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.
D2 · Cognitive Complexity · bsl_search · ×6
  • bsl_search::publish::validate_source_span_layout (cognitive 31) crates/bsl-search/src/publish.rs:366 — bsl_search::publish::validate_source_span_layout has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 7, loops 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_search::context::file_path_to_module_path (cognitive 22) crates/bsl-search/src/context.rs:1 — bsl_search::context::file_path_to_module_path has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_search::hybrid::fuse_smart (cognitive 22) crates/bsl-search/src/hybrid.rs:128 — bsl_search::hybrid::fuse_smart has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_search::engine::removed_path_keys (cognitive 19) crates/bsl-search/src/engine.rs:6706 — bsl_search::engine::removed_path_keys has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_search::document::prepare_file_documents_with_context (cognitive 17) crates/bsl-search/src/document.rs:182 — bsl_search::document::prepare_file_documents_with_context has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_search::lifecycle::startup::observe (cognitive 17) crates/bsl-search/src/lifecycle/startup.rs:32 — bsl_search::lifecycle::startup::observe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RootDatabaseImpl · ×6
  • RootDatabaseImpl::enumerate_subsystems_for_file (cognitive 28) crates/ide-db/src/database.rs:2004 — RootDatabaseImpl::enumerate_subsystems_for_file has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (9 pts), match/switch 1 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RootDatabaseImpl::resolve_common_module_files_for_file (cognitive 24) crates/ide-db/src/database.rs:2628 — RootDatabaseImpl::resolve_common_module_files_for_file has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RootDatabaseImpl::enumerate_event_subscriptions_for_file (cognitive 22) crates/ide-db/src/database.rs:1732 — RootDatabaseImpl::enumerate_event_subscriptions_for_file has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RootDatabaseImpl::enumerate_roles_for_file) 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.
  • RootDatabaseImpl::enumerate_roles_for_file (cognitive 22) crates/ide-db/src/database.rs:1886 — RootDatabaseImpl::enumerate_roles_for_file has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RootDatabaseImpl::enumerate_event_subscriptions_for_file) 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.
  • RootDatabaseImpl::resolve_metadata_object_over (cognitive 16) crates/ide-db/src/database.rs:2189 — RootDatabaseImpl::resolve_metadata_object_over has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 1 (3 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. This shape REPEATS in the file: one other method here (RootDatabaseImpl::resolve_register_over) 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.
  • RootDatabaseImpl::resolve_register_over (cognitive 16) crates/ide-db/src/database.rs:2253 — RootDatabaseImpl::resolve_register_over has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 1 (3 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. This shape REPEATS in the file: one other method here (RootDatabaseImpl::resolve_metadata_object_over) 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.
D3 · God Classes · TooManyFields · ×6
  • TooManyFields: GlobalState crates/bsl-analyzer/src/global_state.rs:396 — TooManyFields — 95 stored fields beside 88 methods. The bar is 30 stored fields; this is 65 over it, 3.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: GraphState crates/mcp-server/src/graph/state.rs:285 — TooManyFields — 59 stored fields beside 115 methods. The bar is 30 stored fields; this is 29 over it, 1.97× 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: InferenceContext crates/hir-ty/src/infer.rs:670 — TooManyFields — 47 stored fields beside 133 methods. The bar is 30 stored fields; this is 17 over it, 1.57× 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: DiagnosticsState crates/mcp-server/src/diagnostics_state/lifecycle.rs:307 — TooManyFields — 35 stored fields beside 74 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: Record crates/bsl-search/src/lifecycle.rs:264 — TooManyFields — 33 stored fields beside 4 methods. 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: PlatformDataInner crates/bsl-platform/src/db.rs:50 — TooManyFields — 31 stored fields beside 32 methods. 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×6
  • Edited copy of a member (26 corresponding lines) crates/hir-ty/src/infer.rs:1506 — crates/hir-ty/src/infer.rs:1506-1562 | crates/ide-diagnostics/src/hir_inference_dispatch.rs:112-137 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/bsl-check-executor/src/native_check/profile.rs:2350 — crates/bsl-check-executor/src/native_check/profile.rs:2350-2375 | crates/bsl-check-executor/src/native_check/profile.rs:2377-2405 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) REDACTED:4422 — REDACTED:4422-4448 | REDACTED:4679-4704 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/ide-diagnostics/src/handlers/order_of_params.rs:20 — crates/ide-diagnostics/src/handlers/order_of_params.rs:20-45 | crates/ide-diagnostics/src/handlers/reserved_parameter_names.rs:22-52 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/ide-diagnostics/src/handlers/number_of_optional_params.rs:22 — crates/ide-diagnostics/src/handlers/number_of_optional_params.rs:22-48 | crates/ide-diagnostics/src/handlers/number_of_params.rs:22-47 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/bsl-platform/tools/html-parser/src/lib.rs:697 — crates/bsl-platform/tools/html-parser/src/lib.rs:697-723 | crates/bsl-platform/tools/html-parser/src/lib.rs:907-932 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×6
  • Edited copy of a member (31 corresponding lines) crates/mcp-server/src/state/bootstrap.rs:1574 — crates/mcp-server/src/state/bootstrap.rs:1574-1606 | crates/mcp-server/src/state/bootstrap.rs:1608-1638 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:999 — crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:999-1035 | crates/bsl-analyzer/src/bin/cli/diagnostics_baseline.rs:1197-1227 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/bsl-search/src/engine.rs:6116 — crates/bsl-search/src/engine.rs:6116-6150 | crates/bsl-search/src/engine.rs:6249-6279 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/mcp-server/src/tools/metadata.rs:692 — crates/mcp-server/src/tools/metadata.rs:692-724 | crates/mcp-server/src/tools/metadata.rs:726-756 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/bsl-check-executor/src/native_check/profile.rs:1880 — crates/bsl-check-executor/src/native_check/profile.rs:1880-1910 | crates/bsl-check-executor/src/native_check/profile.rs:1927-1961 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/bsl-search/src/engine.rs:5223 — crates/bsl-search/src/engine.rs:5223-5253 | crates/bsl-search/src/engine.rs:6327-6359 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · bsl_debug · ×5
  • bsl_debug::types::events::parse_ping_events (cyclomatic 52) crates/bsl-debug/src/types/events.rs:49 — bsl_debug::types::events::parse_ping_events has cyclomatic complexity 52 (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.
  • bsl_debug::dap::handle_request (cyclomatic 26) crates/bsl-debug/src/dap/mod.rs:105 — bsl_debug::dap::handle_request 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.
  • bsl_debug::types::responses::parse_targets (cyclomatic 21) crates/bsl-debug/src/types/responses.rs:98 — bsl_debug::types::responses::parse_targets 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.
  • bsl_debug::types::responses::parse_call_stack (cyclomatic 18) crates/bsl-debug/src/types/responses.rs:169 — bsl_debug::types::responses::parse_call_stack has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • bsl_debug::types::responses::parse_eval_result (cyclomatic 18) crates/bsl-debug/src/types/responses.rs:267 — bsl_debug::types::responses::parse_eval_result has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · NotifyActor · ×5
  • NotifyActor::load_entry (cognitive 105) crates/vfs-notify/src/lib.rs:442 — NotifyActor::load_entry has cognitive complexity 105 (threshold 15). Drivers by points: if/else 21 (55 pts), loops 10 (26 pts), match/switch 4 (18 pts), boolean chains 6 (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NotifyActor::run (cognitive 103) crates/vfs-notify/src/lib.rs:183 — NotifyActor::run has cognitive complexity 103 (threshold 15). Drivers by points: if/else 16 (63 pts), loops 5 (22 pts), match/switch 4 (16 pts), boolean chains 2 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NotifyActor::scan_appeared_dir (cognitive 44) crates/vfs-notify/src/lib.rs:922 — NotifyActor::scan_appeared_dir has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 6, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NotifyActor::classify_event_path (cognitive 20) crates/vfs-notify/src/lib.rs:700 — NotifyActor::classify_event_path has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NotifyActor::watch_visiting (cognitive 18) crates/vfs-notify/src/lib.rs:880 — NotifyActor::watch_visiting has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ide_host_core · ×5
  • ide_host_core::metadata::refresh_metadata_substrate (cognitive 79) crates/ide-host-core/src/metadata.rs:422 — ide_host_core::metadata::refresh_metadata_substrate has cognitive complexity 79 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 16 (27 pts), match/switch 3 (8 pts), boolean chains 2 (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.
  • ide_host_core::metadata::bootstrap_metadata_substrate (cognitive 78) crates/ide-host-core/src/metadata.rs:48 — ide_host_core::metadata::bootstrap_metadata_substrate has cognitive complexity 78 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 18 (31 pts), match/switch 2 (6 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_host_core::load::apply_source_batch_cancellable (cognitive 32) crates/ide-host-core/src/load.rs:107 — ide_host_core::load::apply_source_batch_cancellable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_host_core::diagnostics_baseline::partitioned_error_observation (cognitive 19) crates/ide-host-core/src/diagnostics_baseline.rs:944 — ide_host_core::diagnostics_baseline::partitioned_error_observation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ide_host_core::project_config::env_options_from_features (cognitive 16) crates/ide-host-core/src/project_config.rs:220 — ide_host_core::project_config::env_options_from_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 1 (3 pts), loops 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.
D2 · Cognitive Complexity · DiagnosticsState · ×5
  • DiagnosticsState::refresh_saved_path (cognitive 44) crates/mcp-server/src/diagnostics_state/drift.rs:106 — DiagnosticsState::refresh_saved_path has cognitive complexity 44 (threshold 15). Drivers by points: if/else 29 (30 pts), boolean chains 8, match/switch 5 (6 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • DiagnosticsState::apply_metadata_and_body_drift (cognitive 25) crates/mcp-server/src/diagnostics_state/drift.rs:993 — DiagnosticsState::apply_metadata_and_body_drift has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DiagnosticsState::run_reload (cognitive 24) crates/mcp-server/src/diagnostics_state/lifecycle.rs:1341 — DiagnosticsState::run_reload has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DiagnosticsState::retry_holes_in (cognitive 20) crates/mcp-server/src/diagnostics_state/drift.rs:525 — DiagnosticsState::retry_holes_in has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • DiagnosticsState::apply_drained_resident (cognitive 20) crates/mcp-server/src/diagnostics_state/drift.rs:912 — DiagnosticsState::apply_drained_resident has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphDebt · ×5
  • GraphDebt::apply_recovery_publication (cognitive 31) crates/mcp-server/src/graph/debt.rs:1321 — GraphDebt::apply_recovery_publication has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphDebt::finish_probe (cognitive 31) crates/mcp-server/src/graph/debt.rs:1657 — GraphDebt::finish_probe has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphDebt::standing (cognitive 26) crates/mcp-server/src/graph/debt.rs:1899 — GraphDebt::standing has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • GraphDebt::record_failure (cognitive 17) crates/mcp-server/src/graph/debt.rs:1199 — GraphDebt::record_failure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphDebt::decide (cognitive 17) crates/mcp-server/src/graph/debt.rs:2049 — GraphDebt::decide has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×5
  • Edited copy of a member (21 corresponding lines) crates/bsl-platform/src/db.rs:511 — crates/bsl-platform/src/db.rs:511-531 | crates/bsl-platform/src/db.rs:598-618 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/mcp-server/src/tools/platform.rs:1419 — crates/mcp-server/src/tools/platform.rs:1419-1440 | crates/mcp-server/src/tools/platform.rs:1445-1465 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/ide/src/hover.rs:717 — crates/ide/src/hover.rs:717-737 | crates/symbol-info/src/adapters/mod.rs:68-92 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/ide-diagnostics/src/handlers/same_metadata_object_and_child_names.rs:70 — crates/ide-diagnostics/src/handlers/same_metadata_object_and_child_names.rs:70-93 | crates/ide-diagnostics/src/handlers/same_metadata_object_and_child_names.rs:101-121 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/bsl-search/src/engine.rs:1742 — crates/bsl-search/src/engine.rs:1742-1762 | crates/bsl-search/src/engine.rs:1988-2011 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/ide-db/src/metadata.rs:1245 — crates/ide-db/src/metadata.rs:1245-1254 | crates/ide-db/src/metadata.rs:1288-1297 | crates/ide-db/src/metadata.rs:1310-1319 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/hir-ty/src/narrow.rs:402 — crates/hir-ty/src/narrow.rs:402-411 | crates/hir-ty/src/narrow.rs:413-422 | crates/hir-ty/src/narrow.rs:428-437 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/hir-ty/src/doc_see.rs:387 — crates/hir-ty/src/doc_see.rs:387-397 | crates/hir-ty/src/lower/doc_structure.rs:187-199 | crates/hir-ty/src/lower/doc_structure.rs:202-211 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/syntax/src/ast.rs:1126 — crates/syntax/src/ast.rs:1126-1135 | crates/syntax/src/ast.rs:1284-1293 | crates/syntax/src/ast.rs:1295-1305 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/ide-diagnostics/src/handlers/internet_access.rs:41 — crates/ide-diagnostics/src/handlers/internet_access.rs:41-50 | crates/ide-diagnostics/src/handlers/nested_ternary_operator.rs:75-84 | crates/ide-diagnostics/src/handlers/timeouts_in_external_resources.rs:234-243 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/hir-def/src/body.rs:274 — crates/hir-def/src/body.rs:274-282 | crates/hir-def/src/body.rs:284-292 | crates/hir-def/src/body.rs:294-302 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/ide-db/src/provider.rs:143 — crates/ide-db/src/provider.rs:143-158 | crates/ide-db/src/provider.rs:187-195 | crates/ide-db/src/provider.rs:216-231 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:62 — crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:62-70 | crates/ide-diagnostics/src/handlers/deprecated_find.rs:59-67 | crates/ide-diagnostics/src/handlers/deprecated_type_managed_form.rs:38-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/ide-diagnostics/src/handlers/identical_expressions.rs:24 — crates/ide-diagnostics/src/handlers/identical_expressions.rs:24-33 | crates/ide-diagnostics/src/handlers/internet_access.rs:27-35 | crates/ide-diagnostics/src/handlers/nested_constructors_in_structure_declaration.rs:22-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/bsl-platform/src/capability/mod.rs:138 — crates/bsl-platform/src/capability/mod.rs:138-146 | crates/bsl-platform/src/deprecation/mod.rs:163-171 | crates/bsl-platform/src/security/mod.rs:130-138 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:193 — crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:193-211 | crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:306-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:91 — crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:91-109 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:32-50 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs` and `crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/ide-diagnostics/src/handlers/weaving_annotation_not_applicable.rs:27 — crates/ide-diagnostics/src/handlers/weaving_annotation_not_applicable.rs:27-45 | crates/ide-diagnostics/src/handlers/weaving_signature_mismatch.rs:28-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/weaving_annotation_not_applicable.rs:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) crates/mcp-server/src/state/bootstrap.rs:2091 — crates/mcp-server/src/state/bootstrap.rs:2091-2109 | crates/mcp-server/src/state/bootstrap.rs:2149-2167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/bootstrap.rs:2091` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) REDACTED:4378 — REDACTED:4378-4396 | REDACTED:5026-5044 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×5
  • Duplicated block (12 lines × 3) crates/bsl-check-executor/src/native_check/source.rs:53 — crates/bsl-check-executor/src/native_check/source.rs:53-64 | crates/bsl-check-executor/src/native_check/source.rs:97-108 | crates/bsl-check-executor/src/native_check/source.rs:151-162 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/source.rs:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/ide-diagnostics/src/common_module_helpers.rs:59 — crates/ide-diagnostics/src/common_module_helpers.rs:59-70 | crates/ide-diagnostics/src/handlers/common_module_invalid_type.rs:27-38 | crates/ide-diagnostics/src/handlers/common_module_name_words.rs:31-42 — 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 (12 lines × 3) crates/ide-host-core/src/metadata.rs:595 — crates/ide-host-core/src/metadata.rs:595-606 | crates/ide-host-core/src/metadata.rs:611-622 | crates/ide-host-core/src/metadata.rs:627-638 — 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 (12 lines × 3) crates/symbol-info/src/adapters/common_module.rs:70 — crates/symbol-info/src/adapters/common_module.rs:70-81 | crates/symbol-info/src/adapters/local_method.rs:36-47 | crates/symbol-info/src/adapters/manager_module.rs:46-57 — before extracting anything, compare `crates/symbol-info/src/adapters/common_module.rs` and `crates/symbol-info/src/adapters/manager_module.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/symbol-info/src/adapters/common_module.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/syntax/src/sdbl_query.rs:218 — crates/syntax/src/sdbl_query.rs:218-229 | crates/syntax/src/sdbl_query.rs:239-250 | crates/syntax/src/sdbl_query.rs:270-281 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:107 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:107-117 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:486-496 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:1508-1518 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) crates/hir-def/src/body/lower/utils.rs:90 — crates/hir-def/src/body/lower/utils.rs:90-100 | crates/ide-diagnostics/src/sdbl_utils.rs:506-516 | crates/syntax/src/sdbl_query.rs:205-215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/utils.rs:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) crates/ide-db/src/database.rs:2492 — crates/ide-db/src/database.rs:2492-2502 | crates/ide-db/src/database.rs:2516-2526 | crates/ide-db/src/database.rs:2542-2552 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:2492` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) crates/ide-db/src/database.rs:1736 — crates/ide-db/src/database.rs:1736-1746 | crates/ide-db/src/database.rs:1887-1897 | crates/ide-db/src/database.rs:2008-2018 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:1736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) REDACTED:2691 — REDACTED:2691-2701 | REDACTED:3071-3081 | REDACTED:4894-4904 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×5
  • Duplicated block (7–9 lines × 2) crates/bsl-platform/tools/html-parser/src/lib.rs:607 — crates/bsl-platform/tools/html-parser/src/lib.rs:607-613 | crates/bsl-platform/tools/html-parser/src/lib.rs:959-967 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/lib.rs:607` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–9 lines × 2) REDACTED:2730 — REDACTED:2730-2736 | REDACTED:4931-4939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2730` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–9 lines × 2) crates/hir-def/src/conditional_tree.rs:222 — crates/hir-def/src/conditional_tree.rs:222-228 | crates/hir-def/src/conditional_tree.rs:280-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/conditional_tree.rs:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–9 lines × 2) crates/ide-host-core/src/metadata.rs:83 — crates/ide-host-core/src/metadata.rs:83-91 | crates/ide-host-core/src/metadata.rs:462-468 — both copies are in the same file, so extract the 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–9 lines × 2) crates/mcp-server/src/graph/state.rs:1292 — crates/mcp-server/src/graph/state.rs:1292-1300 | crates/mcp-server/src/graph/state.rs:1327-1333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/graph/state.rs:1292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) crates/bsl-platform/tools/html-parser/src/lib.rs:560 — crates/bsl-platform/tools/html-parser/src/lib.rs:560-567 | crates/bsl-platform/tools/html-parser/src/lib.rs:628-635 | crates/bsl-platform/tools/html-parser/src/lib.rs:982-989 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/lib.rs:560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/bsl-search/src/engine.rs:613 — crates/bsl-search/src/engine.rs:613-620 | crates/bsl-search/src/engine.rs:1088-1095 | crates/bsl-search/src/engine.rs:1164-1171 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-search/src/engine.rs:622` calls `startup_context_pending` and `crates/bsl-search/src/engine.rs:1097` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) crates/ide-db/src/database.rs:1554 — crates/ide-db/src/database.rs:1554-1564 | crates/ide-db/src/database.rs:1587-1594 | crates/ide-db/src/database.rs:1823-1830 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:1554` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/ide-db/src/database.rs:1769 — crates/ide-db/src/database.rs:1769-1776 | crates/ide-db/src/database.rs:1915-1922 | crates/ide-db/src/database.rs:2050-2057 — 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/mcp-server/src/tools/metadata.rs:477 — crates/mcp-server/src/tools/metadata.rs:477-484 | crates/mcp-server/src/tools/metadata.rs:487-494 | crates/mcp-server/src/tools/metadata.rs:497-504 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/metadata.rs:477` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • Duplicated block (6 lines × 3) crates/bsl-search/src/engine.rs:1409 — crates/bsl-search/src/engine.rs:1409-1414 | crates/bsl-search/src/engine.rs:2122-2127 | crates/bsl-search/src/engine.rs:3291-3296 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:1409` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) REDACTED:2889 — REDACTED:2889-2895 | REDACTED:2999-3004 | REDACTED:3105-3111 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2889` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) REDACTED:2905 — REDACTED:2905-2910 | REDACTED:3129-3134 | REDACTED:4973-4978 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2905` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) REDACTED:3698 — REDACTED:3698-3703 | REDACTED:3737-3742 | REDACTED:3755-3760 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3698` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) REDACTED:1136 — REDACTED:1136-1141 | REDACTED:1579-1584 | REDACTED:1624-1629 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · NotifyActor · ×4
  • NotifyActor::load_entry (cyclomatic 44) crates/vfs-notify/src/lib.rs:442 — NotifyActor::load_entry has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • NotifyActor::run (cyclomatic 33) crates/vfs-notify/src/lib.rs:183 — NotifyActor::run 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.
  • NotifyActor::scan_appeared_dir (cyclomatic 25) crates/vfs-notify/src/lib.rs:922 — NotifyActor::scan_appeared_dir 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.
  • NotifyActor::classify_event_path (cyclomatic 17) crates/vfs-notify/src/lib.rs:700 — NotifyActor::classify_event_path has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GraphState · ×4
  • GraphState::drive_as (cyclomatic 22) crates/mcp-server/src/graph/state.rs:1094 — GraphState::drive_as 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.
  • GraphState::status_report_with_indexing (cyclomatic 21) crates/mcp-server/src/graph/state.rs:2604 — GraphState::status_report_with_indexing 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.
  • GraphState::recovery_proof_with_roots (cyclomatic 19) crates/mcp-server/src/graph/snapshot.rs:1522 — GraphState::recovery_proof_with_roots 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.
  • GraphState::invalidate_scan_on_hub_drift (cyclomatic 17) crates/mcp-server/src/graph/snapshot.rs:1802 — GraphState::invalidate_scan_on_hub_drift 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.
D2 · Cognitive Complexity · Project · ×4
  • Project::diagnostics_baseline_partition_plan (cognitive 53) crates/project-model/src/lib.rs:822 — Project::diagnostics_baseline_partition_plan has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 9 (12 pts), boolean chains 2, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Project::resolve_extension_specs (cognitive 35) crates/project-model/src/lib.rs:1269 — Project::resolve_extension_specs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 4 (7 pts), loops 2 (3 pts), boolean chains 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.
  • Project::diagnostics_baseline (cognitive 22) crates/project-model/src/lib.rs:691 — Project::diagnostics_baseline has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), match/switch 3, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Project::discover_source_path (cognitive 19) crates/project-model/src/lib.rs:1081 — Project::discover_source_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · syntax · ×4
  • syntax::sdbl_query::extract_sdbl_with_corrections (cognitive 50) crates/syntax/src/sdbl_query.rs:202 — syntax::sdbl_query::extract_sdbl_with_corrections has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 4 (10 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • syntax::sdbl_query::map_range_query_to_literal (cognitive 21) crates/syntax/src/sdbl_query.rs:542 — syntax::sdbl_query::map_range_query_to_literal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • syntax::ast_utils::extract_variable_comments_at_offset (cognitive 20) crates/syntax/src/ast_utils.rs:320 — syntax::ast_utils::extract_variable_comments_at_offset has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • syntax::ast_utils::leading_comments (cognitive 17) crates/syntax/src/ast_utils.rs:129 — syntax::ast_utils::leading_comments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, match/switch 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdblHir · ×4
  • SdblHir::collect_resolved_attributes (cognitive 23) crates/sdbl-hir/src/hir.rs:114 — SdblHir::collect_resolved_attributes has cognitive complexity 23 (threshold 15). Drivers by points: loops 10 (13 pts), if/else 7 (10 pts) (nesting depth added 6). 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.
  • SdblHir::collect_resolved_tables (cognitive 20) crates/sdbl-hir/src/hir.rs:65 — SdblHir::collect_resolved_tables has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 6 (8 pts) (nesting depth added 6). 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.
  • SdblHir::collect_dereference_chains (cognitive 20) crates/sdbl-hir/src/hir.rs:185 — SdblHir::collect_dereference_chains has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 7 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SdblHir::collect_referenced_objects (cognitive 18) crates/sdbl-hir/src/hir.rs:264 — SdblHir::collect_referenced_objects has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 5 (6 pts) (nesting depth added 5). 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.
D35 · Change Coupling · Change coupling · ×4
  • Change coupling: salsa_provider.rs ↔ context.rs crates/ide-db/src/salsa_provider.rs:1 — `crates/ide-db/src/salsa_provider.rs` and `crates/ide-diagnostics/src/context.rs` change together 83% of the time (10 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 10 shared commits counted here, the most recent 3 are `4672789a` диагностики: ЗначениеЗаполнено от Булево (ValueIsFilledOfBoolean); `047d85a5` диагностики: вызов Метаданные() у данных формы (FormDataHasNoMetadata…; `d034dadb` fix(ide-diagnostics): StructureKeyIsNotIdentifier проверяет Свойство … — run `git show` on any of them.
  • Change coupling: analyze.rs ↔ features_state.rs crates/bsl-analyzer/src/bin/cli/analyze.rs:1 — `crates/bsl-analyzer/src/bin/cli/analyze.rs` and `crates/bsl-analyzer/src/features_state.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 8 shared commits counted here, the most recent 3 are `cdbfc29a` fix(mcp-server): apply project config to the diagnostics resident lik…; `72edbebc` fix(mcp-server): apply <DefaultRunMode> in the diagnostics resident; `db13b06e` fix(bsl-analyzer,mcp-server): apply the ordinary-form setting in the … — run `git show` on any of them.
  • Change coupling: handlers.rs ↔ diagnostics.rs crates/ide-diagnostics/src/handlers.rs:1 — `crates/ide-diagnostics/src/handlers.rs` and `crates/sdbl-hir/src/diagnostics.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 6 shared commits counted here, the most recent 3 are `020952f5` Диагностика условия виртуальной таблицы без индекса (#389); `f8b0f618` feat(sdbl-hir): diagnose ordering by a document reference's date (#404); `adf72eb8` Диагностика чтения реквизитов регистратора в запросе к регистру (#399) — run `git show` on any of them.
  • Change coupling: code.rs ↔ diagnostics.rs crates/ide-diagnostics/src/code.rs:1 — `crates/ide-diagnostics/src/code.rs` and `crates/sdbl-hir/src/diagnostics.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 5 shared commits counted here, the most recent 3 are `020952f5` Диагностика условия виртуальной таблицы без индекса (#389); `f8b0f618` feat(sdbl-hir): diagnose ordering by a document reference's date (#404); `adf72eb8` Диагностика чтения реквизитов регистратора в запросе к регистру (#399) — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/bsl-metadata/src/loader.rs:1083 — crates/bsl-metadata/src/loader.rs:1083-1097 | crates/bsl-metadata/src/loader.rs:1102-1115 | crates/bsl-metadata/src/loader.rs:1120-1133 | crates/bsl-metadata/src/loader.rs:1138-1151 | crates/bsl-metadata/src/loader.rs:1268-1285 — 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/hir-def/src/body/lower/expr.rs:368 — crates/hir-def/src/body/lower/expr.rs:368-383 | crates/hir-def/src/body/lower/expr.rs:969-979 | crates/hir-def/src/body/lower/stmt.rs:822-871 | crates/hir-def/src/body/lower/stmt.rs:1042-1052 | crates/hir-def/src/body/lower/stmt.rs:1054-1064 — 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/hir-def/src/body/lower/stmt.rs:26 — crates/hir-def/src/body/lower/stmt.rs:26-44 | crates/hir-def/src/body/lower/stmt.rs:46-64 | crates/hir-def/src/body/lower/stmt.rs:128-146 | crates/hir-def/src/body/lower/stmt.rs:148-166 | crates/hir-def/src/body/lower/stmt.rs:168-186 — 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/stdx/src/fs.rs:59 — crates/stdx/src/fs.rs:59-107 | crates/stdx/src/fs.rs:112-152 | crates/stdx/src/fs.rs:157-199 | crates/stdx/src/fs.rs:209-254 | crates/stdx/src/fs.rs:266-313 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×4
  • Edited copy of a member (40 corresponding lines) crates/ide-db/src/database.rs:1735 — crates/ide-db/src/database.rs:1735-1781 | crates/ide-db/src/database.rs:1886-1925 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:22 — crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:22-65 | crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:71-110 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) crates/bsl-debug/src/module_index.rs:239 — crates/bsl-debug/src/module_index.rs:239-288 | crates/bsl-debug/src/module_index.rs:297-336 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) crates/mcp-server/src/broker/daemon.rs:805 — crates/mcp-server/src/broker/daemon.rs:805-844 | crates/mcp-server/src/broker/daemon.rs:885-941 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×4
  • Edited copy of a member (38 corresponding lines) crates/ide-db/src/database.rs:2194 — crates/ide-db/src/database.rs:2194-2231 | crates/ide-db/src/database.rs:2258-2296 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:149 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:149-186 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:479-518 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) crates/bsl-search/src/workspace_overlay.rs:856 — crates/bsl-search/src/workspace_overlay.rs:856-896 | crates/bsl-search/src/workspace_overlay.rs:910-947 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) crates/ide-diagnostics/src/handlers/weaving_annotation_not_applicable.rs:25 — crates/ide-diagnostics/src/handlers/weaving_annotation_not_applicable.rs:25-62 | crates/ide-diagnostics/src/handlers/weaving_signature_mismatch.rs:26-69 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×4
  • Edited copy of a member (33 corresponding lines) crates/hir-def/src/item_tree/lower.rs:75 — crates/hir-def/src/item_tree/lower.rs:75-107 | crates/hir-def/src/item_tree/lower.rs:109-141 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) REDACTED:4377 — REDACTED:4377-4409 | REDACTED:5025-5057 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) crates/ide/src/completion/bsl_completion.rs:945 — crates/ide/src/completion/bsl_completion.rs:945-977 | crates/ide/src/hover.rs:799-840 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) crates/bsl-search/src/workspace_overlay.rs:1388 — crates/bsl-search/src/workspace_overlay.rs:1388-1420 | crates/bsl-search/src/workspace_overlay.rs:2357-2402 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×4
  • Edited copy of a member (25 corresponding lines) crates/bsl-launcher/src/entities.rs:32 — crates/bsl-launcher/src/entities.rs:32-56 | crates/bsl-launcher/src/entities.rs:58-82 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/bsl-metadata/src/xml_parser/role.rs:9 — crates/bsl-metadata/src/xml_parser/role.rs:9-33 | crates/bsl-metadata/src/xml_parser/scheduled_job.rs:6-37 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/sdbl-hir/src/lower/from_clause.rs:1670 — crates/sdbl-hir/src/lower/from_clause.rs:1670-1697 | crates/sdbl-hir/src/lower/from_clause.rs:1912-1936 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/bsl-search/src/engine.rs:4113 — crates/bsl-search/src/engine.rs:4113-4137 | crates/bsl-search/src/engine.rs:4382-4406 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 21+ corresponding lines) crates/bsl-analyzer/src/smoke.rs:585 — crates/bsl-analyzer/src/smoke.rs:585-605 | crates/bsl-analyzer/src/smoke.rs:713-733 | crates/bsl-analyzer/src/smoke.rs:770-798 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) crates/bsl-check-executor/src/main.rs:174 — crates/bsl-check-executor/src/main.rs:174-197 | crates/bsl-check-executor/src/wire_api.rs:176-196 | crates/mcp-server/src/tools/check_executor.rs:680-705 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) crates/bsl-debug/src/session.rs:903 — crates/bsl-debug/src/session.rs:903-924 | crates/bsl-debug/src/session.rs:991-1011 | crates/bsl-debug/src/session.rs:1018-1040 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) crates/hir-def/src/body/lower/control_flow.rs:27 — crates/hir-def/src/body/lower/control_flow.rs:27-50 | crates/ide-diagnostics/src/handlers/code_block_before_sub.rs:100-120 | crates/ide-diagnostics/src/handlers/using_hardcode_network_address.rs:100-121 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 20+ corresponding lines) REDACTED:3814 — REDACTED:3814-3836 | REDACTED:5096-5115 | REDACTED:5366-5389 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) crates/ide-db/src/database.rs:2484 — crates/ide-db/src/database.rs:2484-2504 | crates/ide-db/src/database.rs:2509-2528 | crates/ide-db/src/database.rs:2533-2554 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) crates/hir-def/src/body/lower/diagnostics.rs:223 — crates/hir-def/src/body/lower/diagnostics.rs:223-242 | crates/hir-def/src/body/lower/diagnostics.rs:290-309 | crates/hir-def/src/body/lower/diagnostics.rs:373-392 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) crates/parser/src/grammar/sdbl/select.rs:908 — crates/parser/src/grammar/sdbl/select.rs:908-927 | crates/parser/src/grammar/sdbl/select.rs:929-948 | crates/parser/src/grammar/sdbl/select.rs:1065-1084 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/hir-def/src/graph_index.rs:2522 — crates/hir-def/src/graph_index.rs:2522-2532 | crates/ide/src/graph.rs:1804-1816 | crates/ide/src/graph.rs:1818-1828 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/bsl-analyzer/src/mcp_install/adapters.rs:498 — crates/bsl-analyzer/src/mcp_install/adapters.rs:498-508 | crates/bsl-analyzer/src/mcp_install/adapters.rs:514-524 | crates/bsl-analyzer/src/mcp_install/adapters.rs:530-546 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/mcp-server/src/diagnostics_state/lifecycle.rs:600 — crates/mcp-server/src/diagnostics_state/lifecycle.rs:600-610 | crates/mcp-server/src/diagnostics_state/lifecycle.rs:623-633 | crates/mcp-server/src/diagnostics_state/lifecycle.rs:637-647 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:66 — crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:66-85 | crates/ide-diagnostics/src/handlers/timeouts_in_external_resources.rs:85-95 | crates/ide-diagnostics/src/handlers/using_hardcode_network_address.rs:193-203 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×4
  • Duplicated block (18 lines × 2) crates/bsl-analyzer/src/diagnostics_baseline.rs:115 — crates/bsl-analyzer/src/diagnostics_baseline.rs:115-132 | crates/mcp-server/src/tools/diagnostics.rs:837-854 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/diagnostics_baseline.rs:115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (18 lines × 2) crates/bsl-debug/src/module_index.rs:178 — crates/bsl-debug/src/module_index.rs:178-195 | crates/bsl-debug/src/module_index.rs:240-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/module_index.rs:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/bsl-metadata/src/metadata_object.rs:859 — crates/bsl-metadata/src/metadata_object.rs:859-876 | crates/bsl-metadata/src/metadata_object.rs:889-906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/metadata_object.rs:859` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/bsl-types/src/testing.rs:33 — crates/bsl-types/src/testing.rs:33-50 | crates/ide-db/src/type_kernel.rs:33-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×4
  • Duplicated block (14–16 lines × 2) crates/bsl-debug/src/session.rs:512 — crates/bsl-debug/src/session.rs:512-527 | crates/bsl-debug/src/session.rs:540-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/session.rs:512` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (14–16 lines × 2) crates/ide-host-core/src/metadata.rs:206 — crates/ide-host-core/src/metadata.rs:206-221 | crates/ide-host-core/src/metadata.rs:514-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-host-core/src/metadata.rs:206` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–16 lines × 2) crates/ide-host-core/src/metadata.rs:323 — crates/ide-host-core/src/metadata.rs:323-338 | crates/ide-host-core/src/metadata.rs:632-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-host-core/src/metadata.rs:323` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–16 lines × 2) crates/mcp-server/src/tools/metadata.rs:314 — crates/mcp-server/src/tools/metadata.rs:314-329 | crates/mcp-server/src/tools/metadata.rs:1241-1254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×4
  • Duplicated block (12–13 lines × 2) crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:124 — crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:124-136 | crates/bsl-analyzer/src/diagnostics_baseline/transaction.rs:167-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) crates/mcp-server/src/broker/daemon.rs:726 — crates/mcp-server/src/broker/daemon.rs:726-738 | crates/mcp-server/src/broker/daemon.rs:744-755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/broker/daemon.rs:726` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/mcp-server/src/broker/daemon.rs:723` calls `socket_path`, `display`, `remove_file` and `crates/mcp-server/src/broker/daemon.rs:740` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) crates/parser/src/grammar/sdbl/expressions.rs:609 — crates/parser/src/grammar/sdbl/expressions.rs:609-620 | crates/parser/src/grammar/sdbl/expressions.rs:887-899 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/parser/src/grammar/sdbl/expressions.rs:887` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/parser/src/grammar/sdbl/expressions.rs:605` calls `at_property_name` and `crates/parser/src/grammar/sdbl/expressions.rs:880` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) crates/sdbl-hir/src/context_detector.rs:528 — crates/sdbl-hir/src/context_detector.rs:528-539 | crates/sdbl-hir/src/context_detector.rs:545-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×4
  • Duplicated block (10–12 lines × 2) crates/bsl-analyzer/src/handlers/request.rs:182 — crates/bsl-analyzer/src/handlers/request.rs:182-191 | crates/bsl-analyzer/src/handlers/request.rs:1007-1018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/handlers/request.rs:1007` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `ReferenceParams` in one and `CompletionParams` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10–12 lines × 2) crates/hir-def/src/graph_index.rs:786 — crates/hir-def/src/graph_index.rs:786-795 | crates/hir-def/src/queries.rs:1206-1217 — before extracting anything, compare `crates/hir-def/src/graph_index.rs` and `crates/hir-def/src/queries.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:786` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–12 lines × 2) crates/ide-host-core/src/metadata.rs:289 — crates/ide-host-core/src/metadata.rs:289-300 | crates/ide-host-core/src/metadata.rs:600-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-host-core/src/metadata.rs:289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–12 lines × 2) crates/ide-host-core/src/metadata.rs:306 — crates/ide-host-core/src/metadata.rs:306-317 | crates/ide-host-core/src/metadata.rs:616-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-host-core/src/metadata.rs:306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×4
  • Duplicated block (9 lines × 3) crates/hir-def/src/body/lower/expr.rs:1785 — crates/hir-def/src/body/lower/expr.rs:1785-1793 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:269-277 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:319-327 — before extracting anything, compare `crates/hir-def/src/body/lower/expr.rs` and `crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/expr.rs:1785` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/hir-ty/src/object_resolver.rs:252 — crates/hir-ty/src/object_resolver.rs:252-260 | crates/ide-db/src/provider.rs:80-88 | crates/ide-db/src/provider.rs:102-110 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/object_resolver.rs:252` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/stdx/src/fs.rs:67 — crates/stdx/src/fs.rs:67-75 | crates/stdx/src/fs.rs:116-124 | crates/stdx/src/fs.rs:161-169 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/stdx/src/fs.rs:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/stdx/src/fs.rs:76` calls `is_some_and`, `load` and `crates/stdx/src/fs.rs:125` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) crates/mcp-server/src/tools/metadata.rs:560 — crates/mcp-server/src/tools/metadata.rs:560-568 | crates/mcp-server/src/tools/metadata.rs:571-579 | crates/mcp-server/src/tools/metadata.rs:582-590 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/metadata.rs:560` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×4
  • Duplicated block (8 lines × 4) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:108 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:108-115 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:487-494 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:553-560 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:1509-1516 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) REDACTED:1559 — REDACTED:1559-1566 | REDACTED:2575-2582 | REDACTED:3061-3068 | REDACTED:4880-4887 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 4) crates/mcp-server/src/state/embed.rs:1516 — crates/mcp-server/src/state/embed.rs:1516-1523 | crates/mcp-server/src/state/embed.rs:1573-1580 | crates/mcp-server/src/state/embed.rs:1639-1646 | crates/mcp-server/src/state/embed.rs:1718-1725 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/embed.rs:1639` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 4) crates/ide-db/src/metadata.rs:1473 — crates/ide-db/src/metadata.rs:1473-1480 | crates/ide-db/src/metadata.rs:1587-1594 | crates/ide-db/src/metadata.rs:1677-1684 | crates/ide-db/src/metadata.rs:1767-1774 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/metadata.rs:1473` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) crates/bsl-debug/src/types/xml.rs:349 — crates/bsl-debug/src/types/xml.rs:349-355 | crates/bsl-debug/src/types/xml.rs:378-384 | crates/bsl-debug/src/types/xml.rs:407-413 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-debug/src/types/xml.rs:385` calls `end_prefixed` and `crates/bsl-debug/src/types/xml.rs:356` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) crates/symbol-info/src/adapters/common_module.rs:63 — crates/symbol-info/src/adapters/common_module.rs:63-69 | crates/symbol-info/src/adapters/local_method.rs:28-34 | crates/symbol-info/src/adapters/manager_module.rs:39-45 — before extracting anything, compare `crates/symbol-info/src/adapters/common_module.rs` and `crates/symbol-info/src/adapters/manager_module.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/symbol-info/src/adapters/common_module.rs:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/ide/src/graph.rs:3129 — crates/ide/src/graph.rs:3129-3135 | crates/ide/src/graph.rs:3142-3149 | crates/ide/src/graph.rs:3156-3162 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/graph.rs:3129` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 3) crates/mcp-server/src/lib.rs:1527 — crates/mcp-server/src/lib.rs:1527-1533 | crates/mcp-server/src/lib.rs:2955-2961 | crates/mcp-server/src/lib.rs:3052-3058 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/lib.rs:1527` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D6 · Cohesion (LCOM4) · Low cohesion · ×4
  • Low cohesion: RootDatabaseImpl (LCOM4 30) crates/ide-db/src/database.rs:95 — RootDatabaseImpl's methods fall into 30 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 30 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PlatformDataInner (LCOM4 8) crates/bsl-platform/src/db.rs:50 — PlatformDataInner's methods fall into 8 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 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: McpServer (LCOM4 5) crates/mcp-server/src/lib.rs:1254 — McpServer's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LoweringCtx (LCOM4 4) crates/hir-def/src/body/lower/mod.rs:27 — LoweringCtx'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.
D1 · Cyclomatic Complexity · DiagnosticsState · ×3
  • DiagnosticsState::refresh_saved_path (cyclomatic 46) crates/mcp-server/src/diagnostics_state/drift.rs:106 — DiagnosticsState::refresh_saved_path has cyclomatic complexity 46 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • DiagnosticsState::retry_holes_in (cyclomatic 19) crates/mcp-server/src/diagnostics_state/drift.rs:525 — DiagnosticsState::retry_holes_in 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.
  • DiagnosticsState::apply_metadata_and_body_drift (cyclomatic 18) crates/mcp-server/src/diagnostics_state/drift.rs:993 — DiagnosticsState::apply_metadata_and_body_drift has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ide_host_core · ×3
  • ide_host_core::metadata::refresh_metadata_substrate (cyclomatic 39) crates/ide-host-core/src/metadata.rs:422 — ide_host_core::metadata::refresh_metadata_substrate 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.
  • ide_host_core::metadata::bootstrap_metadata_substrate (cyclomatic 36) crates/ide-host-core/src/metadata.rs:48 — ide_host_core::metadata::bootstrap_metadata_substrate 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.
  • ide_host_core::load::apply_source_batch_cancellable (cyclomatic 16) crates/ide-host-core/src/load.rs:107 — ide_host_core::load::apply_source_batch_cancellable has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GraphDebt · ×3
  • GraphDebt::apply_recovery_publication (cyclomatic 25) crates/mcp-server/src/graph/debt.rs:1321 — GraphDebt::apply_recovery_publication 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.
  • GraphDebt::standing (cyclomatic 20) crates/mcp-server/src/graph/debt.rs:1899 — GraphDebt::standing 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.
  • GraphDebt::finish_probe (cyclomatic 17) crates/mcp-server/src/graph/debt.rs:1657 — GraphDebt::finish_probe has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ide_db · ×3
  • ide_db::metadata::get_module_type_from_uri (cyclomatic 24) crates/ide-db/src/metadata.rs:2118 — ide_db::metadata::get_module_type_from_uri has cyclomatic complexity 24 (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.
  • ide_db::metadata::load_configuration_from_prepared_inputs (cyclomatic 23) crates/ide-db/src/metadata.rs:672 — ide_db::metadata::load_configuration_from_prepared_inputs 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.
  • ide_db::metadata::build_module_metadata (cyclomatic 17) crates/ide-db/src/metadata.rs:2415 — ide_db::metadata::build_module_metadata has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MetricsVisitor · ×3
  • MetricsVisitor::visit_stmt (cyclomatic 23) crates/hir-def/src/metrics.rs:92 — MetricsVisitor::visit_stmt has cyclomatic complexity 23 (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.
  • MetricsVisitor::visit_expr (cyclomatic 18) crates/hir-def/src/metrics.rs:224 — MetricsVisitor::visit_expr has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • MetricsVisitor::count_extras_only (cyclomatic 18) crates/hir-def/src/metrics.rs:279 — MetricsVisitor::count_extras_only has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · GlobalState · ×3
  • GlobalState::process_changes (cognitive 74) crates/bsl-analyzer/src/workspace.rs:289 — GlobalState::process_changes has cognitive complexity 74 (threshold 15). Drivers by points: if/else 30 (53 pts), boolean chains 11, loops 3 (8 pts), match/switch 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalState::vfs_file_for_url (cognitive 21) crates/bsl-analyzer/src/workspace.rs:1241 — GlobalState::vfs_file_for_url has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalState::readmit_open_documents (cognitive 17) crates/bsl-analyzer/src/workspace.rs:875 — GlobalState::readmit_open_documents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · project_model · ×3
  • project_model::search_configuration_recursive (cognitive 35) crates/project-model/src/lib.rs:2055 — project_model::search_configuration_recursive has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 1 (3 pts) (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.
  • project_model::parse_dotenv_value (cognitive 24) crates/project-model/src/lib.rs:1967 — project_model::parse_dotenv_value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • project_model::file_role::file_role (cognitive 16) crates/project-model/src/file_role.rs:39 — project_model::file_role::file_role has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Scope · ×3
  • Scope::resolve_column_type (cognitive 35) crates/sdbl-hir/src/scope.rs:226 — Scope::resolve_column_type has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Scope::resolve_nested_field_type (cognitive 22) crates/sdbl-hir/src/scope.rs:448 — Scope::resolve_nested_field_type has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 5 (7 pts), loops 1 (nesting depth added 11). 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.
  • Scope::find_tables_with_column (cognitive 17) crates/sdbl-hir/src/scope.rs:313 — Scope::find_tables_with_column has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bsl_platform · ×3
  • bsl_platform::db::apply_docs_gap_member_context_overlay (cognitive 25) crates/bsl-platform/src/db.rs:728 — bsl_platform::db::apply_docs_gap_member_context_overlay has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 6, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_platform::overlays::extracted_type_keys (cognitive 18) crates/bsl-platform/src/overlays.rs:373 — bsl_platform::overlays::extracted_type_keys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (5 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • bsl_platform::snapshot::check_kind (cognitive 17) crates/bsl-platform/src/snapshot.rs:368 — bsl_platform::snapshot::check_kind has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, match/switch 1 (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · dataflow · ×3
  • dataflow::effect_summary::analyze_method_effects (cognitive 25) crates/dataflow/src/effect_summary.rs:99 — dataflow::effect_summary::analyze_method_effects has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 3 (9 pts), loops 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.
  • dataflow::definite_init::analyze_definite_init (cognitive 17) crates/dataflow/src/definite_init.rs:143 — dataflow::definite_init::analyze_definite_init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • dataflow::guard_predicates::is_guarded_dfs (cognitive 16) crates/dataflow/src/guard_predicates.rs:124 — dataflow::guard_predicates::is_guarded_dfs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · McpServer · ×3
  • McpServer::graph (cognitive 24) crates/mcp-server/src/lib.rs:2145 — McpServer::graph has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 5 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • McpServer::workspace_search (cognitive 21) crates/mcp-server/src/lib.rs:1567 — McpServer::workspace_search has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • McpServer::reference_search (cognitive 16) crates/mcp-server/src/lib.rs:3164 — McpServer::reference_search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Poller · ×3
  • Poller::walk (cognitive 19) crates/mcp-server/src/change_hub.rs:3871 — Poller::walk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), match/switch 2 (5 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.
  • Poller::verify (cognitive 17) crates/mcp-server/src/change_hub.rs:3978 — Poller::verify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Poller::take (cognitive 16) crates/mcp-server/src/change_hub.rs:3931 — Poller::take has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFunctions · ×3
  • TooManyFunctions: ide_db::metadata crates/ide-db/src/metadata.rs:340 — TooManyFunctions — 63 free functions. The bar is 30 free functions; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: hir_def::body::lower::diagnostics crates/hir-def/src/body/lower/diagnostics.rs:18 — TooManyFunctions — 51 free functions. The bar is 30 free functions; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: ide_db::metadata::heap_estimate crates/ide-db/src/metadata.rs:14 — 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/bsl-platform/src/overlay_schema.rs:118 — crates/bsl-platform/src/overlay_schema.rs:118-136 | crates/bsl-platform/src/overlay_schema.rs:143-163 | crates/bsl-platform/src/overlay_schema.rs:176-192 | crates/bsl-platform/src/overlay_schema.rs:199-232 | crates/bsl-platform/src/overlay_schema.rs:239-270 | crates/bsl-platform/src/overlay_schema.rs:277-307 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) REDACTED:3756 — REDACTED:3756-3808 | REDACTED:4049-4075 | REDACTED:4081-4124 | REDACTED:4130-4171 | REDACTED:4177-4203 | REDACTED:4210-4274 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) REDACTED:1040 — REDACTED:1040-1089 | REDACTED:1989-2058 | REDACTED:2224-2439 | REDACTED:2569-2811 | REDACTED:5220-5296 | REDACTED:5469-5547 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×3
  • Edited copy of a member (24 corresponding lines) crates/bsl-platform/tools/html-parser/src/lib.rs:729 — crates/bsl-platform/tools/html-parser/src/lib.rs:729-752 | crates/bsl-platform/tools/html-parser/src/lib.rs:790-813 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/bsl-metadata/src/metadata_object.rs:853 — crates/bsl-metadata/src/metadata_object.rs:853-876 | crates/bsl-metadata/src/metadata_object.rs:883-906 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/mcp-server/src/tools/search/lexical.rs:223 — crates/mcp-server/src/tools/search/lexical.rs:223-246 | crates/mcp-server/src/tools/search/semantic.rs:340-369 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/ide/src/graph.rs:1932 — crates/ide/src/graph.rs:1932-1944 | crates/ide/src/graph.rs:1954-1968 | crates/ide/src/graph.rs:1978-1992 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/ide/src/graph.rs:1911 — crates/ide/src/graph.rs:1911-1923 | crates/ide/src/graph.rs:2002-2014 | crates/ide/src/graph.rs:2025-2039 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/ide/src/diagnostics_baseline.rs:348 — crates/ide/src/diagnostics_baseline.rs:348-361 | crates/ide/src/partitioned_diagnostics_baseline.rs:1326-1338 | crates/ide/src/partitioned_diagnostics_baseline.rs:1343-1356 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 3+ corresponding lines) crates/ide/src/symbol_info.rs:1526 — crates/ide/src/symbol_info.rs:1526-1528 | crates/symbol-info/src/presenters/hover.rs:101-103 | crates/symbol-info/src/presenters/signature_help.rs:151-153 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) crates/ide-diagnostics/src/handlers/typo.rs:367 — crates/ide-diagnostics/src/handlers/typo.rs:367-371 | crates/ide-diagnostics/src/handlers/unused_parameters/remove_parameter.rs:189-191 | crates/ide/src/convert_method.rs:77-79 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) crates/bsl-analyzer/src/bin/cli/rules.rs:269 — crates/bsl-analyzer/src/bin/cli/rules.rs:269-271 | crates/bsl-analyzer/src/reporters/junit.rs:139-146 | crates/test-fixture/src/cfe.rs:286-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) crates/bsl-analyzer/src/mcp_install/adapters.rs:134 — crates/bsl-analyzer/src/mcp_install/adapters.rs:134-154 | crates/bsl-analyzer/src/mcp_install/adapters.rs:292-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/mcp_install/adapters.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) crates/ide-diagnostics/src/handlers/unused_local_method.rs:79 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:79-99 | crates/ide-diagnostics/src/handlers/unused_local_method.rs:102-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/unused_local_method.rs:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) crates/ide/src/completion/sdbl/use_cases/complete_cast_fields.rs:55 — crates/ide/src/completion/sdbl/use_cases/complete_cast_fields.rs:55-75 | crates/ide/src/completion/sdbl/use_cases/complete_nested_fields.rs:47-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/completion/sdbl/use_cases/complete_cast_fields.rs:55` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) crates/bsl-debug/src/session.rs:559 — crates/bsl-debug/src/session.rs:559-578 | crates/bsl-debug/src/session.rs:586-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-debug/src/session.rs:559` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) crates/hir-ty/src/infer.rs:1509 — crates/hir-ty/src/infer.rs:1509-1528 | crates/ide-diagnostics/src/hir_inference_dispatch.rs:114-133 — 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 (20 lines × 2) crates/mcp-server/src/state/mod.rs:687 — crates/mcp-server/src/state/mod.rs:687-706 | crates/mcp-server/src/state/mod.rs:748-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/mod.rs:687` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×3
  • Duplicated block (15 lines × 3) crates/bsl-analyzer/src/mcp_install/adapters.rs:130 — crates/bsl-analyzer/src/mcp_install/adapters.rs:130-144 | crates/bsl-analyzer/src/mcp_install/adapters.rs:288-302 | crates/bsl-analyzer/src/mcp_install/adapters.rs:358-372 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/mcp_install/adapters.rs:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 3) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:389 — crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:389-403 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:411-425 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:433-447 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:389` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:206 — crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:206-220 | crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs:324-338 | crates/ide-diagnostics/src/handlers/set_permissions_for_new_objects.rs:78-92 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs` and `crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:206` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×3
  • Duplicated block (14 lines × 3) crates/bsl-metadata/src/loader.rs:1544 — crates/bsl-metadata/src/loader.rs:1544-1557 | crates/bsl-metadata/src/loader.rs:1586-1599 | crates/bsl-metadata/src/loader.rs:1628-1641 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:1544` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) crates/mcp-server/src/lib.rs:2867 — crates/mcp-server/src/lib.rs:2867-2880 | crates/mcp-server/src/lib.rs:2956-2969 | crates/mcp-server/src/lib.rs:3053-3066 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/lib.rs:2867` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) crates/bsl-check-executor/src/native_check/source.rs:24 — crates/bsl-check-executor/src/native_check/source.rs:24-37 | crates/bsl-check-executor/src/native_check/source.rs:69-82 | crates/bsl-check-executor/src/native_check/source.rs:122-135 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/source.rs:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×3
  • Duplicated block (13–14 lines × 2) crates/bsl-check-executor/src/native_check/windows_acl.rs:57 — crates/bsl-check-executor/src/native_check/windows_acl.rs:57-69 | crates/mcp-server/src/cache_windows.rs:73-86 — before extracting anything, compare `crates/bsl-check-executor/src/native_check/windows_acl.rs` and `crates/mcp-server/src/cache_windows.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13–14 lines × 2) crates/ide-db/src/salsa_events.rs:168 — crates/ide-db/src/salsa_events.rs:168-181 | crates/ide-db/src/salsa_events.rs:227-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide-db/src/salsa_events.rs:239` calls `sort_by_key`, `Reverse`, `truncate` and `crates/ide-db/src/salsa_events.rs:181` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13–14 lines × 2) REDACTED:3851 — REDACTED:3851-3864 | REDACTED:5079-5091 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3851` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:326 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:326-336 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:589-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) REDACTED:2885 — REDACTED:2885-2895 | REDACTED:2995-3004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2885` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10–11 lines × 2) crates/ide-host-core/src/workspace.rs:809 — crates/ide-host-core/src/workspace.rs:809-818 | crates/mcp-server/src/diagnostics_state/lifecycle.rs:1664-1674 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:168 — crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:168-177 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:62-71 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:81-90 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs` and `crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/ide-db/src/metadata.rs:1586 — crates/ide-db/src/metadata.rs:1586-1595 | crates/ide-db/src/metadata.rs:1676-1685 | crates/ide-db/src/metadata.rs:1766-1775 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/bsl-check-executor/src/native_check/source.rs:53 — crates/bsl-check-executor/src/native_check/source.rs:53-62 | crates/bsl-check-executor/src/native_check/source.rs:97-106 | crates/bsl-check-executor/src/native_check/source.rs:583-592 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/source.rs:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-check-executor/src/native_check/source.rs:594` calls `Err` and `crates/bsl-check-executor/src/native_check/source.rs:63` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×3
  • Duplicated block (6–8 lines × 2) crates/bsl-analyzer/src/handlers/request.rs:1566 — crates/bsl-analyzer/src/handlers/request.rs:1566-1573 | crates/bsl-analyzer/src/handlers/request.rs:1945-1950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/handlers/request.rs:1566` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6–8 lines × 2) crates/hir-def/src/graph_index.rs:2009 — crates/hir-def/src/graph_index.rs:2009-2014 | crates/hir-def/src/queries.rs:900-907 — before extracting anything, compare `crates/hir-def/src/graph_index.rs` and `crates/hir-def/src/queries.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:2009` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6–8 lines × 2) crates/ide-db/src/queries.rs:169 — crates/ide-db/src/queries.rs:169-176 | crates/ide-db/src/queries.rs:197-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×3
  • Duplicated block (6–7 lines × 2) crates/bsl-analyzer/src/mcp_install/adapters.rs:406 — crates/bsl-analyzer/src/mcp_install/adapters.rs:406-412 | crates/bsl-analyzer/src/mcp_install/adapters.rs:716-721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/mcp_install/adapters.rs:406` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6–7 lines × 2) REDACTED:3818 — REDACTED:3818-3824 | REDACTED:5100-5105 — both copies are in the same file, so extract the 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–7 lines × 2) crates/mcp-server/src/lib.rs:1572 — crates/mcp-server/src/lib.rs:1572-1578 | crates/mcp-server/src/lib.rs:3169-3174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `Parameters<WorkspaceSearchParams>` in one and `Parameters<ReferenceSearchParams>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×3
  • Duplicated block (5 lines × 4) crates/hir-def/src/body/lower/diagnostics.rs:610 — crates/hir-def/src/body/lower/diagnostics.rs:610-614 | crates/hir-def/src/body/lower/diagnostics.rs:616-620 | crates/ide-diagnostics/src/handlers/double_negatives.rs:121-125 | crates/ide-diagnostics/src/handlers/double_negatives.rs:127-131 — 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 (5 lines × 4) crates/bsl-metadata/src/xml_parser/common_module.rs:14 — crates/bsl-metadata/src/xml_parser/common_module.rs:14-18 | crates/bsl-metadata/src/xml_parser/register.rs:36-41 | crates/bsl-metadata/src/xml_parser/role.rs:12-16 | crates/bsl-metadata/src/xml_parser/scheduled_job.rs:9-13 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (5 lines × 4) crates/bsl-metadata/src/xml_parser/http_service.rs:28 — crates/bsl-metadata/src/xml_parser/http_service.rs:28-32 | crates/bsl-metadata/src/xml_parser/http_service.rs:43-47 | crates/bsl-metadata/src/xml_parser/web_service.rs:27-31 | crates/bsl-metadata/src/xml_parser/web_service.rs:42-46 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/xml_parser/http_service.rs:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience crates/bsl-launcher/src/http.rs:12 — `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/bsl-launcher/src/http.rs:19 — `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience scripts/user2/prepare-qwen-vulkan.py:45 — `urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
X12 · Unreachable branch · Statement is unreachable · ×3
  • Statement is unreachable — control never gets past the statement before it crates/hir-def/src/catch_class.rs:36 — `if has_raise || has_log { CatchBodyClass::Mixed } else if has_rollback { Catc…` follows `{ return pure; }` (line 32) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
  • Statement is unreachable — control never gets past the statement before it crates/bsl-check-executor/src/native_check/profile.rs:3569 — `let cwd = fs::canonicalize(entry.path().join("cwd")).map_err(| _ | NativeProf…` follows `{ return Err(NativeProfileError::CleanupFailed); }` (line 3566) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
  • Statement is unreachable — control never gets past the statement before it crates/bsl-check-executor/src/native_check/profile.rs:3604 — `let cwd = match fs::canonicalize(format !("/proc/{pid}/cwd")) { Ok(cwd) => cw…` follows `{ return Err(NativeProfileError::CleanupFailed); }` (line 3601) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
D1 · Cyclomatic Complexity · bsl_types · ×2
  • bsl_types::display::render (cyclomatic 76) crates/bsl-types/src/display.rs:107 — bsl_types::display::render has cyclomatic complexity 76 (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.
  • bsl_types::intern::write_type_order_key (cyclomatic 21) crates/bsl-types/src/intern.rs:271 — bsl_types::intern::write_type_order_key has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SdblType · ×2
  • SdblType::display_name (cyclomatic 41) crates/sdbl-hir/src/types.rs:195 — SdblType::display_name has cyclomatic complexity 41 (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.
  • SdblType::fmt (cyclomatic 23) crates/sdbl-hir/src/types.rs:305 — SdblType::fmt has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Project · ×2
  • Project::diagnostics_baseline_partition_plan (cyclomatic 30) crates/project-model/src/lib.rs:822 — Project::diagnostics_baseline_partition_plan has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Project::diagnostics_baseline (cyclomatic 16) crates/project-model/src/lib.rs:691 — Project::diagnostics_baseline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeProfile · ×2
  • NativeProfile::validate (cyclomatic 28) crates/bsl-check-executor/src/native_check/profile.rs:75 — NativeProfile::validate 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.
  • NativeProfile::run_scoped (cyclomatic 25) crates/bsl-check-executor/src/native_check/profile.rs:320 — NativeProfile::run_scoped has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · McpServer · ×2
  • McpServer::graph (cyclomatic 28) crates/mcp-server/src/lib.rs:2145 — McpServer::graph has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • McpServer::metadata (cyclomatic 17) crates/mcp-server/src/lib.rs:1366 — McpServer::metadata has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · GraphDb · ×2
  • GraphDb::neighbors (cyclomatic 27) crates/mcp-server/src/graph_query.rs:1316 — GraphDb::neighbors 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.
  • GraphDb::resolve_stored (cyclomatic 17) crates/mcp-server/src/graph_query.rs:586 — GraphDb::resolve_stored has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Owner · ×2
  • Owner::run (cyclomatic 25) crates/mcp-server/src/state/overlay_backlog.rs:299 — Owner::run 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.
  • Owner::round (cyclomatic 17) crates/mcp-server/src/state/overlay_backlog.rs:487 — Owner::round has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Store · ×2
  • Store::reindex_file_in_collection_checkpointed_with_reuse (cyclomatic 24) REDACTED:2555 — Store::reindex_file_in_collection_checkpointed_with_reuse 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.
  • Store::apply_workspace_roots_transition (cyclomatic 22) REDACTED:2220 — Store::apply_workspace_roots_transition has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bsl_search · ×2
  • bsl_search::publish::validate_source_span_layout (cyclomatic 20) crates/bsl-search/src/publish.rs:366 — bsl_search::publish::validate_source_span_layout 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.
  • bsl_search::hybrid::fuse_smart (cyclomatic 16) crates/bsl-search/src/hybrid.rs:128 — bsl_search::hybrid::fuse_smart has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OverlayRetry · ×2
  • OverlayRetry::run (cyclomatic 20) crates/mcp-server/src/state/overlay_retry.rs:305 — OverlayRetry::run 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.
  • OverlayRetry::run_pass (cyclomatic 16) crates/mcp-server/src/state/overlay_retry.rs:452 — OverlayRetry::run_pass has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Configuration · ×2
  • Configuration::merge_extension_overlay (cyclomatic 19) crates/bsl-metadata/src/configuration.rs:396 — Configuration::merge_extension_overlay 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.
  • Configuration::build_caches (cyclomatic 17) crates/bsl-metadata/src/configuration.rs:226 — Configuration::build_caches has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · SourceSetArgs · ×2
  • SourceSetArgs::resolve_extensions (cyclomatic 17) crates/bsl-analyzer/src/bin/cli/source_set.rs:396 — SourceSetArgs::resolve_extensions 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.
  • SourceSetArgs::resolve_externals (cyclomatic 16) crates/bsl-analyzer/src/bin/cli/source_set.rs:254 — SourceSetArgs::resolve_externals has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bsl_platform · ×2
  • bsl_platform::db::apply_docs_gap_member_context_overlay (cyclomatic 17) crates/bsl-platform/src/db.rs:728 — bsl_platform::db::apply_docs_gap_member_context_overlay 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.
  • bsl_platform::snapshot::check_kind (cyclomatic 17) crates/bsl-platform/src/snapshot.rs:368 — bsl_platform::snapshot::check_kind 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.
D17 · Explicit Debt · FixmeComment · ×2
  • FixmeComment crates/ide-diagnostics/src/handlers/using_service_tag.rs:221 — // FIXME: Добавиить новое значение в структуру — 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.
  • FixmeComment crates/ide-diagnostics/src/handlers/using_service_tag.rs:407 — // FIXME: Добавиить новое значение в структуру — 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.
D2 · Cognitive Complexity · NaparnikHttpClient · ×2
  • NaparnikHttpClient::read_chat_sse (cognitive 64) crates/naparnik/src/http_client.rs:207 — NaparnikHttpClient::read_chat_sse has cognitive complexity 64 (threshold 15). Drivers by points: if/else 10 (56 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 50). 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.
  • NaparnikHttpClient::read_sse_completion (cognitive 24) crates/naparnik/src/http_client.rs:110 — NaparnikHttpClient::read_sse_completion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (17 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InsertionTracker · ×2
  • InsertionTracker::hash_expr_into (cognitive 51) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:241 — InsertionTracker::hash_expr_into has cognitive complexity 51 (threshold 15). Drivers by points: loops 14 (39 pts), if/else 6 (9 pts), match/switch 2 (3 pts) (nesting depth added 29). 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.
  • InsertionTracker::report_duplicates (cognitive 19) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:497 — InsertionTracker::report_duplicates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataflowSolver · ×2
  • DataflowSolver::solve_backward (cognitive 46) crates/dataflow/src/lib.rs:257 — DataflowSolver::solve_backward has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 4 (11 pts), match/switch 1 (5 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DataflowSolver::solve_forward (cognitive 35) crates/dataflow/src/lib.rs:165 — DataflowSolver::solve_forward has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (7 pts), match/switch 1 (5 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bsl_types · ×2
  • bsl_types::display::render (cognitive 36) crates/bsl-types/src/display.rs:107 — bsl_types::display::render has cognitive complexity 36 (threshold 15). Drivers by points: match/switch 28 (30 pts), if/else 3 (6 pts) (nesting depth added 5). 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.
  • bsl_types::intern::write_type_order_key (cognitive 16) crates/bsl-types/src/intern.rs:271 — bsl_types::intern::write_type_order_key has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), match/switch 4 (7 pts), if/else 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Owner · ×2
  • Owner::run (cognitive 36) crates/mcp-server/src/state/overlay_backlog.rs:299 — Owner::run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 3 (8 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Owner::round (cognitive 18) crates/mcp-server/src/state/overlay_backlog.rs:487 — Owner::round has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 5 (9 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeProfile · ×2
  • NativeProfile::run_scoped (cognitive 33) crates/bsl-check-executor/src/native_check/profile.rs:320 — NativeProfile::run_scoped has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 10 (13 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NativeProfile::validate (cognitive 32) crates/bsl-check-executor/src/native_check/profile.rs:75 — NativeProfile::validate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 8, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SourceSetArgs · ×2
  • SourceSetArgs::resolve_extensions (cognitive 32) crates/bsl-analyzer/src/bin/cli/source_set.rs:396 — SourceSetArgs::resolve_extensions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 4 (5 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.
  • SourceSetArgs::resolve_externals (cognitive 25) crates/bsl-analyzer/src/bin/cli/source_set.rs:254 — SourceSetArgs::resolve_externals has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Configuration · ×2
  • Configuration::merge_extension_overlay (cognitive 32) crates/bsl-metadata/src/configuration.rs:396 — Configuration::merge_extension_overlay has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 5, boolean chains 3, match/switch 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.
  • Configuration::build_caches (cognitive 19) crates/bsl-metadata/src/configuration.rs:226 — Configuration::build_caches has cognitive complexity 19 (threshold 15). Drivers by points: loops 13, if/else 3 (6 pts) (nesting depth added 3). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PostgresBaselineAdapter · ×2
  • PostgresBaselineAdapter::populate_serving_semantic_with_progress (cognitive 28) REDACTED:1807 — PostgresBaselineAdapter::populate_serving_semantic_with_progress has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 6 (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.
  • PostgresBaselineAdapter::load_snapshot_documents (cognitive 16) REDACTED:2219 — PostgresBaselineAdapter::load_snapshot_documents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CfgBuilder · ×2
  • CfgBuilder::walk_if_statement_hir (cognitive 24) crates/cfg/src/builder.rs:317 — CfgBuilder::walk_if_statement_hir has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CfgBuilder::walk_preproc_if_statement_hir (cognitive 16) crates/cfg/src/builder.rs:393 — CfgBuilder::walk_preproc_if_statement_hir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebugSession · ×2
  • DebugSession::handle_event (cognitive 23) crates/bsl-debug/src/session.rs:1147 — DebugSession::handle_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • DebugSession::wait_for_stop (cognitive 16) crates/bsl-debug/src/session.rs:662 — DebugSession::wait_for_stop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetricsVisitor · ×2
  • MetricsVisitor::visit_stmt (cognitive 23) crates/hir-def/src/metrics.rs:92 — MetricsVisitor::visit_stmt has cognitive complexity 23 (threshold 15). Drivers by points: loops 9 (20 pts), if/else 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • MetricsVisitor::visit_expr (cognitive 16) crates/hir-def/src/metrics.rs:224 — MetricsVisitor::visit_expr has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (7 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FileSymbolCtx · ×2
  • FileSymbolCtx::body_for (cognitive 18) crates/hir/src/semantic_symbol.rs:766 — FileSymbolCtx::body_for has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • FileSymbolCtx::resolve_name_to_definition (cognitive 16) crates/hir/src/semantic_symbol.rs:375 — FileSymbolCtx::resolve_name_to_definition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BodyScan · ×2
  • BodyScan::stmt (cognitive 18) crates/ide-diagnostics/src/handlers/transferring_parameters_between_client_and_server.rs:425 — BodyScan::stmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (5 pts), 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.
  • BodyScan::bare_call (cognitive 17) crates/ide-diagnostics/src/handlers/transferring_parameters_between_client_and_server.rs:645 — BodyScan::bare_call has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SdblPackage · ×2
  • SdblPackage::collect_diagnostics_recursive (cognitive 18) crates/sdbl-hir/src/hir.rs:1301 — SdblPackage::collect_diagnostics_recursive has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 5 (6 pts) (nesting depth added 5). 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.
  • SdblPackage::collect_expr_diagnostics (cognitive 18) crates/sdbl-hir/src/hir.rs:1351 — SdblPackage::collect_expr_diagnostics has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · stdx · ×2
  • stdx::fs::parallel_read_transform (cognitive 18) crates/stdx/src/fs.rs:201 — stdx::fs::parallel_read_transform has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (stdx::fs::parallel_read_transform_with_progress) 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.
  • stdx::fs::parallel_read_transform_with_progress (cognitive 18) crates/stdx/src/fs.rs:256 — stdx::fs::parallel_read_transform_with_progress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (stdx::fs::parallel_read_transform) 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.
D2 · Cognitive Complexity · Watcher · ×2
  • Watcher::is_project_input (cognitive 17) crates/mcp-server/src/graph/watcher.rs:365 — Watcher::is_project_input has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Watcher::watch (cognitive 16) crates/mcp-server/src/graph/watcher.rs:209 — Watcher::watch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Resolver · ×2
  • Resolver::global_common_module_exports (cognitive 16) crates/hir-def/src/resolver.rs:352 — Resolver::global_common_module_exports has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Resolver::application_module_exports (cognitive 16) crates/hir-def/src/resolver.rs:413 — Resolver::application_module_exports has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Near-duplicate member pair (33 shared lines) · ×2
  • Near-duplicate member pair (33 shared lines) crates/bsl-search/src/engine.rs:573 — crates/bsl-search/src/engine.rs:573-645 | crates/bsl-search/src/engine.rs:1143-1191 — These two members are variants of one another: 33 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 (33 shared lines) crates/bsl-platform/tools/html-parser/src/lib.rs:627 — crates/bsl-platform/tools/html-parser/src/lib.rs:627-695 | crates/bsl-platform/tools/html-parser/src/lib.rs:981-1052 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) crates/parser/src/grammar.rs:97 — crates/parser/src/grammar.rs:97-142 | crates/parser/src/grammar.rs:348-388 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) crates/sdbl-hir/src/hir.rs:65 — crates/sdbl-hir/src/hir.rs:65-104 | crates/sdbl-hir/src/hir.rs:264-300 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×2
  • Edited copy of a member (32 corresponding lines) crates/hir-def/src/module_interface.rs:378 — crates/hir-def/src/module_interface.rs:378-409 | crates/hir-def/src/symbol_tree.rs:247-282 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/ide/src/symbol_info.rs:609 — crates/ide/src/symbol_info.rs:609-657 | crates/ide/src/symbol_info.rs:664-695 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×2
  • Edited copy of a member (54 corresponding lines) crates/mcp-server/src/tools/search/lexical.rs:257 — crates/mcp-server/src/tools/search/lexical.rs:257-310 | crates/mcp-server/src/tools/search/semantic.rs:380-433 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) crates/ide/src/completion/sdbl/use_cases/complete_cast_fields.rs:17 — crates/ide/src/completion/sdbl/use_cases/complete_cast_fields.rs:17-75 | crates/ide/src/completion/sdbl/use_cases/complete_nested_fields.rs:14-67 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) crates/hir-def/src/graph_index.rs:1146 — crates/hir-def/src/graph_index.rs:1146-1174 | crates/mcp-server/src/graph/byte_budget.rs:28-50 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:150 — crates/ide-diagnostics/src/handlers/forbidden_metadata_name.rs:150-172 | crates/ide-diagnostics/src/handlers/metadata_object_name_length.rs:24-51 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) crates/bsl-search/src/merge.rs:97 — crates/bsl-search/src/merge.rs:97-130 | crates/bsl-search/src/merge.rs:137-170 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) crates/bsl-debug/src/module_index.rs:344 — crates/bsl-debug/src/module_index.rs:344-377 | crates/bsl-debug/src/module_index.rs:446-479 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×2
  • Edited copy of a member (30 corresponding lines) crates/hir-ty/src/field_lookup.rs:50 — crates/hir-ty/src/field_lookup.rs:50-79 | crates/hir-ty/src/field_lookup.rs:89-121 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) crates/ide-db/src/effects.rs:277 — crates/ide-db/src/effects.rs:277-306 | crates/ide-db/src/queries.rs:677-711 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×2
  • Edited copy of a member (53 corresponding lines) crates/hir-def/src/body/lower/expr.rs:1777 — crates/hir-def/src/body/lower/expr.rs:1777-1829 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:261-313 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:58 — crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:58-110 | crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs:64-121 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) crates/bsl-analyzer/src/bin/cli/source_set.rs:344 — crates/bsl-analyzer/src/bin/cli/source_set.rs:344-371 | crates/bsl-analyzer/src/bin/cli/source_set.rs:492-520 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/ide-diagnostics/src/runner.rs:161 — crates/ide-diagnostics/src/runner.rs:161-188 | crates/ide-diagnostics/src/runner.rs:301-335 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 28+ corresponding lines) crates/mcp-server/src/tools/search/render.rs:661 — crates/mcp-server/src/tools/search/render.rs:661-688 | crates/mcp-server/src/tools/search/render.rs:697-733 | crates/mcp-server/src/tools/search/render.rs:738-772 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 28+ corresponding lines) crates/ide-diagnostics/src/handlers/cognitive_complexity.rs:20 — crates/ide-diagnostics/src/handlers/cognitive_complexity.rs:20-53 | crates/ide-diagnostics/src/handlers/cyclomatic_complexity.rs:20-51 | crates/ide-diagnostics/src/handlers/method_size.rs:23-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) crates/bsl-check-executor/src/native_check/compiler.rs:1054 — crates/bsl-check-executor/src/native_check/compiler.rs:1054-1073 | crates/bsl-check-executor/src/native_check/profile.rs:3388-3408 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/hir-ty/src/infer.rs:1714 — crates/hir-ty/src/infer.rs:1714-1733 | crates/hir-ty/src/infer.rs:1743-1764 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 9+ corresponding lines) crates/bsl-metadata/src/loader.rs:962 — crates/bsl-metadata/src/loader.rs:962-972 | crates/bsl-metadata/src/loader.rs:980-988 | crates/bsl-metadata/src/loader.rs:996-1004 | crates/bsl-metadata/src/loader.rs:1184-1192 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 9+ corresponding lines) crates/ide-db/src/metadata.rs:1522 — crates/ide-db/src/metadata.rs:1522-1530 | crates/ide-db/src/metadata.rs:1618-1626 | crates/ide-db/src/metadata.rs:1708-1716 | crates/ide-db/src/metadata.rs:1798-1806 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/hir-def/src/docs.rs:836 — crates/hir-def/src/docs.rs:836-847 | crates/hir-def/src/ty/doc_types.rs:292-298 | crates/hir-ty/src/lower/type_string.rs:160-167 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/dataflow/src/lib.rs:29 — crates/dataflow/src/lib.rs:29-35 | crates/ide-db/src/queries.rs:32-38 | crates/stdx/src/heap.rs:18-27 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) crates/bsl-debug/src/module_index.rs:578 — crates/bsl-debug/src/module_index.rs:578-580 | crates/hir-ty/src/map_keys.rs:460-462 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) crates/mcp-server/src/diagnostics_state/drift.rs:26 — crates/mcp-server/src/diagnostics_state/drift.rs:26-30 | crates/mcp-server/src/diagnostics_state/lifecycle.rs:83-85 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×2
  • Duplicated block (35 lines × 2) crates/hir-def/src/body/lower/expr.rs:1795 — crates/hir-def/src/body/lower/expr.rs:1795-1829 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:279-313 — before extracting anything, compare `crates/hir-def/src/body/lower/expr.rs` and `crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/expr.rs:1795` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (35 lines × 2) crates/hir-def/src/body/lower/expr.rs:1740 — crates/hir-def/src/body/lower/expr.rs:1740-1774 | crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:220-254 — before extracting anything, compare `crates/hir-def/src/body/lower/expr.rs` and `crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs:256` calls `is_valid_placeholder`, `contains` and `crates/hir-def/src/body/lower/expr.rs:1777` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) REDACTED:1916 — REDACTED:1916-1946 | REDACTED:1948-1978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (31 lines × 2) crates/mcp-server/src/lib.rs:1746 — crates/mcp-server/src/lib.rs:1746-1776 | crates/mcp-server/src/lib.rs:3237-3267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/lib.rs:1746` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/mcp-server/src/lib.rs:1744` calls `unwrap_or`, `min` and `crates/mcp-server/src/lib.rs:3236` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) crates/bsl-analyzer/src/server.rs:2283 — crates/bsl-analyzer/src/server.rs:2283-2311 | crates/bsl-analyzer/src/smoke.rs:477-505 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/server.rs:2283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) crates/mcp-server/src/diagnostics_state/drift.rs:932 — crates/mcp-server/src/diagnostics_state/drift.rs:932-960 | crates/mcp-server/src/diagnostics_state/drift.rs:1049-1077 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/diagnostics_state/drift.rs:932` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) crates/ide/src/completion/mdo_completion.rs:158 — crates/ide/src/completion/mdo_completion.rs:158-184 | crates/ide/src/completion/mdo_completion.rs:204-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/completion/mdo_completion.rs:158` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) crates/mcp-server/src/tools/search/lexical.rs:284 — crates/mcp-server/src/tools/search/lexical.rs:284-310 | crates/mcp-server/src/tools/search/semantic.rs:407-433 — before extracting anything, compare `crates/mcp-server/src/tools/search/lexical.rs` and `crates/mcp-server/src/tools/search/semantic.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/tools/search/lexical.rs:284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) crates/bsl-analyzer/src/mcp_install/adapters.rs:223 — crates/bsl-analyzer/src/mcp_install/adapters.rs:223-247 | crates/bsl-analyzer/src/mcp_install/adapters.rs:455-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/mcp_install/adapters.rs:223` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (25 lines × 2) crates/mcp-server/src/lib.rs:1715 — crates/mcp-server/src/lib.rs:1715-1739 | crates/mcp-server/src/lib.rs:3206-3230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/mcp-server/src/lib.rs:1714` calls `ensure_reference_loading` and `crates/mcp-server/src/lib.rs:3205` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:1884 — crates/bsl-check-executor/src/native_check/profile.rs:1884-1905 | crates/bsl-check-executor/src/native_check/profile.rs:1931-1952 — both copies are in the same file, so extract the 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/ide/src/completion/bsl_completion.rs:950 — crates/ide/src/completion/bsl_completion.rs:950-971 | crates/ide/src/hover.rs:816-837 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×2
  • Duplicated block (20–21 lines × 2) crates/sdbl-hir/src/lower/expr/mod.rs:378 — crates/sdbl-hir/src/lower/expr/mod.rs:378-398 | crates/sdbl-hir/src/lower/expr/mod.rs:666-685 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/lower/expr/mod.rs:666` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (20–21 lines × 2) crates/bsl-platform/src/db.rs:251 — crates/bsl-platform/src/db.rs:251-271 | crates/bsl-platform/src/db.rs:317-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/src/db.rs:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) crates/ide-db/src/database.rs:1329 — crates/ide-db/src/database.rs:1329-1345 | crates/ide-db/src/database.rs:1391-1408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-db/src/database.rs:1329` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) crates/mcp-server/src/state/bootstrap.rs:2073 — crates/mcp-server/src/state/bootstrap.rs:2073-2089 | crates/mcp-server/src/state/bootstrap.rs:2130-2147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/bootstrap.rs:2073` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×2
  • Duplicated block (17 lines × 3) crates/bsl-analyzer/src/smoke.rs:587 — crates/bsl-analyzer/src/smoke.rs:587-603 | crates/bsl-analyzer/src/smoke.rs:715-731 | crates/bsl-analyzer/src/smoke.rs:772-788 — 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 (17 lines × 3) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:716 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:716-732 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:735-751 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:754-770 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) crates/ide-diagnostics/src/handlers/unused_local_method.rs:202 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:202-218 | crates/ide-diagnostics/src/handlers/unused_parameters.rs:131-146 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/unused_local_method.rs` and `crates/ide-diagnostics/src/handlers/unused_parameters.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/unused_local_method.rs:202` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) REDACTED:1568 — REDACTED:1568-1584 | REDACTED:1614-1629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) crates/bsl-analyzer/src/bench/runner.rs:1431 — crates/bsl-analyzer/src/bench/runner.rs:1431-1445 | crates/bsl-analyzer/src/handlers/dispatch.rs:468-483 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/bench/runner.rs:1431` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) crates/sdbl-hir/src/lower/expr/predicates.rs:104 — crates/sdbl-hir/src/lower/expr/predicates.rs:104-119 | crates/sdbl-hir/src/lower/expr/predicates.rs:174-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/lower/expr/predicates.rs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn lower_in_expr(&mut` in one and `super) fn lower_in_hierarchy_expr(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×2
  • Duplicated block (13–16 lines × 2) crates/hir-def/src/graph_index.rs:245 — crates/hir-def/src/graph_index.rs:245-260 | crates/hir-def/src/graph_index.rs:283-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:245` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–16 lines × 2) crates/parser/src/grammar/sdbl/expressions.rs:104 — crates/parser/src/grammar/sdbl/expressions.rs:104-116 | crates/parser/src/grammar/sdbl/select.rs:32-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/parser/src/grammar/sdbl/expressions.rs:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:2522 — crates/bsl-check-executor/src/native_check/profile.rs:2522-2535 | crates/bsl-check-executor/src/native_check/profile.rs:2610-2624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-check-executor/src/native_check/profile.rs:2522` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) REDACTED:4572 — REDACTED:4572-4586 | REDACTED:4684-4697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×2
  • Duplicated block (13 lines × 4) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:683 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:683-695 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:700-712 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:790-802 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:808-820 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:683` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:680` calls `iter` and `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:786` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 4) crates/ide/src/graph.rs:2097 — crates/ide/src/graph.rs:2097-2109 | crates/ide/src/graph.rs:2118-2130 | crates/ide/src/graph.rs:2139-2151 | crates/ide/src/graph.rs:2160-2172 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/graph.rs:2097` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) REDACTED:1928 — REDACTED:1928-1940 | REDACTED:1960-1972 | REDACTED:1997-2009 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1928` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) crates/ide-host-core/src/metadata.rs:285 — crates/ide-host-core/src/metadata.rs:285-297 | crates/ide-host-core/src/metadata.rs:302-314 | crates/ide-host-core/src/metadata.rs:319-331 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • Duplicated block (12 lines × 4) crates/bsl-metadata/src/loader.rs:1543 — crates/bsl-metadata/src/loader.rs:1543-1554 | crates/bsl-metadata/src/loader.rs:1585-1596 | crates/bsl-metadata/src/loader.rs:1627-1638 | crates/bsl-metadata/src/loader.rs:1658-1669 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:1543` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 4) crates/hir-def/src/conditional_tree.rs:95 — crates/hir-def/src/conditional_tree.rs:95-106 | crates/hir-def/src/conditional_tree.rs:113-124 | crates/hir-def/src/region_tree.rs:87-98 | crates/hir-def/src/region_tree.rs:105-116 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/conditional_tree.rs:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) crates/hir-def/src/metrics.rs:177 — crates/hir-def/src/metrics.rs:177-187 | crates/hir-def/src/metrics.rs:211-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/metrics.rs:177` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:299 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:299-310 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:314-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) crates/hir-def/src/queries.rs:489 — crates/hir-def/src/queries.rs:489-497 | crates/hir-def/src/queries.rs:514-524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/queries.rs:489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–11 lines × 2) crates/ide/src/graph.rs:1230 — crates/ide/src/graph.rs:1230-1238 | crates/ide/src/graph.rs:1539-1549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) crates/stdx/src/fs.rs:113 — crates/stdx/src/fs.rs:113-122 | crates/stdx/src/fs.rs:158-167 | crates/stdx/src/fs.rs:210-219 | crates/stdx/src/fs.rs:267-276 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/stdx/src/fs.rs:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:41 — crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:41-51 | crates/ide-diagnostics/src/handlers/ordinary_app_support.rs:72-82 | crates/ide-diagnostics/src/handlers/protected_module.rs:63-72 | crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs:46-56 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs` and `crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) crates/bsl-analyzer/src/handlers/request.rs:1598 — crates/bsl-analyzer/src/handlers/request.rs:1598-1606 | crates/bsl-analyzer/src/handlers/request.rs:1962-1971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/handlers/request.rs:1598` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) crates/parser/src/lib.rs:70 — crates/parser/src/lib.rs:70-79 | crates/parser/src/lib.rs:87-95 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:123 — crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:123-131 | crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:176-184 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:70-78 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:89-97 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs` and `crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) crates/ide-diagnostics/src/handlers/magic_date.rs:283 — crates/ide-diagnostics/src/handlers/magic_date.rs:283-294 | crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:208-216 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:121-129 | crates/ide-diagnostics/src/handlers/unknown_preprocessor_symbol.rs:36-44 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs` and `crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/magic_date.rs:283` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/ide-diagnostics/src/handlers/unknown_preprocessor_symbol.rs:34` calls `text`, `to_string`, `is_known` and `crates/ide-diagnostics/src/handlers/magic_date.rs:281` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×2
  • Duplicated block (8–9 lines × 3) crates/bsl-analyzer/src/server.rs:576 — crates/bsl-analyzer/src/server.rs:576-583 | crates/ide-host-core/src/workspace.rs:814-821 | crates/mcp-server/src/diagnostics_state/lifecycle.rs:1669-1677 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/server.rs:576` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/ide-host-core/src/workspace.rs:812` calls `Some`, `var_os`, `create_dir_all` and `crates/bsl-analyzer/src/server.rs:575` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 3) crates/sdbl-hir/src/lower/expr/predicates.rs:102 — crates/sdbl-hir/src/lower/expr/predicates.rs:102-110 | crates/sdbl-hir/src/lower/expr/predicates.rs:172-179 | crates/sdbl-hir/src/lower/expr/predicates.rs:264-272 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/lower/expr/predicates.rs:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn lower_in_expr(&mut` in one and `super) fn lower_in_hierarchy_expr(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) crates/ide/src/symbol_info.rs:1595 — crates/ide/src/symbol_info.rs:1595-1601 | crates/symbol-info/src/adapters/common_module.rs:22-29 — 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–8 lines × 2) crates/parser/src/grammar/items.rs:58 — crates/parser/src/grammar/items.rs:58-65 | crates/parser/src/grammar/sdbl/expressions.rs:9-15 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/parser/src/grammar/items.rs:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×2
  • Duplicated block (6 lines × 5) crates/bsl-metadata/src/loader.rs:1091 — crates/bsl-metadata/src/loader.rs:1091-1097 | crates/bsl-metadata/src/loader.rs:1110-1115 | crates/bsl-metadata/src/loader.rs:1128-1133 | crates/bsl-metadata/src/loader.rs:1146-1151 | crates/bsl-metadata/src/loader.rs:1280-1285 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:1091` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:110 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:110-115 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:489-494 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:555-560 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:642-647 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:1511-1516 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (3–5 lines × 4) · ×2
  • Duplicated block (3–5 lines × 4) crates/hir-ty/src/infer.rs:6701 — crates/hir-ty/src/infer.rs:6701-6705 | crates/hir-ty/src/infer.rs:6716-6718 | crates/hir-ty/src/infer.rs:6826-6830 | crates/hir-ty/src/infer.rs:6976-6980 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/infer.rs:6701` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/hir-ty/src/infer.rs:6706` calls `insert`, `clone` and `crates/hir-ty/src/infer.rs:6719` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (3–5 lines × 4) crates/ide/src/graph.rs:3088 — crates/ide/src/graph.rs:3088-3092 | crates/ide/src/graph.rs:3104-3108 | crates/ide/src/graph.rs:3109-3111 | crates/ide/src/graph.rs:3121-3126 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide/src/graph.rs:3108` calls `next`, `ok_or_else` and `crates/ide/src/graph.rs:3092` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D1 · Cyclomatic Complexity · GlobalState · ×1
  • GlobalState::process_changes (cyclomatic 42) crates/bsl-analyzer/src/workspace.rs:289 — GlobalState::process_changes has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlatformDataInner · ×1
  • PlatformDataInner::from_help (cyclomatic 36) crates/bsl-platform/src/db.rs:145 — PlatformDataInner::from_help 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.
D1 · Cyclomatic Complexity · DiagnosticsResident · ×1
  • DiagnosticsResident::workspace_aggregates (cyclomatic 35) crates/mcp-server/src/diagnostics_state/resident.rs:805 — DiagnosticsResident::workspace_aggregates has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InsertionTracker · ×1
  • InsertionTracker::hash_expr_into (cyclomatic 32) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:241 — InsertionTracker::hash_expr_into has cyclomatic complexity 32 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · runtime_acceptance.main (cyclomatic 31) · ×1
  • runtime_acceptance.main (cyclomatic 31) scripts/user2/runtime_acceptance.py:347 — runtime_acceptance.main has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime_lifecycle.main (cyclomatic 30) · ×1
  • runtime_lifecycle.main (cyclomatic 30) scripts/user2/runtime_lifecycle.py:358 — runtime_lifecycle.main has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · html_parser · ×1
  • html_parser::scraper_parser::extract_examples (cyclomatic 29) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:629 — html_parser::scraper_parser::extract_examples has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkspaceLease · ×1
  • WorkspaceLease::publish_checkpointed_inner (cyclomatic 29) crates/mcp-server/src/workspace_lease.rs:896 — WorkspaceLease::publish_checkpointed_inner 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.
D1 · Cyclomatic Complexity · CommonAttributeSet · ×1
  • CommonAttributeSet::project_extension_object (cyclomatic 28) crates/bsl-metadata/src/common_attribute.rs:293 — CommonAttributeSet::project_extension_object has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · SlabLayout · ×1
  • SlabLayout::compute_with (cyclomatic 27) crates/hir-def/src/method_slab.rs:104 — SlabLayout::compute_with has cyclomatic complexity 27 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · EditorView · ×1
  • EditorView::catch_up_deltas (cyclomatic 26) crates/ide-host-core/src/workspace.rs:606 — EditorView::catch_up_deltas has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PostgresBaselineAdapter · ×1
  • PostgresBaselineAdapter::populate_serving_semantic_with_progress (cyclomatic 25) REDACTED:1807 — PostgresBaselineAdapter::populate_serving_semantic_with_progress 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.
D1 · Cyclomatic Complexity · SharedEmbeddingPublisher · ×1
  • SharedEmbeddingPublisher::publish (cyclomatic 25) crates/bsl-search/src/publish.rs:80 — SharedEmbeddingPublisher::publish 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.
D1 · Cyclomatic Complexity · Target · ×1
  • Target::native (cyclomatic 25) crates/mcp-server/src/indexing.rs:119 — Target::native has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · GraphCtx · ×1
  • GraphCtx::neighbors (cyclomatic 24) crates/ide/src/graph.rs:2517 — GraphCtx::neighbors has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyScan · ×1
  • BodyScan::stmt (cyclomatic 24) crates/ide-diagnostics/src/handlers/transferring_parameters_between_client_and_server.rs:425 — BodyScan::stmt has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · GraphStore · ×1
  • GraphStore::checkout_with_admission_wait (cyclomatic 24) crates/mcp-server/src/graph/snapshot.rs:404 — GraphStore::checkout_with_admission_wait has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Record · ×1
  • Record::encode (cyclomatic 23) crates/bsl-search/src/lifecycle.rs:351 — Record::encode has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExtensionTopology · ×1
  • ExtensionTopology::build (cyclomatic 23) crates/project-model/src/extension_topology.rs:383 — ExtensionTopology::build has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · e1.main (cyclomatic 21) · ×1
  • e1.main (cyclomatic 21) scripts/user2/e1.py:75 — e1.main has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime_lifecycle.lifecycle_root (cyclomatic 21) · ×1
  • runtime_lifecycle.lifecycle_root (cyclomatic 21) scripts/user2/runtime_lifecycle.py:52 — runtime_lifecycle.lifecycle_root has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime_lifecycle.prepare_cache (cyclomatic 21) · ×1
  • runtime_lifecycle.prepare_cache (cyclomatic 21) scripts/user2/runtime_lifecycle.py:150 — runtime_lifecycle.prepare_cache has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RequestDispatcher · ×1
  • RequestDispatcher::on_latency_with (cyclomatic 20) crates/bsl-analyzer/src/handlers/dispatch.rs:231 — RequestDispatcher::on_latency_with has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LspChannel · ×1
  • LspChannel::new (cyclomatic 20) crates/mcp-server/src/broker/transport.rs:191 — LspChannel::new has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Sink · ×1
  • Sink::finish (cyclomatic 20) crates/parser/src/sink.rs:97 — Sink::finish has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NullableUses · ×1
  • NullableUses::walk (cyclomatic 20) crates/sdbl-hir/src/lower/diagnostics.rs:1191 — NullableUses::walk has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MissingRowConditions · ×1
  • MissingRowConditions::of (cyclomatic 20) crates/sdbl-hir/src/lower/missing_row.rs:182 — MissingRowConditions::of has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · syntax · ×1
  • syntax::sdbl_query::extract_sdbl_with_corrections (cyclomatic 20) crates/syntax/src/sdbl_query.rs:202 — syntax::sdbl_query::extract_sdbl_with_corrections has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · evaluate.embed (cyclomatic 20) · ×1
  • evaluate.embed (cyclomatic 20) scripts/user2/evaluate.py:32 — evaluate.embed has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Handler.do_POST (cyclomatic 20) · ×1
  • Handler.do_POST (cyclomatic 20) scripts/user2/serve.py:59 — Handler.do_POST has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Collector · ×1
  • Collector::visit_stmt (cyclomatic 19) crates/hir-ty/src/map_keys.rs:180 — Collector::visit_stmt has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SdblPackage · ×1
  • SdblPackage::collect_expr_diagnostics (cyclomatic 19) crates/sdbl-hir/src/hir.rs:1351 — SdblPackage::collect_expr_diagnostics has cyclomatic complexity 19 (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: FunctionKind::name_ru (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.
D1 · Cyclomatic Complexity · RootDatabaseImpl · ×1
  • RootDatabaseImpl::resolve_common_module_files_for_file (cyclomatic 18) crates/ide-db/src/database.rs:2628 — RootDatabaseImpl::resolve_common_module_files_for_file has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExternalBaselineService · ×1
  • ExternalBaselineService::indexing_publication (cyclomatic 18) crates/mcp-server/src/baseline.rs:1097 — ExternalBaselineService::indexing_publication 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.
D1 · Cyclomatic Complexity · project_model · ×1
  • project_model::parse_dotenv_value (cyclomatic 18) crates/project-model/src/lib.rs:1967 — project_model::parse_dotenv_value has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SdblHir · ×1
  • SdblHir::collect_resolved_attributes (cyclomatic 18) crates/sdbl-hir/src/hir.rs:114 — SdblHir::collect_resolved_attributes has cyclomatic complexity 18 (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. This is NOT this file's highest cyclomatic complexity: FunctionKind::name_ru (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.
D1 · Cyclomatic Complexity · DebugSession · ×1
  • DebugSession::handle_event (cyclomatic 17) crates/bsl-debug/src/session.rs:1147 — DebugSession::handle_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DataflowSolver · ×1
  • DataflowSolver::solve_backward (cyclomatic 17) crates/dataflow/src/lib.rs:257 — DataflowSolver::solve_backward has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiagnosticsBaselineSnapshot · ×1
  • DiagnosticsBaselineSnapshot::load_once (cyclomatic 17) crates/ide-host-core/src/diagnostics_baseline.rs:184 — DiagnosticsBaselineSnapshot::load_once has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Watch · ×1
  • Watch::arm_within (cyclomatic 17) crates/mcp-server/src/change_hub.rs:225 — Watch::arm_within has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HubInner · ×1
  • HubInner::ingest_event (cyclomatic 17) crates/mcp-server/src/change_hub.rs:1456 — HubInner::ingest_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DefinitionIndex · ×1
  • DefinitionIndex::from_body_with_params (cyclomatic 16) crates/dataflow/src/reaching_defs.rs:172 — DefinitionIndex::from_body_with_params has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Scope · ×1
  • Scope::resolve_nested_field_type (cyclomatic 16) crates/sdbl-hir/src/scope.rs:448 — Scope::resolve_nested_field_type has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · runtime_acceptance.wait_ready (cyclomatic 16) · ×1
  • runtime_acceptance.wait_ready (cyclomatic 16) scripts/user2/runtime_acceptance.py:139 — runtime_acceptance.wait_ready 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.
D2 · Cognitive Complexity · GraphStore · ×1
  • GraphStore::checkout_with_admission_wait (cognitive 62) crates/mcp-server/src/graph/snapshot.rs:404 — GraphStore::checkout_with_admission_wait has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (44 pts), match/switch 2 (10 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PlatformDataInner · ×1
  • PlatformDataInner::from_help (cognitive 57) crates/bsl-platform/src/db.rs:145 — PlatformDataInner::from_help has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 16 (17 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiagnosticsResident · ×1
  • DiagnosticsResident::workspace_aggregates (cognitive 53) crates/mcp-server/src/diagnostics_state/resident.rs:805 — DiagnosticsResident::workspace_aggregates has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (30 pts), match/switch 6 (12 pts), loops 5 (6 pts), boolean chains 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphDb · ×1
  • GraphDb::neighbors (cognitive 51) crates/mcp-server/src/graph_query.rs:1316 — GraphDb::neighbors has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 9 (13 pts), boolean chains 6, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphCtx · ×1
  • GraphCtx::neighbors (cognitive 49) crates/ide/src/graph.rs:2517 — GraphCtx::neighbors has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 6 (10 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime_acceptance.main (cognitive 46) · ×1
  • runtime_acceptance.main (cognitive 46) scripts/user2/runtime_acceptance.py:347 — runtime_acceptance.main has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 8, error handling 2 (5 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensionTopology · ×1
  • ExtensionTopology::build (cognitive 45) crates/project-model/src/extension_topology.rs:383 — ExtensionTopology::build has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 8 (12 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LspChannel · ×1
  • LspChannel::new (cognitive 42) crates/mcp-server/src/broker/transport.rs:191 — LspChannel::new has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 5 (13 pts), loops 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Record · ×1
  • Record::encode (cognitive 41) crates/bsl-search/src/lifecycle.rs:351 — Record::encode has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditorView · ×1
  • EditorView::catch_up_deltas (cognitive 41) crates/ide-host-core/src/workspace.rs:606 — EditorView::catch_up_deltas has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Sink · ×1
  • Sink::finish (cognitive 41) crates/parser/src/sink.rs:97 — Sink::finish has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 6 (12 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SlabLayout · ×1
  • SlabLayout::compute_with (cognitive 40) crates/hir-def/src/method_slab.rs:104 — SlabLayout::compute_with has cognitive complexity 40 (threshold 15). Drivers by points: loops 12 (20 pts), if/else 5 (11 pts), boolean chains 9 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · e1.main (cognitive 38) · ×1
  • e1.main (cognitive 38) scripts/user2/e1.py:75 — e1.main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (10 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SharedEmbeddingPublisher · ×1
  • SharedEmbeddingPublisher::publish (cognitive 37) crates/bsl-search/src/publish.rs:80 — SharedEmbeddingPublisher::publish has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 3 (7 pts), loops 4, boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommonAttributeSet · ×1
  • CommonAttributeSet::project_extension_object (cognitive 35) crates/bsl-metadata/src/common_attribute.rs:293 — CommonAttributeSet::project_extension_object has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 4 (10 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime_lifecycle.main (cognitive 35) · ×1
  • runtime_lifecycle.main (cognitive 35) scripts/user2/runtime_lifecycle.py:358 — runtime_lifecycle.main has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 6, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OverlayRetry · ×1
  • OverlayRetry::run (cognitive 34) crates/mcp-server/src/state/overlay_retry.rs:305 — OverlayRetry::run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 6 (10 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Ir · ×1
  • Ir::build (cognitive 33) crates/ide/src/formatting/ir.rs:36 — Ir::build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (30 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Watch · ×1
  • Watch::arm_within (cognitive 33) crates/mcp-server/src/change_hub.rs:225 — Watch::arm_within has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (11 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HubInner · ×1
  • HubInner::ingest_event (cognitive 32) crates/mcp-server/src/change_hub.rs:1456 — HubInner::ingest_event has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (6 pts), boolean chains 2, match/switch 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evaluate.embed (cognitive 32) · ×1
  • evaluate.embed (cognitive 32) scripts/user2/evaluate.py:32 — evaluate.embed has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 7, ternaries 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RequestDispatcher · ×1
  • RequestDispatcher::on_latency_with (cognitive 30) crates/bsl-analyzer/src/handlers/dispatch.rs:231 — RequestDispatcher::on_latency_with has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 5 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefinitionIndex · ×1
  • DefinitionIndex::from_body_with_params (cognitive 30) crates/dataflow/src/reaching_defs.rs:172 — DefinitionIndex::from_body_with_params has cognitive complexity 30 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 3 (9 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · BlindPoll · ×1
  • BlindPoll::poll_until_stopped (cognitive 30) crates/mcp-server/src/change_hub.rs:4476 — BlindPoll::poll_until_stopped has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LineFacts · ×1
  • LineFacts::collect (cognitive 29) crates/hir-def/src/method_slab.rs:284 — LineFacts::collect has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceLease · ×1
  • WorkspaceLease::publish_checkpointed_inner (cognitive 29) crates/mcp-server/src/workspace_lease.rs:896 — WorkspaceLease::publish_checkpointed_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (24 pts), match/switch 4, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DbScopeProvider · ×1
  • DbScopeProvider::get_scope (cognitive 28) crates/ide/src/completion/sdbl/infrastructure/scope_provider.rs:18 — DbScopeProvider::get_scope has cognitive complexity 28 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SdblType · ×1
  • SdblType::display_name (cognitive 28) crates/sdbl-hir/src/types.rs:195 — SdblType::display_name has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 21 (24 pts), if/else 3 (4 pts) (nesting depth added 4). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · runtime_lifecycle.prepare_cache (cognitive 28) · ×1
  • runtime_lifecycle.prepare_cache (cognitive 28) scripts/user2/runtime_lifecycle.py:150 — runtime_lifecycle.prepare_cache has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, loops 3 (4 pts), error handling 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime_lifecycle.lifecycle_root (cognitive 27) · ×1
  • runtime_lifecycle.lifecycle_root (cognitive 27) scripts/user2/runtime_lifecycle.py:52 — runtime_lifecycle.lifecycle_root has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiagnosticsBaselineSnapshot · ×1
  • DiagnosticsBaselineSnapshot::load_once (cognitive 26) crates/ide-host-core/src/diagnostics_baseline.rs:184 — DiagnosticsBaselineSnapshot::load_once has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 8 (13 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NullableUses · ×1
  • NullableUses::walk (cognitive 24) crates/sdbl-hir/src/lower/diagnostics.rs:1191 — NullableUses::walk has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (8 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · runtime_acceptance.wait_ready (cognitive 24) · ×1
  • runtime_acceptance.wait_ready (cognitive 24) scripts/user2/runtime_acceptance.py:139 — runtime_acceptance.wait_ready has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · symbol_info · ×1
  • symbol_info::presenters::hover::render_hover_markdown (cognitive 23) crates/symbol-info/src/presenters/hover.rs:4 — symbol_info::presenters::hover::render_hover_markdown has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.do_POST (cognitive 22) · ×1
  • Handler.do_POST (cognitive 22) scripts/user2/serve.py:59 — Handler.do_POST has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, error handling 3, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DefiniteInitResult · ×1
  • DefiniteInitResult::witness (cognitive 21) crates/dataflow/src/definite_init.rs:255 — DefiniteInitResult::witness has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evaluate-qwen.encode (cognitive 21) · ×1
  • evaluate-qwen.encode (cognitive 21) scripts/user2/evaluate-qwen.py:74 — evaluate-qwen.encode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckRequest · ×1
  • CheckRequest::validate (cognitive 20) crates/bsl-check-executor/src/native_check/types.rs:57 — CheckRequest::validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExternalBaselineService · ×1
  • ExternalBaselineService::indexing_publication (cognitive 19) crates/mcp-server/src/baseline.rs:1097 — ExternalBaselineService::indexing_publication has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 5, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AuthorFilter · ×1
  • AuthorFilter::blame_lines (cognitive 19) crates/vcs/src/author_filter.rs:246 — AuthorFilter::blame_lines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 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.
D2 · Cognitive Complexity · base_db · ×1
  • base_db::queries::collect_methods_in_regions (cognitive 18) crates/base-db/src/queries.rs:286 — base_db::queries::collect_methods_in_regions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetadataObject · ×1
  • MetadataObject::apply_extension_overlay (cognitive 18) crates/bsl-metadata/src/metadata_object.rs:926 — MetadataObject::apply_extension_overlay has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 5, boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cfg · ×1
  • cfg::cyclomatic::cyclomatic_complexity (cognitive 18) crates/cfg/src/cyclomatic.rs:7 — cfg::cyclomatic::cyclomatic_complexity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NarrowingTransfer · ×1
  • NarrowingTransfer::apply_guard (cognitive 18) crates/hir-ty/src/narrow.rs:204 — NarrowingTransfer::apply_guard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LegacyEntriesVisitor · ×1
  • LegacyEntriesVisitor::visit_seq (cognitive 18) crates/ide/src/partitioned_diagnostics_baseline.rs:696 — LegacyEntriesVisitor::visit_seq has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · vcs · ×1
  • vcs::collect_file_changes (cognitive 18) crates/vcs/src/lib.rs:187 — vcs::collect_file_changes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Register · ×1
  • Register::apply_extension_overlay (cognitive 17) crates/bsl-metadata/src/register.rs:355 — Register::apply_extension_overlay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RefreshableExternalBaselineSource · ×1
  • RefreshableExternalBaselineSource::run_with_refresh (cognitive 17) crates/mcp-server/src/baseline.rs:1453 — RefreshableExternalBaselineSource::run_with_refresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target · ×1
  • Target::native (cognitive 17) crates/mcp-server/src/indexing.rs:119 — Target::native has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ReferenceSearchState · ×1
  • ReferenceSearchState::new_with_reference_cache_and_deferral (cognitive 17) crates/mcp-server/src/state/bootstrap.rs:273 — ReferenceSearchState::new_with_reference_cache_and_deferral has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExcludedPaths · ×1
  • ExcludedPaths::with_patterns (cognitive 17) crates/stdx/src/path_exclusion.rs:116 — ExcludedPaths::with_patterns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventListener · ×1
  • EventListener::start (cognitive 16) crates/bsl-debug/src/listener.rs:17 — EventListener::start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bsl_launcher · ×1
  • bsl_launcher::use_cases::cleanup_versions (cognitive 16) crates/bsl-launcher/src/use_cases.rs:344 — bsl_launcher::use_cases::cleanup_versions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlatformSnapshot · ×1
  • PlatformSnapshot::validate (cognitive 16) crates/bsl-platform/src/snapshot.rs:189 — PlatformSnapshot::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5, boolean chains 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceRootsTransitionSeed · ×1
  • WorkspaceRootsTransitionSeed::plan (cognitive 16) crates/bsl-search/src/engine.rs:285 — WorkspaceRootsTransitionSeed::plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Mutation · ×1
  • Mutation::finish_inner (cognitive 16) crates/bsl-search/src/lifecycle.rs:792 — Mutation::finish_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 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.
D2 · Cognitive Complexity · PointCapture · ×1
  • PointCapture::prepare (cognitive 16) crates/bsl-search/src/point_refresh.rs:147 — PointCapture::prepare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModuleIndex · ×1
  • ModuleIndex::build_from_paths (cognitive 16) crates/hir-def/src/module_index.rs:154 — ModuleIndex::build_from_paths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Forwarder · ×1
  • Forwarder::resolve_callee (cognitive 16) crates/hir-ty/src/structure_param_keys.rs:263 — Forwarder::resolve_callee has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WorkspaceBackend · ×1
  • WorkspaceBackend::reconcile_catalog (cognitive 16) crates/ide-host-core/src/workspace.rs:382 — WorkspaceBackend::reconcile_catalog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · platform_help · ×1
  • platform_help::external::scrubbed (cognitive 16) crates/platform-help/src/external.rs:82 — platform_help::external::scrubbed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Patterns · ×1
  • Patterns::respelled_under (cognitive 16) crates/stdx/src/path_exclusion.rs:417 — Patterns::respelled_under has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime_lifecycle.wait_runtime_profile (cognitive 16) · ×1
  • runtime_lifecycle.wait_runtime_profile (cognitive 16) scripts/user2/runtime_lifecycle.py:215 — runtime_lifecycle.wait_runtime_profile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: standards.rs → handlers.rs, runner.rs, diagnostics.rs crates/ide-diagnostics/src/standards.rs — `crates/ide-diagnostics/src/standards.rs` changes together with 3 other files — `crates/ide-diagnostics/src/handlers.rs`, `crates/ide-diagnostics/src/runner.rs`, `crates/sdbl-hir/src/diagnostics.rs` — 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 6 shared lines) · ×1
  • Near-duplicate member family (3 members, 6 shared lines) REDACTED:2839 — REDACTED:2839-2910 | REDACTED:3059-3134 | REDACTED:4877-4978 — These 3 members are variants of one another: a block of 6 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (82 shared lines) · ×1
  • Near-duplicate member pair (82 shared lines) crates/bsl-search/src/workspace_overlay.rs:970 — crates/bsl-search/src/workspace_overlay.rs:970-1122 | crates/bsl-search/src/workspace_overlay.rs:1448-1694 — These two members are variants of one another: 82 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 · Near-duplicate member pair (76 shared lines) · ×1
  • Near-duplicate member pair (76 shared lines) crates/mcp-server/src/lib.rs:1571 — crates/mcp-server/src/lib.rs:1571-1784 | crates/mcp-server/src/lib.rs:3168-3286 — These two members are variants of one another: 76 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 · Near-duplicate member pair (47 shared lines) · ×1
  • Near-duplicate member pair (47 shared lines) crates/mcp-server/src/state/bootstrap.rs:2060 — crates/mcp-server/src/state/bootstrap.rs:2060-2109 | crates/mcp-server/src/state/bootstrap.rs:2116-2167 — These two members are variants of one another: 47 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 · Near-duplicate member pair (41 shared lines) · ×1
  • Near-duplicate member pair (41 shared lines) crates/ide-diagnostics/src/handlers/unused_local_method.rs:135 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:135-260 | crates/ide-diagnostics/src/handlers/unused_parameters.rs:31-190 — These two members are variants of one another: 41 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 · Near-duplicate member pair (23 shared lines) · ×1
  • Near-duplicate member pair (23 shared lines) crates/ide/src/partitioned_diagnostics_baseline.rs:628 — crates/ide/src/partitioned_diagnostics_baseline.rs:628-659 | crates/ide/src/partitioned_diagnostics_baseline.rs:1042-1070 — 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 (15 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (15 members, 50+ identical tokens) crates/bsl-analyzer/src/handlers/request.rs:41 — crates/bsl-analyzer/src/handlers/request.rs:41-113 | crates/bsl-analyzer/src/handlers/request.rs:118-170 | crates/bsl-analyzer/src/handlers/request.rs:175-220 | crates/bsl-analyzer/src/handlers/request.rs:225-264 | crates/bsl-analyzer/src/handlers/request.rs:269-348 | crates/bsl-analyzer/src/handlers/request.rs:353-439 | crates/bsl-analyzer/src/handlers/request.rs:724-781 | crates/bsl-analyzer/src/handlers/request.rs:786-842 | crates/bsl-analyzer/src/handlers/request.rs:944-991 | crates/bsl-analyzer/src/handlers/request.rs:996-1061 | crates/bsl-analyzer/src/handlers/request.rs:1066-1119 | crates/bsl-analyzer/src/handlers/request.rs:1124-1145 | crates/bsl-analyzer/src/handlers/request.rs:1150-1194 | crates/bsl-analyzer/src/handlers/request.rs:1285-1318 | crates/bsl-analyzer/src/handlers/request.rs:1363-1475 — These 15 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 15 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 15 times.
D4 · Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (12 members, 50+ identical tokens) crates/bsl-metadata/src/loader.rs:602 — crates/bsl-metadata/src/loader.rs:602-659 | crates/bsl-metadata/src/loader.rs:1287-1311 | crates/bsl-metadata/src/loader.rs:1313-1337 | crates/bsl-metadata/src/loader.rs:1346-1370 | crates/bsl-metadata/src/loader.rs:1403-1427 | crates/bsl-metadata/src/loader.rs:1432-1456 | crates/bsl-metadata/src/loader.rs:1458-1502 | crates/bsl-metadata/src/loader.rs:1507-1531 | crates/bsl-metadata/src/loader.rs:1536-1573 | crates/bsl-metadata/src/loader.rs:1578-1615 | crates/bsl-metadata/src/loader.rs:1620-1645 | crates/bsl-metadata/src/loader.rs:1651-1675 — These 12 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 12 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 12 times.
D4 · Code Duplication · Edited copy of a member (113 corresponding lines) · ×1
  • Edited copy of a member (113 corresponding lines) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:82 — crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:82-225 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:26-138 — These two members are one piece of code written twice and then edited apart: 113 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (83 corresponding lines) · ×1
  • Edited copy of a member (83 corresponding lines) crates/bsl-analyzer/src/mcp_install/adapters.rs:181 — crates/bsl-analyzer/src/mcp_install/adapters.rs:181-263 | crates/bsl-analyzer/src/mcp_install/adapters.rs:402-496 — These two members are one piece of code written twice and then edited apart: 83 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) crates/bsl-check-executor/src/native_check/windows_acl.rs:73 — crates/bsl-check-executor/src/native_check/windows_acl.rs:73-156 | crates/mcp-server/src/cache_windows.rs:137-211 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) crates/bsl-metadata/src/xml_parser/http_service.rs:8 — crates/bsl-metadata/src/xml_parser/http_service.rs:8-80 | crates/bsl-metadata/src/xml_parser/web_service.rs:8-70 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) crates/hir-def/src/metrics.rs:224 — crates/hir-def/src/metrics.rs:224-277 | crates/hir-def/src/metrics.rs:279-328 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (79 corresponding lines) · ×1
  • Edited copy of a member (79 corresponding lines) crates/sdbl-hir/src/lower/diagnostics.rs:591 — crates/sdbl-hir/src/lower/diagnostics.rs:591-669 | crates/sdbl-hir/src/lower/diagnostics.rs:762-853 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) crates/sdbl-hir/src/hir.rs:448 — crates/sdbl-hir/src/hir.rs:448-505 | crates/sdbl-hir/src/hir.rs:509-568 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) crates/hir-def/src/graph_index.rs:1749 — crates/hir-def/src/graph_index.rs:1749-1797 | crates/hir-def/src/graph_index.rs:1888-1957 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 53+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 53+ corresponding lines) crates/symbol-info/src/adapters/common_module.rs:42 — crates/symbol-info/src/adapters/common_module.rs:42-106 | crates/symbol-info/src/adapters/local_method.rs:21-73 | crates/symbol-info/src/adapters/manager_module.rs:17-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 53 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) crates/bsl-metadata/src/metadata_object.rs:1147 — crates/bsl-metadata/src/metadata_object.rs:1147-1191 | crates/sdbl-hir/src/types.rs:305-354 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 59+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 59+ corresponding lines) crates/bsl-analyzer/src/mcp_install/adapters.rs:112 — crates/bsl-analyzer/src/mcp_install/adapters.rs:112-176 | crates/bsl-analyzer/src/mcp_install/adapters.rs:269-334 | crates/bsl-analyzer/src/mcp_install/adapters.rs:339-397 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 59 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) crates/dataflow/src/security_state.rs:396 — crates/dataflow/src/security_state.rs:396-442 | crates/dataflow/src/temp_resource.rs:193-236 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) crates/bsl-platform/src/overlays.rs:238 — crates/bsl-platform/src/overlays.rs:238-283 | crates/bsl-platform/src/overlays.rs:292-327 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 41+ corresponding lines) crates/ide-db/src/database.rs:1252 — crates/ide-db/src/database.rs:1252-1293 | crates/ide-db/src/database.rs:1305-1345 | crates/ide-db/src/database.rs:1354-1408 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:320 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:320-359 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:587-621 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:169 — crates/ide-diagnostics/src/handlers/missing_event_subscription_handler.rs:169-220 | crates/ide-diagnostics/src/handlers/scheduled_job_handler.rs:272-338 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 37+ corresponding lines) crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:300 — crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:300-342 | crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:357-393 | crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:408-446 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 34+ corresponding lines) crates/ide-diagnostics/src/common_module_helpers.rs:58 — crates/ide-diagnostics/src/common_module_helpers.rs:58-91 | crates/ide-diagnostics/src/handlers/common_module_invalid_type.rs:24-79 | crates/ide-diagnostics/src/handlers/common_module_name_words.rs:28-62 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) crates/bsl-search/src/engine.rs:6156 — crates/bsl-search/src/engine.rs:6156-6179 | crates/bsl-search/src/engine.rs:6188-6211 | crates/bsl-search/src/engine.rs:6286-6308 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) crates/hir-def/src/conditional_tree.rs:325 — crates/hir-def/src/conditional_tree.rs:325-352 | crates/hir-def/src/conditional_tree.rs:359-385 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 23+ corresponding lines) crates/ide-db/src/database.rs:1540 — crates/ide-db/src/database.rs:1540-1572 | crates/ide-db/src/database.rs:1574-1602 | crates/ide-db/src/database.rs:1655-1685 | crates/ide-db/src/database.rs:1810-1838 | crates/ide-db/src/database.rs:1862-1884 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) crates/ide-diagnostics/src/handlers/at_client_at_server_form_method.rs:30 — crates/ide-diagnostics/src/handlers/at_client_at_server_form_method.rs:30-65 | crates/ide-diagnostics/src/handlers/command_module_export_methods.rs:20-49 | crates/ide-diagnostics/src/handlers/compilation_directive_lost.rs:20-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) crates/bsl-analyzer/src/server.rs:568 — crates/bsl-analyzer/src/server.rs:568-586 | crates/ide-host-core/src/workspace.rs:808-824 | crates/mcp-server/src/diagnostics_state/lifecycle.rs:1663-1680 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 16+ corresponding lines) crates/parser/src/grammar/expressions.rs:35 — crates/parser/src/grammar/expressions.rs:35-50 | crates/parser/src/grammar/expressions.rs:52-67 | crates/parser/src/grammar/expressions.rs:103-118 | crates/parser/src/grammar/expressions.rs:120-135 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) crates/bsl-analyzer/src/bin/cli/search_baseline/inspect.rs:96 — crates/bsl-analyzer/src/bin/cli/search_baseline/inspect.rs:96-119 | crates/bsl-analyzer/src/bin/cli/search_baseline/inspect.rs:170-191 | crates/bsl-analyzer/src/bin/cli/search_baseline/inspect.rs:195-222 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 22+ corresponding lines) crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:16 — crates/ide-diagnostics/src/handlers/deprecated_current_date.rs:16-37 | crates/ide-diagnostics/src/handlers/deprecated_find.rs:16-37 | crates/ide-diagnostics/src/handlers/deprecated_message.rs:16-37 | crates/ide-diagnostics/src/handlers/deprecated_type_managed_form.rs:15-36 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) crates/ide-db/src/database.rs:1500 — crates/ide-db/src/database.rs:1500-1516 | crates/ide-db/src/database.rs:1522-1538 | crates/ide-db/src/database.rs:1608-1624 | crates/ide-db/src/database.rs:1792-1808 | crates/ide-db/src/database.rs:1844-1860 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/hir-def/src/body/lower/mod.rs:260 — crates/hir-def/src/body/lower/mod.rs:260-276 | crates/hir-def/src/body/lower/mod.rs:305-322 | crates/hir-def/src/body/lower/mod.rs:324-337 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) crates/ide-db/src/metadata.rs:1850 — crates/ide-db/src/metadata.rs:1850-1859 | crates/ide-db/src/metadata.rs:1923-1932 | crates/ide-db/src/metadata.rs:1995-2007 | crates/ide-db/src/metadata.rs:2069-2078 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) crates/ide-diagnostics/src/handlers/duplicate_alias_in_query.rs:26 — crates/ide-diagnostics/src/handlers/duplicate_alias_in_query.rs:26-41 | crates/ide-diagnostics/src/handlers/invalid_virtual_table_parameters.rs:26-40 | crates/ide-diagnostics/src/handlers/query_to_missing_metadata.rs:29-44 | crates/ide-diagnostics/src/handlers/unavailable_alias_in_query.rs:26-40 | crates/ide-diagnostics/src/handlers/unknown_field_in_query.rs:26-41 | crates/ide-diagnostics/src/handlers/unknown_query_function.rs:26-38 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 10+ corresponding lines) crates/ide-db/src/metadata.rs:1387 — crates/ide-db/src/metadata.rs:1387-1396 | crates/ide-db/src/metadata.rs:1502-1512 | crates/ide-db/src/metadata.rs:1869-1878 | crates/ide-db/src/metadata.rs:1943-1952 | crates/ide-db/src/metadata.rs:2014-2023 | crates/ide-db/src/metadata.rs:2090-2099 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) crates/hir-ty/src/object_resolver.rs:248 — crates/hir-ty/src/object_resolver.rs:248-260 | crates/hir-ty/src/object_resolver.rs:262-273 | crates/ide-db/src/provider.rs:76-88 | crates/ide-db/src/provider.rs:98-110 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) crates/ide-diagnostics/src/handlers/deprecated_method.rs:14 — crates/ide-diagnostics/src/handlers/deprecated_method.rs:14-34 | crates/ide-diagnostics/src/handlers/temp_files_dir.rs:26-43 | crates/ide-diagnostics/src/handlers/using_modal_windows.rs:26-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/ide-db/src/metadata.rs:1548 — crates/ide-db/src/metadata.rs:1548-1555 | crates/ide-db/src/metadata.rs:1638-1645 | crates/ide-db/src/metadata.rs:1728-1735 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) crates/bsl-metadata/src/form.rs:334 — crates/bsl-metadata/src/form.rs:334-337 | crates/hir-ty/src/method_resolution.rs:452-456 | crates/hir-ty/src/proc_signature.rs:79-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (59 lines × 2) · ×1
  • Duplicated block (59 lines × 2) crates/hir-def/src/graph_index.rs:2459 — crates/hir-def/src/graph_index.rs:2459-2517 | crates/ide/src/graph.rs:1744-1802 — before extracting anything, compare `crates/hir-def/src/graph_index.rs` and `crates/ide/src/graph.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:2459` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (52 lines × 2) · ×1
  • Duplicated block (52 lines × 2) crates/hir-def/src/body/lower/utils.rs:89 — crates/hir-def/src/body/lower/utils.rs:89-140 | crates/ide-diagnostics/src/sdbl_utils.rs:505-556 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/sdbl_utils.rs:505` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) crates/bsl-search/src/workspace_overlay.rs:993 — crates/bsl-search/src/workspace_overlay.rs:993-1037 | crates/bsl-search/src/workspace_overlay.rs:1516-1560 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/workspace_overlay.rs:993` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:176 — crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:176-217 | crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs:89-130 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs` and `crates/ide-diagnostics/src/handlers/multilingual_string_using_with_template.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/multilingual_string_has_all_declared_languages.rs:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (39–41 lines × 2) · ×1
  • Duplicated block (39–41 lines × 2) crates/hir-def/src/graph_index.rs:501 — crates/hir-def/src/graph_index.rs:501-539 | crates/hir-def/src/queries.rs:534-574 — before extracting anything, compare `crates/hir-def/src/graph_index.rs` and `crates/hir-def/src/queries.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:501` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–34 lines × 2) · ×1
  • Duplicated block (30–34 lines × 2) crates/symbol-info/src/adapters/common_module.rs:52 — crates/symbol-info/src/adapters/common_module.rs:52-85 | crates/symbol-info/src/adapters/manager_module.rs:32-61 — before extracting anything, compare `crates/symbol-info/src/adapters/common_module.rs` and `crates/symbol-info/src/adapters/manager_module.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/symbol-info/src/adapters/manager_module.rs:63` calls `russian_plural`, `as_str` and `crates/symbol-info/src/adapters/common_module.rs:87` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) crates/bsl-search/src/workspace_overlay.rs:1570 — crates/bsl-search/src/workspace_overlay.rs:1570-1600 | crates/bsl-search/src/workspace_overlay.rs:1811-1842 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/workspace_overlay.rs:1570` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/bsl-search/src/workspace_overlay.rs:1601` calls `remove_entry` and `crates/bsl-search/src/workspace_overlay.rs:1843` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) crates/bsl-search/src/workspace_overlay.rs:1086 — crates/bsl-search/src/workspace_overlay.rs:1086-1115 | crates/bsl-search/src/workspace_overlay.rs:1637-1666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–30 lines × 2) · ×1
  • Duplicated block (26–30 lines × 2) crates/hir-def/src/graph_index.rs:408 — crates/hir-def/src/graph_index.rs:408-433 | crates/hir-def/src/graph_index.rs:458-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) REDACTED:2691 — REDACTED:2691-2718 | REDACTED:3071-3097 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) crates/sdbl-hir/src/lower/mod.rs:110 — crates/sdbl-hir/src/lower/mod.rs:110-135 | crates/sdbl-hir/src/lower/mod.rs:187-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/lower/mod.rs:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) crates/bsl-platform/src/overlays.rs:333 — crates/bsl-platform/src/overlays.rs:333-360 | crates/bsl-platform/src/overlays.rs:421-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) crates/mcp-server/src/state/bootstrap.rs:2567 — crates/mcp-server/src/state/bootstrap.rs:2567-2590 | crates/mcp-server/src/state/bootstrap.rs:2672-2696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/state/bootstrap.rs:2567` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) crates/parser/src/grammar/sdbl/expressions.rs:649 — crates/parser/src/grammar/sdbl/expressions.rs:649-672 | crates/parser/src/grammar/sdbl/expressions.rs:677-698 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/parser/src/grammar/sdbl/expressions.rs:649` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) crates/sdbl-hir/src/lower/clauses.rs:22 — crates/sdbl-hir/src/lower/clauses.rs:22-42 | crates/sdbl-hir/src/lower/clauses.rs:53-75 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/lower/clauses.rs:22` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn lower_where_clause( &mut` in one and `super) fn lower_having_clause( &mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/sdbl-hir/src/lower/clauses.rs:20` calls `report_or_in_where`, `syntax`, `children` and `crates/sdbl-hir/src/lower/clauses.rs:53` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) crates/bsl-search/src/workspace_overlay.rs:1872 — crates/bsl-search/src/workspace_overlay.rs:1872-1893 | crates/bsl-search/src/workspace_overlay.rs:2002-2021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/workspace_overlay.rs:1872` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) crates/parser/src/grammar.rs:104 — crates/parser/src/grammar.rs:104-139 | crates/parser/src/grammar.rs:352-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/parser/src/grammar.rs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:301 — crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:301-321 | crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:358-378 | crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:409-429 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:431` calls `as_ref`, `as_str`, `unwrap_or` and `crates/ide-diagnostics/src/handlers/nested_function_in_parameters.rs:380` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:41 — crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:41-61 | crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:91-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/platform_manager_lookup/record_resolution.rs:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–21 lines × 2) · ×1
  • Duplicated block (13–21 lines × 2) crates/sdbl-hir/src/lower/register_tables.rs:330 — crates/sdbl-hir/src/lower/register_tables.rs:330-342 | crates/sdbl-hir/src/lower/register_tables.rs:457-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/sdbl-hir/src/lower/register_tables.rs:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) crates/bsl-analyzer/src/handlers/request.rs:80 — crates/bsl-analyzer/src/handlers/request.rs:80-98 | crates/bsl-analyzer/src/handlers/request.rs:152-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) crates/bsl-check-executor/src/native_check/profile.rs:3247 — crates/bsl-check-executor/src/native_check/profile.rs:3247-3264 | crates/bsl-check-executor/src/native_check/profile.rs:3272-3290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) crates/ide-diagnostics/src/handlers/unused_local_method.rs:239 — crates/ide-diagnostics/src/handlers/unused_local_method.rs:239-257 | crates/ide-diagnostics/src/handlers/unused_parameters.rs:75-91 — before extracting anything, compare `crates/ide-diagnostics/src/handlers/unused_local_method.rs` and `crates/ide-diagnostics/src/handlers/unused_parameters.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/unused_local_method.rs:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) crates/mcp-server/src/tools/resident.rs:57 — crates/mcp-server/src/tools/resident.rs:57-75 | crates/mcp-server/src/tools/resident.rs:168-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18 lines × 5) · ×1
  • Duplicated block (18 lines × 5) crates/stdx/src/fs.rs:80 — crates/stdx/src/fs.rs:80-97 | crates/stdx/src/fs.rs:125-142 | crates/stdx/src/fs.rs:170-187 | crates/stdx/src/fs.rs:223-240 | crates/stdx/src/fs.rs:281-298 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/stdx/src/fs.rs:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/stdx/src/fs.rs:76` calls `is_some_and`, `load` and `crates/stdx/src/fs.rs:124` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–18 lines × 3) · ×1
  • Duplicated block (17–18 lines × 3) REDACTED:2705 — REDACTED:2705-2722 | REDACTED:2869-2885 | REDACTED:3085-3101 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2705` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) crates/bsl-metadata/src/loader.rs:782 — crates/bsl-metadata/src/loader.rs:782-798 | crates/bsl-metadata/src/loader.rs:877-889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:782` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) crates/mcp-server/src/diagnostics_state/resident.rs:946 — crates/mcp-server/src/diagnostics_state/resident.rs:946-962 | crates/mcp-server/src/diagnostics_state/resident.rs:1183-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/diagnostics_state/resident.rs:946` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) crates/bsl-search/src/engine.rs:2228 — crates/bsl-search/src/engine.rs:2228-2243 | crates/bsl-search/src/engine.rs:3342-3356 | crates/bsl-search/src/publish.rs:262-275 — 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) REDACTED:2422 — REDACTED:2422-2436 | REDACTED:2793-2808 | REDACTED:5279-5293 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2422` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) crates/hir-def/src/body/lower/diagnostics.rs:224 — crates/hir-def/src/body/lower/diagnostics.rs:224-239 | crates/hir-def/src/body/lower/diagnostics.rs:291-306 | crates/hir-def/src/body/lower/diagnostics.rs:374-389 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) crates/ide-diagnostics/src/handlers/missing_form_event_handler.rs:39 — crates/ide-diagnostics/src/handlers/missing_form_event_handler.rs:39-54 | crates/ide-diagnostics/src/handlers/unbound_form_event_handler.rs:61-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/missing_form_event_handler.rs:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–15 lines × 4) · ×1
  • Duplicated block (13–15 lines × 4) REDACTED:2373 — REDACTED:2373-2385 | REDACTED:2705-2719 | REDACTED:2869-2882 | REDACTED:3085-3098 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2373` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) crates/hir-ty/src/method_resolution.rs:42 — crates/hir-ty/src/method_resolution.rs:42-55 | crates/hir-ty/src/method_resolution.rs:167-181 | crates/hir-ty/src/method_resolution.rs:194-208 | crates/hir-ty/src/method_resolution.rs:219-233 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/method_resolution.rs:42` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) crates/bsl-search/src/engine.rs:1613 — crates/bsl-search/src/engine.rs:1613-1626 | crates/bsl-search/src/engine.rs:3103-3116 | crates/bsl-search/src/engine.rs:6520-6534 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-search/src/engine.rs:1613` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 9) · ×1
  • Duplicated block (14 lines × 9) crates/bsl-analyzer/src/handlers/request.rs:53 — crates/bsl-analyzer/src/handlers/request.rs:53-66 | crates/bsl-analyzer/src/handlers/request.rs:130-143 | crates/bsl-analyzer/src/handlers/request.rs:187-200 | crates/bsl-analyzer/src/handlers/request.rs:234-247 | crates/bsl-analyzer/src/handlers/request.rs:282-295 | crates/bsl-analyzer/src/handlers/request.rs:359-372 | crates/bsl-analyzer/src/handlers/request.rs:798-811 | crates/bsl-analyzer/src/handlers/request.rs:956-969 | crates/bsl-analyzer/src/handlers/request.rs:1297-1310 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/handlers/request.rs:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:353 — crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:353-366 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:394-407 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:416-429 | crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:438-451 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/latin_and_cyrillic_symbol_in_word.rs:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 7) · ×1
  • Duplicated block (13 lines × 7) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:681 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:681-693 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:698-710 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:717-729 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:736-748 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:755-767 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:773-785 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:788-800 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:697` calls `Some` and `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:788` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 6) · ×1
  • Duplicated block (13 lines × 6) crates/bsl-metadata/src/loader.rs:1295 — crates/bsl-metadata/src/loader.rs:1295-1307 | crates/bsl-metadata/src/loader.rs:1321-1333 | crates/bsl-metadata/src/loader.rs:1354-1366 | crates/bsl-metadata/src/loader.rs:1411-1423 | crates/bsl-metadata/src/loader.rs:1440-1452 | crates/bsl-metadata/src/loader.rs:1515-1527 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:1295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–13 lines × 5) · ×1
  • Duplicated block (8–13 lines × 5) crates/bsl-analyzer/src/handlers/request.rs:727 — crates/bsl-analyzer/src/handlers/request.rs:727-734 | crates/bsl-analyzer/src/handlers/request.rs:1070-1082 | crates/bsl-analyzer/src/handlers/request.rs:1127-1139 | crates/bsl-analyzer/src/handlers/request.rs:1154-1161 | crates/bsl-analyzer/src/handlers/request.rs:1366-1376 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/handlers/request.rs:1070` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `InlayHintParams` in one and `SemanticTokensParams` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-analyzer/src/handlers/request.rs:1067` calls `now` and `crates/bsl-analyzer/src/handlers/request.rs:1124` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) crates/sdbl-hir/src/lower/clauses.rs:23 — crates/sdbl-hir/src/lower/clauses.rs:23-34 | crates/sdbl-hir/src/lower/clauses.rs:56-67 | crates/sdbl-hir/src/lower/clauses.rs:397-409 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/sdbl-hir/src/lower/clauses.rs:20` calls `report_or_in_where`, `syntax` and `crates/sdbl-hir/src/lower/clauses.rs:53` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) crates/hir-def/src/graph_index.rs:837 — crates/hir-def/src/graph_index.rs:837-845 | crates/hir-def/src/graph_index.rs:853-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/graph_index.rs:837` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–13 lines × 4) · ×1
  • Duplicated block (4–13 lines × 4) crates/bsl-analyzer/src/frozen_context.rs:38 — crates/bsl-analyzer/src/frozen_context.rs:38-41 | crates/ide-host-core/src/workspace.rs:363-375 | crates/ide-host-core/src/workspace.rs:388-400 | crates/ide-host-core/src/workspace.rs:438-441 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-analyzer/src/frozen_context.rs:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `db` to `&ide::RootDatabaseImpl` in one and `&RootDatabaseImpl` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/ide-host-core/src/workspace.rs:386` calls `Some`, `try_source_root_input`, `root` and `crates/ide-host-core/src/workspace.rs:438` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) crates/mcp-server/src/state/mod.rs:668 — crates/mcp-server/src/state/mod.rs:668-680 | crates/mcp-server/src/state/mod.rs:717-727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 9) · ×1
  • Duplicated block (12 lines × 9) crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:667 — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:667-678 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:683-694 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:700-711 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:719-730 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:738-749 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:757-768 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:775-786 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:790-801 | crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:808-819 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:680` calls `iter` and `crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:788` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) crates/bsl-metadata/src/loader.rs:1294 — crates/bsl-metadata/src/loader.rs:1294-1305 | crates/bsl-metadata/src/loader.rs:1320-1331 | crates/bsl-metadata/src/loader.rs:1353-1364 | crates/bsl-metadata/src/loader.rs:1410-1421 | crates/bsl-metadata/src/loader.rs:1439-1450 | crates/bsl-metadata/src/loader.rs:1465-1476 | crates/bsl-metadata/src/loader.rs:1514-1525 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:1294` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–12 lines × 6) · ×1
  • Duplicated block (11–12 lines × 6) crates/ide-diagnostics/src/handlers/deny_incomplete_values.rs:48 — crates/ide-diagnostics/src/handlers/deny_incomplete_values.rs:48-58 | crates/ide-diagnostics/src/handlers/wrong_data_path_for_form_elements.rs:53-63 | crates/ide-diagnostics/src/handlers/wrong_http_service_handler.rs:56-66 | crates/ide-diagnostics/src/handlers/wrong_http_service_handler.rs:78-89 | crates/ide-diagnostics/src/handlers/wrong_web_service_handler.rs:53-64 | crates/ide-diagnostics/src/handlers/wrong_web_service_handler.rs:75-86 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide-diagnostics/src/handlers/wrong_http_service_handler.rs:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) crates/mcp-server/src/broker/name.rs:739 — crates/mcp-server/src/broker/name.rs:739-750 | crates/mcp-server/src/broker/name.rs:766-774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/broker/name.rs:739` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `&BackendKey` in one and `&SharedBackendKey` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) crates/hir-def/src/body/lower/expr.rs:636 — crates/hir-def/src/body/lower/expr.rs:636-646 | crates/hir-def/src/body/lower/expr.rs:993-1003 | crates/hir-def/src/body/lower/expr.rs:1026-1035 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) REDACTED:2066 — REDACTED:2066-2073 | REDACTED:4934-4944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) crates/hir-def/src/body/lower/stmt.rs:35 — crates/hir-def/src/body/lower/stmt.rs:35-44 | crates/hir-def/src/body/lower/stmt.rs:55-64 | crates/hir-def/src/body/lower/stmt.rs:137-146 | crates/hir-def/src/body/lower/stmt.rs:157-166 | crates/hir-def/src/body/lower/stmt.rs:177-186 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/stmt.rs:35` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) crates/hir-def/src/body/lower/mod.rs:306 — crates/hir-def/src/body/lower/mod.rs:306-313 | crates/hir-def/src/body/lower/mod.rs:325-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-def/src/body/lower/mod.rs:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 11) · ×1
  • Duplicated block (9 lines × 11) crates/bsl-metadata/src/loader.rs:1292 — crates/bsl-metadata/src/loader.rs:1292-1300 | crates/bsl-metadata/src/loader.rs:1318-1326 | crates/bsl-metadata/src/loader.rs:1351-1359 | crates/bsl-metadata/src/loader.rs:1408-1416 | crates/bsl-metadata/src/loader.rs:1437-1445 | crates/bsl-metadata/src/loader.rs:1463-1471 | crates/bsl-metadata/src/loader.rs:1512-1520 | crates/bsl-metadata/src/loader.rs:1541-1549 | crates/bsl-metadata/src/loader.rs:1583-1591 | crates/bsl-metadata/src/loader.rs:1625-1633 | crates/bsl-metadata/src/loader.rs:1656-1664 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:1292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 6) · ×1
  • Duplicated block (7–9 lines × 6) REDACTED:1068 — REDACTED:1068-1076 | REDACTED:2046-2052 | REDACTED:2430-2436 | REDACTED:2802-2808 | REDACTED:5287-5293 | REDACTED:5538-5544 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1068` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1067` calls `pragma_update` and `REDACTED:2429` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) REDACTED:1735 — REDACTED:1735-1743 | REDACTED:1765-1770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6–8 lines × 12) · ×1
  • Duplicated block (6–8 lines × 12) crates/bsl-analyzer/src/handlers/request.rs:53 — crates/bsl-analyzer/src/handlers/request.rs:53-60 | crates/bsl-analyzer/src/handlers/request.rs:130-137 | crates/bsl-analyzer/src/handlers/request.rs:187-194 | crates/bsl-analyzer/src/handlers/request.rs:234-241 | crates/bsl-analyzer/src/handlers/request.rs:282-289 | crates/bsl-analyzer/src/handlers/request.rs:359-366 | crates/bsl-analyzer/src/handlers/request.rs:798-805 | crates/bsl-analyzer/src/handlers/request.rs:956-963 | crates/bsl-analyzer/src/handlers/request.rs:1078-1083 | crates/bsl-analyzer/src/handlers/request.rs:1135-1140 | crates/bsl-analyzer/src/handlers/request.rs:1297-1304 | crates/bsl-analyzer/src/handlers/request.rs:1372-1377 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–8 lines × 6) · ×1
  • Duplicated block (7–8 lines × 6) crates/bsl-platform/src/overlay_schema.rs:119 — crates/bsl-platform/src/overlay_schema.rs:119-126 | crates/bsl-platform/src/overlay_schema.rs:144-150 | crates/bsl-platform/src/overlay_schema.rs:177-183 | crates/bsl-platform/src/overlay_schema.rs:200-206 | crates/bsl-platform/src/overlay_schema.rs:240-246 | crates/bsl-platform/src/overlay_schema.rs:278-284 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:166 — crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:166-172 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:491-498 | crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:602-609 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:163` calls `name` and `crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:490` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 15) · ×1
  • Duplicated block (7 lines × 15) crates/bsl-analyzer/src/handlers/request.rs:51 — crates/bsl-analyzer/src/handlers/request.rs:51-58 | crates/bsl-analyzer/src/handlers/request.rs:128-135 | crates/bsl-analyzer/src/handlers/request.rs:185-192 | crates/bsl-analyzer/src/handlers/request.rs:232-239 | crates/bsl-analyzer/src/handlers/request.rs:280-287 | crates/bsl-analyzer/src/handlers/request.rs:357-364 | crates/bsl-analyzer/src/handlers/request.rs:728-735 | crates/bsl-analyzer/src/handlers/request.rs:796-803 | crates/bsl-analyzer/src/handlers/request.rs:954-961 | crates/bsl-analyzer/src/handlers/request.rs:1012-1019 | crates/bsl-analyzer/src/handlers/request.rs:1076-1083 | crates/bsl-analyzer/src/handlers/request.rs:1133-1140 | crates/bsl-analyzer/src/handlers/request.rs:1155-1162 | crates/bsl-analyzer/src/handlers/request.rs:1295-1302 | crates/bsl-analyzer/src/handlers/request.rs:1371-1377 — all 15 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 12) · ×1
  • Duplicated block (7 lines × 12) crates/bsl-metadata/src/loader.rs:603 — crates/bsl-metadata/src/loader.rs:603-609 | crates/bsl-metadata/src/loader.rs:1288-1294 | crates/bsl-metadata/src/loader.rs:1314-1320 | crates/bsl-metadata/src/loader.rs:1347-1353 | crates/bsl-metadata/src/loader.rs:1404-1410 | crates/bsl-metadata/src/loader.rs:1433-1439 | crates/bsl-metadata/src/loader.rs:1459-1465 | crates/bsl-metadata/src/loader.rs:1508-1514 | crates/bsl-metadata/src/loader.rs:1537-1543 | crates/bsl-metadata/src/loader.rs:1579-1585 | crates/bsl-metadata/src/loader.rs:1621-1627 | crates/bsl-metadata/src/loader.rs:1652-1658 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-metadata/src/loader.rs:603` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) crates/bsl-platform/src/db.rs:912 — crates/bsl-platform/src/db.rs:912-918 | crates/bsl-platform/src/db.rs:969-974 | crates/bsl-platform/src/db.rs:1013-1018 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/bsl-platform/src/db.rs:912` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5–7 lines × 3) · ×1
  • Duplicated block (5–7 lines × 3) crates/hir-def/src/item_tree/lower.rs:78 — crates/hir-def/src/item_tree/lower.rs:78-84 | crates/hir-def/src/item_tree/lower.rs:112-118 | crates/hir-def/src/item_tree/lower.rs:175-179 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–6 lines × 5) · ×1
  • Duplicated block (4–6 lines × 5) crates/hir-def/src/body/lower/expr.rs:371 — crates/hir-def/src/body/lower/expr.rs:371-376 | crates/hir-def/src/body/lower/expr.rs:970-975 | crates/hir-def/src/body/lower/stmt.rs:845-848 | crates/hir-def/src/body/lower/stmt.rs:1043-1048 | crates/hir-def/src/body/lower/stmt.rs:1055-1060 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) crates/ide/src/diagnostics_baseline.rs:350 — crates/ide/src/diagnostics_baseline.rs:350-354 | crates/ide/src/partitioned_diagnostics_baseline.rs:1345-1350 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/diagnostics_baseline.rs:350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (2–5 lines × 4) · ×1
  • Duplicated block (2–5 lines × 4) crates/hir-ty/src/infer.rs:6709 — crates/hir-ty/src/infer.rs:6709-6710 | crates/hir-ty/src/infer.rs:6721-6722 | crates/hir-ty/src/infer.rs:6835-6839 | crates/hir-ty/src/infer.rs:6985-6989 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/hir-ty/src/infer.rs:6835` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/hir-ty/src/infer.rs:6835` calls `extend`, `iter`, `cloned` and `crates/hir-ty/src/infer.rs:6709` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–13 lines × 6) · ×1
  • Duplicated block (4–13 lines × 6) REDACTED:3768 — REDACTED:3768-3780 | REDACTED:4057-4060 | REDACTED:4088-4091 | REDACTED:4137-4140 | REDACTED:4184-4187 | REDACTED:4237-4250 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3768` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:3766` calls `with_capacity`, `iter`, `enumerate` and `REDACTED:4057` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) crates/mcp-server/src/diagnostics_state/lifecycle.rs:1242 — crates/mcp-server/src/diagnostics_state/lifecycle.rs:1242-1265 | crates/mcp-server/src/diagnostics_state/lifecycle.rs:1413-1436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/mcp-server/src/diagnostics_state/lifecycle.rs:1242` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) crates/ide/src/graph.rs:2097 — crates/ide/src/graph.rs:2097-2109 | crates/ide/src/graph.rs:2118-2130 | crates/ide/src/graph.rs:2139-2151 | crates/ide/src/graph.rs:2160-2172 | crates/ide/src/graph.rs:2187-2199 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ide/src/graph.rs:2097` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Unstable project hir-ty · ×1
  • Unstable project hir-ty — hir-ty has instability 0.93 with 1 dependents.
D5 · Coupling · Unstable project ide · ×1
  • Unstable project ide — ide has instability 0.85 with 3 dependents.
D5 · Coupling · Unstable project ide-assists · ×1
  • Unstable project ide-assists — ide-assists has instability 0.83 with 1 dependents.
D5 · Coupling · Unstable project ide-diagnostics · ×1
  • Unstable project ide-diagnostics — ide-diagnostics has instability 0.94 with 1 dependents.
D5 · Coupling · Unstable project ide-host-core · ×1
  • Unstable project ide-host-core — ide-host-core has instability 0.82 with 2 dependents.
D5 · Coupling · Unstable project mcp-server · ×1
  • Unstable project mcp-server — mcp-server has instability 0.95 with 1 dependents.
D5 · Coupling · Unstable project symbol-info · ×1
  • Unstable project symbol-info — symbol-info has instability 0.88 with 1 dependents.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking crates/bsl-analyzer/src/bin/cli/mcp/shared.rs:411 — `run_daemon` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Minor — 122 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging crates/vfs-notify/src/lib.rs:1214 — `warn!` at line 1214 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/vcs/src/author_filter.rs:163 — `debug!` at line 163 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/vcs/src/lib.rs:67 — `debug!` at line 67 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/vcs/src/lib.rs:96 — `debug!` at line 96 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/vcs/src/lib.rs:153 — `debug!` at line 153 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/vcs/src/lib.rs:248 — `debug!` at line 248 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:47 — `trace!` at line 47 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:60 — `trace!` at line 60 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:71 — `trace!` at line 71 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:79 — `warn!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:93 — `trace!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:102 — `trace!` at line 102 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:131 — `trace!` at line 131 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:160 — `trace!` at line 160 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:169 — `trace!` at line 169 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:190 — `trace!` at line 190 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/literal.rs:199 — `trace!` at line 199 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/sdbl-hir/src/position_detector.rs:45 — `trace!` at line 45 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/project-model/src/lib.rs:510 — `warn!` at line 510 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/platform-help/src/lib.rs:355 — `warn!` at line 355 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/platform-help/src/lib.rs:373 — `warn!` at line 373 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/mcp-server/src/baseline.rs:211 — `warn!` at line 211 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/mcp-server/src/baseline.rs:243 — `warn!` at line 243 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/mcp-server/src/baseline.rs:431 — `warn!` at line 431 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/mcp-server/src/baseline.rs:1478 — `warn!` at line 1478 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×38
  • Duplicated predicate scripts/perf-nightly/night.py:560 — `args.corpora or data.path("corpora.toml")` appears character-identically in 2 files — scripts/perf-nightly/night.py, scripts/perf-nightly/perf_nightly.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 scripts/perf-nightly/perf_nightly.py:745 — `isinstance(value, (int, float)) and not isinstance(value, bool)` appears character-identically in 2 files — scripts/perf-nightly/perf_nightly.py, scripts/perf-nightly/verdict.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/ide-diagnostics/src/handlers/unused_local_method.rs:417 — `!before.is_some_and(is_ident) && !after.is_some_and(is_ident)` appears character-identically in 2 files — crates/ide-diagnostics/src/handlers/unused_local_method.rs, crates/mcp-server/src/graph_query.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/ide-diagnostics/src/handlers/deprecated_platform_api.rs:208 — `!entry.en.is_empty() && lower == entry.en.fold_lower()` appears character-identically in 2 files — crates/ide-diagnostics/src/handlers/deprecated_platform_api.rs, crates/ide-diagnostics/src/handlers/deprecated_platform_facts.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/ide-diagnostics/src/handlers/missing_form_event_handler.rs:50 — `!form.is_managed() || form.has_base_form()` appears character-identically in 2 files — crates/ide-diagnostics/src/handlers/missing_form_event_handler.rs, crates/ide-diagnostics/src/handlers/unbound_form_event_handler.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/bsl-check-executor/src/native_check/profile.rs:2267 — `!metadata.is_file() || metadata.file_type().is_symlink() || metadata.len() > 2 * 1024 * 1024` appears character-identically in 2 files — crates/bsl-check-executor/src/native_check/profile.rs, crates/bsl-check-executor/src/native_check/source.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/bsl-search/src/engine.rs:2397 — `!rendered.is_empty() && seen.insert(rendered.clone())` appears character-identically in 2 files — crates/bsl-search/src/engine.rs, crates/bsl-search/src/workspace_overlay.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/ide-diagnostics/src/lib.rs:484 — `a.start() < b.end() && b.start() < a.end()` appears character-identically in 2 files — crates/ide-diagnostics/src/lib.rs, crates/ide/src/batch_fixes.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/hir-ty/src/platform_type_name.rs:18 — `actual.eq_ignore_ascii_case(en) || actual.fold_lower() == ru.fold_lower()` appears character-identically in 2 files — crates/hir-ty/src/platform_type_name.rs, crates/hir-ty/src/subtype.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/mcp-server/src/tools/search/lexical.rs:293 — `baseline_count < fetch_limit || baseline_count <= previous_baseline_count` appears character-identically in 2 files — crates/mcp-server/src/tools/search/lexical.rs, crates/mcp-server/src/tools/search/semantic.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/bsl-analyzer/src/call_hierarchy_index_state/journal.rs:27 — `building.generation == generation && !building.structural_superseded` appears character-identically in 2 files — crates/bsl-analyzer/src/call_hierarchy_index_state/journal.rs, crates/bsl-analyzer/src/call_hierarchy_index_state/status.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/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs:916 — `ctx.is_disabled_with_metadata(code) || ctx.is_module_code()` appears character-identically in 3 files — crates/ide-diagnostics/src/handlers/duplicated_insertion_into_collection.rs, crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.rs, crates/ide-diagnostics/src/handlers/pairing_broken_transaction.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/ide-diagnostics/src/handlers/form_data_has_no_metadata_method.rs:36 — `ctx.is_disabled_with_metadata(code) || ctx.module_metadata().module_type != bsl_metadata::ModuleType::FormModule` appears character-identically in 2 files — crates/ide-diagnostics/src/handlers/form_data_has_no_metadata_method.rs, crates/ide-diagnostics/src/handlers/global_context_method_conflict.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/ide-diagnostics/src/handlers/deprecated_platform_api.rs:200 — `entry.element_kind == ElementKind::Method && entry.display == DisplayKind::Method` appears character-identically in 2 files — crates/ide-diagnostics/src/handlers/deprecated_platform_api.rs, crates/ide-diagnostics/src/handlers/deprecated_platform_facts.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/mcp-server/src/change_hub.rs:1738 — `entry.file_type().is_dir() || entry.depth() == 0 || entry.path_is_symlink()` appears character-identically in 3 files — crates/mcp-server/src/change_hub.rs, crates/project-model/src/source_set.rs, crates/project-model/src/workspace_walk.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/mcp-server/src/graph/debt.rs:1903 — `facts.terminal || facts.stopping || facts.in_flight || !facts.owns` appears character-identically in 2 files — crates/mcp-server/src/graph/debt.rs, crates/mcp-server/src/graph/state.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/mcp-server/src/graph/state.rs:6576 — `graph.owes_forced().is_some() || graph.drift_pending()` appears character-identically in 2 files — crates/mcp-server/src/graph/state.rs, crates/mcp-server/src/graph/watcher.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/mcp-server/src/graph/state.rs:2525 — `hub.is_polling() || hub.is_partially_blind()` appears character-identically in 2 files — crates/mcp-server/src/graph/state.rs, crates/mcp-server/src/state/mod.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/hir-def/src/body/lower/expr.rs:1788 — `i + 1 < bytes.len() && bytes[i + 1] == b'%'` appears character-identically in 2 files — crates/hir-def/src/body/lower/expr.rs, crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.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/hir-def/src/body/lower/expr.rs:1729 — `i + 1 < bytes.len() && bytes[i] == b'%' && bytes[i + 1] == b'%'` appears character-identically in 2 files — crates/hir-def/src/body/lower/expr.rs, crates/ide-diagnostics/src/handlers/incorrect_use_of_str_template.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/mcp-server/src/diagnostics_state/drift.rs:1137 — `inner.reload == ReloadState::Running || inner.invalid_configuration.is_some()` appears character-identically in 2 files — crates/mcp-server/src/diagnostics_state/drift.rs, crates/mcp-server/src/diagnostics_state/lifecycle.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/ide/src/diagnostics_baseline.rs:289 — `marker != Some(false) && !(scope.is_some() && marker == Some(true))` appears character-identically in 2 files — crates/ide/src/diagnostics_baseline.rs, crates/project-model/src/lib.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/ide-diagnostics/src/handlers/deprecated_current_date.rs:52 — `module_owns_bare_call(name, ctx) || module_owns_bare_call(replacement, ctx)` appears character-identically in 2 files — crates/ide-diagnostics/src/handlers/deprecated_current_date.rs, crates/ide-diagnostics/src/handlers/deprecated_find.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/ide/src/graph.rs:3232 — `name > end || !text.is_char_boundary(name) || !text.is_char_boundary(end)` appears character-identically in 2 files — crates/ide/src/graph.rs, crates/mcp-server/src/graph_query.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/hir-def/src/body/lower/stmt.rs:525 — `name_lower == "этотобъект" || name_lower == "thisobject"` appears character-identically in 2 files — crates/hir-def/src/body/lower/stmt.rs, crates/hir-def/src/call_graph.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.
  • + 13 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on Err · ×20
  • Silent fallback default on Err crates/bsl-conventions/src/tree.rs:67 — `child_names` 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/bsl-conventions/src/tree.rs:82 — `entries` 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/bsl-metadata/src/loader.rs:1294 — `load_enums_parallel` 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/bsl-metadata/src/loader.rs:1320 — `load_constants_parallel` 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/bsl-metadata/src/loader.rs:1353 — `load_registers_parallel` 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/bsl-metadata/src/loader.rs:1410 — `load_event_subscriptions_parallel` 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/bsl-metadata/src/loader.rs:1439 — `load_scheduled_jobs_parallel` 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/bsl-metadata/src/loader.rs:1465 — `load_roles_parallel` 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/bsl-metadata/src/loader.rs:1514 — `load_defined_types_parallel` 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/bsl-metadata/src/loader.rs:1543 — `load_http_services_parallel` 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/bsl-metadata/src/loader.rs:1585 — `load_web_services_parallel` 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/bsl-metadata/src/loader.rs:1627 — `load_integration_services_parallel` 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/bsl-metadata/src/loader.rs:1658 — `load_simple_metadata_objects_parallel` 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 REDACTED:764 — `column_names` 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/mcp-server/src/state/overlay_backlog.rs:482 — `backlog` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/mcp-server/src/graph/snapshot.rs:223 — `on_disk_identity` turns every `Err` into `Ok(Some(OnDiskIdentity::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 REDACTED:661 — `stored_fingerprints_in` turns every `Err` into `std::collections::HashMap::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 REDACTED:723 — `read_stored_observations_in` 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 REDACTED:1118 — `thread_state_summary` turns every `Err` into `"unavailable".to_owned()` — 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/platform-help/src/package.rs:294 — `generation` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×8
  • Projects may be oversized for their cohesion crates/mcp-server/Cargo.toml:1 — `crates/mcp-server` (134917 LoC, 136 module-visible types across 8 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/ide-diagnostics/Cargo.toml:1 — `crates/ide-diagnostics` (89918 LoC, 278 module-visible types across 4 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/bsl-analyzer/Cargo.toml:1 — `crates/bsl-analyzer` (56905 LoC, 220 module-visible types across 15 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/bsl-search/Cargo.toml:1 — `crates/bsl-search` (51947 LoC, 161 module-visible types across 3 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/ide/Cargo.toml:1 — `crates/ide` (34706 LoC, 212 module-visible types across 12 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/hir-def/Cargo.toml:1 — `crates/hir-def` (34467 LoC, 230 module-visible types across 7 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/hir-ty/Cargo.toml:1 — `crates/hir-ty` (32707 LoC, 145 module-visible types across 7 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion crates/bsl-metadata/Cargo.toml:1 — `crates/bsl-metadata` (19217 LoC, 122 module-visible types across 2 directories) overshoots its size bounds. 8 of 49 build unit(s) (Cargo, Python) overshoot their size bounds, lowering Project Cohesion to 6.7/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
X9 · Subsumed condition operand · Subsumed condition operand · ×3
  • Subsumed condition operand crates/mcp-server/src/tools/metadata.rs:2339 — `text.contains("HTTPService.HTTPСервис1")` can never decide this `||` — every value satisfying `text.contains("HTTPService.HTTPСервис1")` also satisfies `text.contains("HTTPСервис1")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/mcp-server/src/tools/metadata.rs:2355 — `text.contains("WebService.WebСервис1")` can never decide this `||` — every value satisfying `text.contains("WebService.WebСервис1")` also satisfies `text.contains("WebСервис1")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand crates/bsl-platform/tools/html-parser/src/scraper_parser.rs:302 — `trimmed.starts_with("Примеры")` can never decide this `||` — every value satisfying `trimmed.starts_with("Примеры")` also satisfies `trimmed.starts_with("Пример")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 39 significant file(s) lose their only recent owner: crates/bsl-platform/tools/html-parser/src/scraper_parser.rs, crates/bsl-analyzer/src/smoke.rs, crates/hir-def/src/ty/doc_types.rs, crates/ide/src/signature_help.rs, crates/hir-def/src/region_tree.rs, crates/ide-diagnostics/src/handlers/magic_number.rs, scripts/test-tier-registry.py, crates/platform-help/src/lib.rs (+31 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 5 significant file(s) lose their only recent owner: crates/bsl-debug/src/types/xml.rs, crates/ide-diagnostics/src/metadata.rs, crates/ide-diagnostics/src/handlers/postfix_access_on_expression.rs, crates/hir-ty/src/call_resolution/candidate_builders.rs, crates/hir-ty/src/call_resolution/tests.rs. Pair on, review, or document these before any departure.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×2
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 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 (47 single-owned of 862 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; 862 of the 985 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (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: crates/ide/src/syntax_highlighting/docs.rs, crates/bsl-platform/src/parameter_series.rs, crates/mcp-server/src/cache_windows.rs.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P10 · Library API & versioning · Implementation type on the public API · ×1
  • Implementation type on the public API crates/ide-db/src/database.rs:95 — 1 public type in `ide_db.database` is marked as implementation by its own namespace, folder or name: `RootDatabaseImpl` (crates/ide-db/src/database.rs:95, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 24/28 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/bsl-check-executor`, `crates/bsl-launcher`, `xtask`.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation Cargo.toml:22 — `Cargo.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate REDACTED:176 — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (crates/mcp-server/src/http.rs:291).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — 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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/mcp-server/src/http.rs:291).
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×1
  • Diagnostic log message is built whether or not it is wanted crates/sdbl-hir/src/lower/from_clause.rs:1210 — `tracing::debug!` at line 1210 is called with an argument built by `parent_obj.tabular_sections.iter().map(|ts|ts.name()).collect::<Vec<_>>()` (line 1216), whose cost grows with the collection it walks. Rust evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because tracing::debug! is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `log_enabled!`/`tracing::enabled!` test, no debug flag, no `cfg(debug_assertions)`, and the work is in the argument itself, not deferred into a field the subscriber formats or a closure the formatter calls.
Minor — 45 finding(s)
D12 · Dependency Hygiene · Outdated · ×44
  • Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: blake3 — `blake3` is locked at 1.8.4 but 1.8.7 is the current stable release on crates.io, and it already satisfies the `"1.8"` requirement declared in crates/bsl-analyzer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p blake3` and commit the updated REDACTED.
  • Outdated: camino — `camino` is locked at 1.2.2 but 1.2.6 is the current stable release on crates.io, and it already satisfies the `"1.1"` requirement declared in crates/paths/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p camino` and commit the updated REDACTED.
  • Outdated: cap-fs-ext — `cap-fs-ext` is locked at 4.0.2 but 4.0.3 is the current stable release on crates.io, and it already satisfies the `"4.0.2"` requirement declared in crates/project-model/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cap-fs-ext` and commit the updated REDACTED.
  • Outdated: cap-std — `cap-std` is locked at 4.0.2 but 4.0.3 is the current stable release on crates.io, and it already satisfies the `"4.0.2"` requirement declared in crates/project-model/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cap-std` and commit the updated REDACTED.
  • Outdated: cfg-if — `cfg-if` is locked at 1.0.4 but 1.0.5 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/profile/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cfg-if` and commit the updated REDACTED.
  • Outdated: chrono — `chrono` is locked at 0.4.44 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/bsl-analyzer/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.6.1 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.4"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
  • Outdated: crossbeam-channel — `crossbeam-channel` is locked at 0.5.15 but 0.5.17 is the current stable release on crates.io, and it already satisfies the `"0.5"` requirement declared in crates/bsl-analyzer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam-channel` and commit the updated REDACTED.
  • Outdated: crossbeam-utils — `crossbeam-utils` is locked at 0.8.21 but 0.8.23 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in crates/stdx/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam-utils` and commit the updated REDACTED.
  • Outdated: either — `either` is locked at 1.15.0 but 1.19.0 is the current stable release on crates.io, and it already satisfies the `"1.9"` requirement declared in crates/ide/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p either` and commit the updated REDACTED.
  • Outdated: fixedbitset — `fixedbitset` is locked at 0.5.7 but 0.5.9 is the current stable release on crates.io, and it already satisfies the `"0.5"` requirement declared in crates/ide-diagnostics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fixedbitset` and commit the updated REDACTED.
  • Outdated: futures-util — `futures-util` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/naparnik/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-util` and commit the updated REDACTED.
  • Outdated: globset — `globset` is locked at 0.4.18 but 0.4.21 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/stdx/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p globset` and commit the updated REDACTED.
  • Outdated: ignore — `ignore` is locked at 0.4.25 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/stdx/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ignore` and commit the updated REDACTED.
  • Outdated: indexmap — `indexmap` is locked at 2.14.0 but 2.14.2 is the current stable release on crates.io, and it already satisfies the `"2.1"` requirement declared in crates/hir-def/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p indexmap` and commit the updated REDACTED.
  • Outdated: interprocess — `interprocess` is locked at 2.4.2 but 2.4.8 is the current stable release on crates.io, and it already satisfies the `"2.4.2"` requirement declared in crates/mcp-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p interprocess` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.185 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/bsl-analyzer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: ordered-float — `ordered-float` is locked at 5.3.0 but 5.5.1 is the current stable release on crates.io, and it already satisfies the `"5.1"` requirement declared in crates/hir-def/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ordered-float` and commit the updated REDACTED.
  • Outdated: postgres — `postgres` is locked at 0.19.13 but 0.19.14 is the current stable release on crates.io, and it already satisfies the `"0.19"` requirement declared in crates/bsl-search/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p postgres` and commit the updated REDACTED.
  • Outdated: regex — `regex` is locked at 1.12.3 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"1.10"` requirement declared in crates/ide-diagnostics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
  • Outdated: reqwest — `reqwest` is locked at 0.13.2 but 0.13.5 is the current stable release on crates.io, and it already satisfies the `"0.13"` requirement declared in crates/bsl-debug/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p reqwest` and commit the updated REDACTED.
  • Outdated: rmcp — `rmcp` is locked at 3.6.0 but 3.10.0 is the current stable release on crates.io, and it already satisfies the `"3.5.1"` requirement declared in crates/mcp-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rmcp` and commit the updated REDACTED.
  • Outdated: roxmltree — `roxmltree` is locked at 0.21.1 but 0.21.2 is the current stable release on crates.io, and it already satisfies the `"0.21"` requirement declared in crates/bsl-metadata/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p roxmltree` and commit the updated REDACTED.
  • Outdated: rustc-hash — `rustc-hash` is locked at 2.1.2 but 2.1.3 is the current stable release on crates.io, and it already satisfies the `"2.0"` requirement declared in crates/base-db/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustc-hash` and commit the updated REDACTED.
  • + 19 more in this group — see findings.md.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: check-contract — check-contract: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-3412734b7a384de98c7f5339be3a5be4/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-3412734b7a384de98c7f5339be3a5be4/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=755" --report-format json --report-path /tmp/watchdog-gitleaks-3412734b7a384de98c7f5339be3a5be4/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-3412734b7a384de98c7f5339be3a5be4/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .55artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .27artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—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.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1e6b1-4008-7743-8332-90f642be00c9 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md