Public report of supabase-community/postgres-language-server, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 19:08 UTC · Survey ID cd_9f3b72aa0ef94e01b6c1fb22c39b6c42
supabase-community/postgres-language-server
Measured 14 November 2026, 19:07 UTC, at code version 645f3a1
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureRanButNoData).
CAI scoreAt riskDown 3 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 129,502 lines of product code in 54 projects, tests not counted · Estimated rebuild effort: about 1.0 person-years · Weakest lens: Security and Compliance, 38
Findings by how serious they are
92 critical769 serious115 minor
15 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 19:07 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 ▸
63of 63 dimensions measured by tools.
915of 976 findings point to an exact file and line, so you can open each one in the code. The other 61 concern the repository as a whole, such as missing documentation.
63dimensions across 7 lenses, read from 129,502 lines of product code in 54 projects.
supabase-community/postgres-language-server is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because we found no encryption of stored data, no key vault and no enforced HTTPS, and it has pipeline tools referenced by a changeable name. It scores 49 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Security and Compliance, at 38, is the weakest lens and counts most in the score. The best first step is encrypting the sensitive stored data and keeping its keys in a vault, worth about 9 points. Recording design decisions comes next, worth about 3 points. Raising Security and Compliance to 68 would lift the score to about 57.
Sixty-seven pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seven secrets can leak from the build pipeline, and five weaknesses in the code could be used by an attacker. Pinning each tool to an exact version, limiting each secret to its own step and fixing the weaknesses the scanner points to would close these risks. Passing outside input through environment variables would fix the four pipeline steps that put outside input straight into a shell command, and the four unsafe settings in infrastructure or container files need changing to safe values. The part of the code nobody has worked on for a long time needs someone to learn and document it before anyone changes it.
The product code is 129,502 lines, about €150,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Security and Compliance rose from 38 to 68, the lowest score rated Strong, the score would rise from 49 to about 57.
Code composition: what the lines of code are
Product code 83%Tests 17%
New since the last survey: 376 findings
These 376 critical or serious findings weren't in the previous survey, on 28 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FunctionTooLong: pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs
God Classes · FunctionTooLong: pgls_pretty_print::nodes::constraint::emit_constraint_of crates/pgls_pretty_print/src/nodes/constraint.rs
God Classes · FunctionTooLong: pgls_pretty_print::nodes::select_stmt::emit_select_stmt crates/pgls_pretty_print/src/nodes/select_stmt.rs
God Classes · FunctionTooLong: pgls_pretty_print::nodes::create_stmt::emit_create_stmt crates/pgls_pretty_print/src/nodes/create_stmt.rs
God Classes · FunctionTooLong: pgls_pretty_print::nodes::clauses::function_options::format_function_option crates/pgls_pretty_print/src/nodes/clauses/function_options.rs
God Classes · FunctionTooLong: pgls_walk::walk::walk_statements crates/pgls_walk/src/walk.rs
God Classes · FunctionTooLong: pgls_workspace::workspace::server::formatting::format_document crates/pgls_workspace/src/workspace/server/formatting.rs
God Classes · FileTooLong: catalog/overlay.rs crates/pgls_catalog/src/catalog/overlay.rs
God Classes · FileTooLong: nodes/alter_table_cmd.rs crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs
God Classes · FunctionTooLong: pgls_pretty_print::nodes::clauses::options::emit_role_option crates/pgls_pretty_print/src/nodes/clauses/options.rs
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 231 findings
These 231 critical or serious findings were in the previous survey, on 28 October 2026, and are gone from this one. The first 100 are listed here.
€48,000 to €240,000, for 805 to 2,554 hours of work, about 1.0 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 49. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 129,502 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs).
Skip if delegated to infra (Postgres TDE, KMS, etc.).
Raises the score by about 9 points · Medium effort · Data Protection
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml.
Raises the score by about 3 points · Low effort · ADR Quality
3
Act on each finding's own remediation rather than one rule: the move depends on what recurs.
Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
Raises the score by about 4 points · Medium effort · Code Duplication
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 €150,000 to build again, about 1.0 person-years of work. Its weakest lens is Security and Compliance, at 38 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Of all the actions in this report, it raises the score most for the work it takes: about 9 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 6% on every change. The history of the code shows how much it changes: about 305,884 lines over the last 90 days, which is about 1,240,530 lines a year. At that pace, the extra work comes to an estimated 89.6 to 537.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
767 modules, with 1416 dependencies between them. 10 loops run through 47 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 727 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.
pgls_catalog.typing.model uses pgls_catalog.lookup, so a change to pgls_catalog.lookup can break pgls_catalog.typing.model, while a change to pgls_catalog.typing.model can't break pgls_catalog.lookup.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pgls_console.markup uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_console.markup, while a change to pgls_console.markup can't break pgls_text_size.size.
Position
Below the diagonal: pgls_console.markup uses a module listed above it, which is the healthy direction.
7→13 pgls_console.markup uses pgls_console.fmtpart of a loop✕
Connections
8 pairs of types, where a type in pgls_console.markup uses a type in pgls_console.fmt.
pgls_console.markup uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_console.markup, while a change to pgls_console.markup can't break pgls_console.fmt.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pgls_text_size.range uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_text_size.range, while a change to pgls_text_size.range can't break pgls_text_size.size.
Position
Below the diagonal: pgls_text_size.range uses a module listed above it, which is the healthy direction.
pgls_treesitter.context uses pgls_query_macros.proto_analyser, so a change to pgls_query_macros.proto_analyser can break pgls_treesitter.context, while a change to pgls_treesitter.context can't break pgls_query_macros.proto_analyser.
Position
Below the diagonal: pgls_treesitter.context uses a module listed above it, which is the healthy direction.
pgls_treesitter.context uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_treesitter.context, while a change to pgls_treesitter.context can't break pgls_text_size.size.
Position
Below the diagonal: pgls_treesitter.context uses a module listed above it, which is the healthy direction.
pgls_catalog.lookup uses pgls_catalog.typing.model, so a change to pgls_catalog.typing.model can break pgls_catalog.lookup, while a change to pgls_catalog.lookup can't break pgls_catalog.typing.model.
Position
Below the diagonal: pgls_catalog.lookup uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve uses pgls_query_macros.proto_analyser, so a change to pgls_query_macros.proto_analyser can break pgls_catalog.resolve, while a change to pgls_catalog.resolve can't break pgls_query_macros.proto_analyser.
Position
Below the diagonal: pgls_catalog.resolve uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_catalog.resolve, while a change to pgls_catalog.resolve can't break pgls_text_size.range.
Position
Below the diagonal: pgls_catalog.resolve uses a module listed above it, which is the healthy direction.
pgls_completions.builder uses pgls_treesitter.context, so a change to pgls_treesitter.context can break pgls_completions.builder, while a change to pgls_completions.builder can't break pgls_treesitter.context.
Position
Below the diagonal: pgls_completions.builder uses a module listed above it, which is the healthy direction.
pgls_console.fmt uses pgls_console.markup, so a change to pgls_console.markup can break pgls_console.fmt, while a change to pgls_console.fmt can't break pgls_console.markup.
Position
Below the diagonal: pgls_console.fmt uses a module listed above it, which is the healthy direction.
pgls_diagnostics.location uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_diagnostics.location, while a change to pgls_diagnostics.location can't break pgls_text_size.size.
Position
Below the diagonal: pgls_diagnostics.location uses a module listed above it, which is the healthy direction.
pgls_diagnostics.location uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_diagnostics.location, while a change to pgls_diagnostics.location can't break pgls_text_size.range.
Position
Below the diagonal: pgls_diagnostics.location uses a module listed above it, which is the healthy direction.
pgls_hover.hoverables uses pgls_catalog.snapshot, so a change to pgls_catalog.snapshot can break pgls_hover.hoverables, while a change to pgls_hover.hoverables can't break pgls_catalog.snapshot.
Position
Below the diagonal: pgls_hover.hoverables uses a module listed above it, which is the healthy direction.
pgls_hover.hoverables uses pgls_treesitter.context, so a change to pgls_treesitter.context can break pgls_hover.hoverables, while a change to pgls_hover.hoverables can't break pgls_treesitter.context.
Position
Below the diagonal: pgls_hover.hoverables uses a module listed above it, which is the healthy direction.
pgls_text_edit uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_text_edit, while a change to pgls_text_edit can't break pgls_text_size.range.
Position
Below the diagonal: pgls_text_edit uses a module listed above it, which is the healthy direction.
pgls_workspace.features.code_actions uses pgls_fs.path, so a change to pgls_fs.path can break pgls_workspace.features.code_actions, while a change to pgls_workspace.features.code_actions can't break pgls_fs.path.
Position
Below the diagonal: pgls_workspace.features.code_actions uses a module listed above it, which is the healthy direction.
pgls_workspace.features.code_actions uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_workspace.features.code_actions, while a change to pgls_workspace.features.code_actions can't break pgls_text_size.size.
Position
Below the diagonal: pgls_workspace.features.code_actions uses a module listed above it, which is the healthy direction.
pgls_workspace.features.code_actions uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_workspace.features.code_actions, while a change to pgls_workspace.features.code_actions can't break pgls_text_size.range.
Position
Below the diagonal: pgls_workspace.features.code_actions uses a module listed above it, which is the healthy direction.
17→28 pgls_workspace.features.code_actions uses pgls_workspace.workspacepart of a loop✕
Connections
1 pair of types, where a type in pgls_workspace.features.code_actions uses a type in pgls_workspace.workspace.
pgls_workspace.features.code_actions uses pgls_workspace.workspace, so a change to pgls_workspace.workspace can break pgls_workspace.features.code_actions, while a change to pgls_workspace.features.code_actions can't break pgls_workspace.workspace.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pgls_analyse.filter uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_analyse.filter, while a change to pgls_analyse.filter can't break pgls_console.fmt.
Position
Below the diagonal: pgls_analyse.filter uses a module listed above it, which is the healthy direction.
pgls_catalog.catalog uses pgls_catalog.snapshot, so a change to pgls_catalog.snapshot can break pgls_catalog.catalog, while a change to pgls_catalog.catalog can't break pgls_catalog.snapshot.
Position
Below the diagonal: pgls_catalog.catalog uses a module listed above it, which is the healthy direction.
pgls_catalog.catalog uses pgls_query_macros.proto_analyser, so a change to pgls_query_macros.proto_analyser can break pgls_catalog.catalog, while a change to pgls_catalog.catalog can't break pgls_query_macros.proto_analyser.
Position
Below the diagonal: pgls_catalog.catalog uses a module listed above it, which is the healthy direction.
pgls_catalog.catalog uses pgls_catalog.typing.model, so a change to pgls_catalog.typing.model can break pgls_catalog.catalog, while a change to pgls_catalog.catalog can't break pgls_catalog.typing.model.
Position
Below the diagonal: pgls_catalog.catalog uses a module listed above it, which is the healthy direction.
pgls_catalog.catalog uses pgls_catalog.lookup, so a change to pgls_catalog.lookup can break pgls_catalog.catalog, while a change to pgls_catalog.catalog can't break pgls_catalog.lookup.
Position
Below the diagonal: pgls_catalog.catalog uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.scope uses pgls_catalog.typing.model, so a change to pgls_catalog.typing.model can break pgls_catalog.resolve.scope, while a change to pgls_catalog.resolve.scope can't break pgls_catalog.typing.model.
Position
Below the diagonal: pgls_catalog.resolve.scope uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.scope uses pgls_catalog.lookup, so a change to pgls_catalog.lookup can break pgls_catalog.resolve.scope, while a change to pgls_catalog.resolve.scope can't break pgls_catalog.lookup.
Position
Below the diagonal: pgls_catalog.resolve.scope uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.scope uses pgls_catalog.resolve, so a change to pgls_catalog.resolve can break pgls_catalog.resolve.scope, while a change to pgls_catalog.resolve.scope can't break pgls_catalog.resolve.
Position
Below the diagonal: pgls_catalog.resolve.scope uses a module listed above it, which is the healthy direction.
20→25 pgls_catalog.resolve.scope uses pgls_catalog.resolve.resolverpart of a loop✕
Connections
1 pair of types, where a type in pgls_catalog.resolve.scope uses a type in pgls_catalog.resolve.resolver.
pgls_catalog.resolve.scope uses pgls_catalog.resolve.resolver, so a change to pgls_catalog.resolve.resolver can break pgls_catalog.resolve.scope, while a change to pgls_catalog.resolve.scope can't break pgls_catalog.resolve.resolver.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pgls_diagnostics.advice uses pgls_diagnostics.location, so a change to pgls_diagnostics.location can break pgls_diagnostics.advice, while a change to pgls_diagnostics.advice can't break pgls_diagnostics.location.
Position
Below the diagonal: pgls_diagnostics.advice uses a module listed above it, which is the healthy direction.
pgls_diagnostics.advice uses pgls_text_edit, so a change to pgls_text_edit can break pgls_diagnostics.advice, while a change to pgls_diagnostics.advice can't break pgls_text_edit.
Position
Below the diagonal: pgls_diagnostics.advice uses a module listed above it, which is the healthy direction.
pgls_diagnostics.display.frame uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_diagnostics.display.frame, while a change to pgls_diagnostics.display.frame can't break pgls_text_size.size.
Position
Below the diagonal: pgls_diagnostics.display.frame uses a module listed above it, which is the healthy direction.
pgls_diagnostics.display.frame uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_diagnostics.display.frame, while a change to pgls_diagnostics.display.frame can't break pgls_text_size.range.
Position
Below the diagonal: pgls_diagnostics.display.frame uses a module listed above it, which is the healthy direction.
pgls_diagnostics.display.frame uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_diagnostics.display.frame, while a change to pgls_diagnostics.display.frame can't break pgls_console.fmt.
Position
Below the diagonal: pgls_diagnostics.display.frame uses a module listed above it, which is the healthy direction.
pgls_diagnostics.display.frame uses pgls_diagnostics.location, so a change to pgls_diagnostics.location can break pgls_diagnostics.display.frame, while a change to pgls_diagnostics.display.frame can't break pgls_diagnostics.location.
Position
Below the diagonal: pgls_diagnostics.display.frame uses a module listed above it, which is the healthy direction.
pgls_diagnostics.display.message uses pgls_console.markup, so a change to pgls_console.markup can break pgls_diagnostics.display.message, while a change to pgls_diagnostics.display.message can't break pgls_console.markup.
Position
Below the diagonal: pgls_diagnostics.display.message uses a module listed above it, which is the healthy direction.
pgls_diagnostics.display.message uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_diagnostics.display.message, while a change to pgls_diagnostics.display.message can't break pgls_console.fmt.
Position
Below the diagonal: pgls_diagnostics.display.message uses a module listed above it, which is the healthy direction.
pgls_diagnostics_categories uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_diagnostics_categories, while a change to pgls_diagnostics_categories can't break pgls_console.fmt.
Position
Below the diagonal: pgls_diagnostics_categories uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.resolver uses pgls_query_macros.proto_analyser, so a change to pgls_query_macros.proto_analyser can break pgls_catalog.resolve.resolver, while a change to pgls_catalog.resolve.resolver can't break pgls_query_macros.proto_analyser.
Position
Below the diagonal: pgls_catalog.resolve.resolver uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.resolver uses pgls_catalog.typing.model, so a change to pgls_catalog.typing.model can break pgls_catalog.resolve.resolver, while a change to pgls_catalog.resolve.resolver can't break pgls_catalog.typing.model.
Position
Below the diagonal: pgls_catalog.resolve.resolver uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.resolver uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_catalog.resolve.resolver, while a change to pgls_catalog.resolve.resolver can't break pgls_text_size.range.
Position
Below the diagonal: pgls_catalog.resolve.resolver uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.resolver uses pgls_catalog.lookup, so a change to pgls_catalog.lookup can break pgls_catalog.resolve.resolver, while a change to pgls_catalog.resolve.resolver can't break pgls_catalog.lookup.
Position
Below the diagonal: pgls_catalog.resolve.resolver uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.resolver uses pgls_catalog.resolve, so a change to pgls_catalog.resolve can break pgls_catalog.resolve.resolver, while a change to pgls_catalog.resolve.resolver can't break pgls_catalog.resolve.
Position
Below the diagonal: pgls_catalog.resolve.resolver uses a module listed above it, which is the healthy direction.
pgls_catalog.resolve.resolver uses pgls_catalog.resolve.scope, so a change to pgls_catalog.resolve.scope can break pgls_catalog.resolve.resolver, while a change to pgls_catalog.resolve.resolver can't break pgls_catalog.resolve.scope.
Position
Below the diagonal: pgls_catalog.resolve.resolver uses a module listed above it, which is the healthy direction.
pgls_configuration.utils.string_set uses pgls_diagnostics.display.frame, so a change to pgls_diagnostics.display.frame can break pgls_configuration.utils.string_set, while a change to pgls_configuration.utils.string_set can't break pgls_diagnostics.display.frame.
Position
Below the diagonal: pgls_configuration.utils.string_set uses a module listed above it, which is the healthy direction.
pgls_diagnostics.diagnostic uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_diagnostics.diagnostic, while a change to pgls_diagnostics.diagnostic can't break pgls_console.fmt.
Position
Below the diagonal: pgls_diagnostics.diagnostic uses a module listed above it, which is the healthy direction.
pgls_diagnostics.diagnostic uses pgls_diagnostics.location, so a change to pgls_diagnostics.location can break pgls_diagnostics.diagnostic, while a change to pgls_diagnostics.diagnostic can't break pgls_diagnostics.location.
Position
Below the diagonal: pgls_diagnostics.diagnostic uses a module listed above it, which is the healthy direction.
pgls_diagnostics.diagnostic uses pgls_diagnostics_categories, so a change to pgls_diagnostics_categories can break pgls_diagnostics.diagnostic, while a change to pgls_diagnostics.diagnostic can't break pgls_diagnostics_categories.
Position
Below the diagonal: pgls_diagnostics.diagnostic uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace uses pgls_fs.path, so a change to pgls_fs.path can break pgls_workspace.workspace, while a change to pgls_workspace.workspace can't break pgls_fs.path.
Position
Below the diagonal: pgls_workspace.workspace uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace uses pgls_workspace.features.code_actions, so a change to pgls_workspace.features.code_actions can break pgls_workspace.workspace, while a change to pgls_workspace.workspace can't break pgls_workspace.features.code_actions.
Position
Below the diagonal: pgls_workspace.workspace uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace uses pgls_catalog.resolve.scope, so a change to pgls_catalog.resolve.scope can break pgls_workspace.workspace, while a change to pgls_workspace.workspace can't break pgls_catalog.resolve.scope.
Position
Below the diagonal: pgls_workspace.workspace uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_rule uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_text_size.size.
Position
Below the diagonal: pgls_analyser.linter_rule uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_rule uses pgls_console.markup, so a change to pgls_console.markup can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_console.markup.
Position
Below the diagonal: pgls_analyser.linter_rule uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_rule uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_text_size.range.
Position
Below the diagonal: pgls_analyser.linter_rule uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_rule uses pgls_diagnostics.advice, so a change to pgls_diagnostics.advice can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_diagnostics.advice.
Position
Below the diagonal: pgls_analyser.linter_rule uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_rule uses pgls_diagnostics.display.message, so a change to pgls_diagnostics.display.message can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_diagnostics.display.message.
Position
Below the diagonal: pgls_analyser.linter_rule uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_rule uses pgls_diagnostics_categories, so a change to pgls_diagnostics_categories can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_diagnostics_categories.
Position
Below the diagonal: pgls_analyser.linter_rule uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_rule uses pgls_diagnostics.diagnostic, so a change to pgls_diagnostics.diagnostic can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_diagnostics.diagnostic.
Position
Below the diagonal: pgls_analyser.linter_rule uses a module listed above it, which is the healthy direction.
29→37 pgls_analyser.linter_rule uses pgls_analyser.linter_contextpart of a loop✕
Connections
1 pair of types, where a type in pgls_analyser.linter_rule uses a type in pgls_analyser.linter_context.
pgls_analyser.linter_rule uses pgls_analyser.linter_context, so a change to pgls_analyser.linter_context can break pgls_analyser.linter_rule, while a change to pgls_analyser.linter_rule can't break pgls_analyser.linter_context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pgls_configuration uses pgls_configuration.utils.string_set, so a change to pgls_configuration.utils.string_set can break pgls_configuration, while a change to pgls_configuration can't break pgls_configuration.utils.string_set.
Position
Below the diagonal: pgls_configuration uses a module listed above it, which is the healthy direction.
pgls_diagnostics.error uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_diagnostics.error, while a change to pgls_diagnostics.error can't break pgls_console.fmt.
Position
Below the diagonal: pgls_diagnostics.error uses a module listed above it, which is the healthy direction.
pgls_diagnostics.error uses pgls_diagnostics.location, so a change to pgls_diagnostics.location can break pgls_diagnostics.error, while a change to pgls_diagnostics.error can't break pgls_diagnostics.location.
Position
Below the diagonal: pgls_diagnostics.error uses a module listed above it, which is the healthy direction.
pgls_diagnostics.error uses pgls_diagnostics_categories, so a change to pgls_diagnostics_categories can break pgls_diagnostics.error, while a change to pgls_diagnostics.error can't break pgls_diagnostics_categories.
Position
Below the diagonal: pgls_diagnostics.error uses a module listed above it, which is the healthy direction.
pgls_diagnostics.error uses pgls_diagnostics.diagnostic, so a change to pgls_diagnostics.diagnostic can break pgls_diagnostics.error, while a change to pgls_diagnostics.error can't break pgls_diagnostics.diagnostic.
Position
Below the diagonal: pgls_diagnostics.error uses a module listed above it, which is the healthy direction.
pgls_workspace.settings uses pgls_fs.path, so a change to pgls_fs.path can break pgls_workspace.settings, while a change to pgls_workspace.settings can't break pgls_fs.path.
Position
Below the diagonal: pgls_workspace.settings uses a module listed above it, which is the healthy direction.
pgls_workspace.settings uses pgls_console.fmt, so a change to pgls_console.fmt can break pgls_workspace.settings, while a change to pgls_workspace.settings can't break pgls_console.fmt.
Position
Below the diagonal: pgls_workspace.settings uses a module listed above it, which is the healthy direction.
pgls_workspace.settings uses pgls_diagnostics_categories, so a change to pgls_diagnostics_categories can break pgls_workspace.settings, while a change to pgls_workspace.settings can't break pgls_diagnostics_categories.
Position
Below the diagonal: pgls_workspace.settings uses a module listed above it, which is the healthy direction.
pgls_workspace.settings uses pgls_configuration.utils.string_set, so a change to pgls_configuration.utils.string_set can break pgls_workspace.settings, while a change to pgls_workspace.settings can't break pgls_configuration.utils.string_set.
Position
Below the diagonal: pgls_workspace.settings uses a module listed above it, which is the healthy direction.
pgls_workspace.settings uses pgls_diagnostics.diagnostic, so a change to pgls_diagnostics.diagnostic can break pgls_workspace.settings, while a change to pgls_workspace.settings can't break pgls_diagnostics.diagnostic.
Position
Below the diagonal: pgls_workspace.settings uses a module listed above it, which is the healthy direction.
pgls_workspace.settings uses pgls_workspace.workspace, so a change to pgls_workspace.workspace can break pgls_workspace.settings, while a change to pgls_workspace.settings can't break pgls_workspace.workspace.
Position
Below the diagonal: pgls_workspace.settings uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server.document uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_workspace.workspace.server.document, while a change to pgls_workspace.workspace.server.document can't break pgls_text_size.size.
Position
Below the diagonal: pgls_workspace.workspace.server.document uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server.document uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_workspace.workspace.server.document, while a change to pgls_workspace.workspace.server.document can't break pgls_text_size.range.
Position
Below the diagonal: pgls_workspace.workspace.server.document uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server.document uses pgls_catalog.resolve.scope, so a change to pgls_catalog.resolve.scope can break pgls_workspace.workspace.server.document, while a change to pgls_workspace.workspace.server.document can't break pgls_catalog.resolve.scope.
Position
Below the diagonal: pgls_workspace.workspace.server.document uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server.document uses pgls_workspace.workspace, so a change to pgls_workspace.workspace can break pgls_workspace.workspace.server.document, while a change to pgls_workspace.workspace.server.document can't break pgls_workspace.workspace.
Position
Below the diagonal: pgls_workspace.workspace.server.document uses a module listed above it, which is the healthy direction.
pgls_analyser.fix uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_analyser.fix, while a change to pgls_analyser.fix can't break pgls_text_size.range.
Position
Below the diagonal: pgls_analyser.fix uses a module listed above it, which is the healthy direction.
pgls_analyser.fix uses pgls_analyser.linter_rule, so a change to pgls_analyser.linter_rule can break pgls_analyser.fix, while a change to pgls_analyser.fix can't break pgls_analyser.linter_rule.
Position
Below the diagonal: pgls_analyser.fix uses a module listed above it, which is the healthy direction.
34→37 pgls_analyser.fix uses pgls_analyser.linter_contextpart of a loop✕
Connections
1 pair of types, where a type in pgls_analyser.fix uses a type in pgls_analyser.linter_context.
pgls_analyser.fix uses pgls_analyser.linter_context, so a change to pgls_analyser.linter_context can break pgls_analyser.fix, while a change to pgls_analyser.fix can't break pgls_analyser.linter_context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pgls_cli.reporter uses pgls_diagnostics.diagnostic, so a change to pgls_diagnostics.diagnostic can break pgls_cli.reporter, while a change to pgls_cli.reporter can't break pgls_diagnostics.diagnostic.
Position
Below the diagonal: pgls_cli.reporter uses a module listed above it, which is the healthy direction.
pgls_cli.reporter uses pgls_diagnostics.error, so a change to pgls_diagnostics.error can break pgls_cli.reporter, while a change to pgls_cli.reporter can't break pgls_diagnostics.error.
Position
Below the diagonal: pgls_cli.reporter uses a module listed above it, which is the healthy direction.
pgls_lsp.session uses pgls_workspace.workspace, so a change to pgls_workspace.workspace can break pgls_lsp.session, while a change to pgls_lsp.session can't break pgls_workspace.workspace.
Position
Below the diagonal: pgls_lsp.session uses a module listed above it, which is the healthy direction.
pgls_lsp.session uses pgls_configuration, so a change to pgls_configuration can break pgls_lsp.session, while a change to pgls_lsp.session can't break pgls_configuration.
Position
Below the diagonal: pgls_lsp.session uses a module listed above it, which is the healthy direction.
pgls_lsp.session uses pgls_workspace.settings, so a change to pgls_workspace.settings can break pgls_lsp.session, while a change to pgls_lsp.session can't break pgls_workspace.settings.
Position
Below the diagonal: pgls_lsp.session uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_context uses pgls_catalog.resolve, so a change to pgls_catalog.resolve can break pgls_analyser.linter_context, while a change to pgls_analyser.linter_context can't break pgls_catalog.resolve.
Position
Below the diagonal: pgls_analyser.linter_context uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_context uses pgls_catalog.catalog, so a change to pgls_catalog.catalog can break pgls_analyser.linter_context, while a change to pgls_analyser.linter_context can't break pgls_catalog.catalog.
Position
Below the diagonal: pgls_analyser.linter_context uses a module listed above it, which is the healthy direction.
pgls_analyser.linter_context uses pgls_analyser.fix, so a change to pgls_analyser.fix can break pgls_analyser.linter_context, while a change to pgls_analyser.linter_context can't break pgls_analyser.fix.
Position
Below the diagonal: pgls_analyser.linter_context uses a module listed above it, which is the healthy direction.
pgls_cli uses pgls_workspace.workspace, so a change to pgls_workspace.workspace can break pgls_cli, while a change to pgls_cli can't break pgls_workspace.workspace.
Position
Below the diagonal: pgls_cli uses a module listed above it, which is the healthy direction.
pgls_cli uses pgls_workspace.settings, so a change to pgls_workspace.settings can break pgls_cli, while a change to pgls_cli can't break pgls_workspace.settings.
Position
Below the diagonal: pgls_cli uses a module listed above it, which is the healthy direction.
pgls_analyser uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_analyser, while a change to pgls_analyser can't break pgls_text_size.size.
Position
Below the diagonal: pgls_analyser uses a module listed above it, which is the healthy direction.
pgls_analyser uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_analyser, while a change to pgls_analyser can't break pgls_text_size.range.
Position
Below the diagonal: pgls_analyser uses a module listed above it, which is the healthy direction.
pgls_analyser uses pgls_analyse.filter, so a change to pgls_analyse.filter can break pgls_analyser, while a change to pgls_analyser can't break pgls_analyse.filter.
Position
Below the diagonal: pgls_analyser uses a module listed above it, which is the healthy direction.
pgls_analyser uses pgls_analyser.linter_rule, so a change to pgls_analyser.linter_rule can break pgls_analyser, while a change to pgls_analyser can't break pgls_analyser.linter_rule.
Position
Below the diagonal: pgls_analyser uses a module listed above it, which is the healthy direction.
pgls_analyser uses pgls_analyser.linter_context, so a change to pgls_analyser.linter_context can break pgls_analyser, while a change to pgls_analyser can't break pgls_analyser.linter_context.
Position
Below the diagonal: pgls_analyser uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_catalog.snapshot, so a change to pgls_catalog.snapshot can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_catalog.snapshot.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_fs.path, so a change to pgls_fs.path can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_fs.path.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_text_size.size, so a change to pgls_text_size.size can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_text_size.size.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_text_size.range, so a change to pgls_text_size.range can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_text_size.range.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_workspace.features.code_actions, so a change to pgls_workspace.features.code_actions can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_workspace.features.code_actions.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_workspace.workspace, so a change to pgls_workspace.workspace can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_workspace.workspace.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_analyser.linter_rule, so a change to pgls_analyser.linter_rule can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_analyser.linter_rule.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_workspace.settings, so a change to pgls_workspace.settings can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_workspace.settings.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_workspace.workspace.server.document, so a change to pgls_workspace.workspace.server.document can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_workspace.workspace.server.document.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
pgls_workspace.workspace.server uses pgls_analyser.linter_context, so a change to pgls_analyser.linter_context can break pgls_workspace.workspace.server, while a change to pgls_workspace.workspace.server can't break pgls_analyser.linter_context.
Position
Below the diagonal: pgls_workspace.workspace.server uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 42% · Weak · gated by D2, R10, X4 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
90
High / Critical
A03:2025 — Software Supply Chain Failures
26
High / Critical
A02:2025 — Security Misconfiguration
10
High / Critical
Roadmap
Top priorities: Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Skip if delegated to infra (Postgres TDE, KMS, etc.); Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Skip if delegated to infra (Postgres TDE, KMS, etc.).
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
Resolve the 4 REDACTED finding(s) charged to Static Analysis (SAST) — the other 63 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once.
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 — 92
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 — 769
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 — 115
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 15
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 63 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 — 63 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 915 of 976 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 86 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 89 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for packages/@postgres-language-server/backend-jsonrpc/ failed in the analyzer sandbox (npm error code EINVALIDTAGNAME), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the bun:test suite in packages/@postgres-language-server/backend-jsonrpc/ was NOT MEASURED: the dependency install for packages/@postgres-language-server/backend-jsonrpc/ failed in the analyzer sandbox (npm error code EINVALIDTAGNAME), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the bun:test suite in packages/@postgres-language-server/cli/ was NOT MEASURED: the dependency install for packages/@postgres-language-server/cli/ failed in the analyzer sandbox (npm error code EINVALIDTAGNAME), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the bun:test suite in packages/@postgres-language-server/wasm/ was NOT MEASURED: the dependency install for packages/@postgres-language-server/wasm/ failed in the analyzer sandbox (npm error code EINVALIDTAGNAME), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the bun:test suite in packages/@postgrestools/backend-jsonrpc/ was NOT MEASURED: the dependency install for packages/@postgrestools/backend-jsonrpc/ failed in the analyzer sandbox (npm error code EINVALIDTAGNAME), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the bun:test suite in packages/@postgrestools/postgrestools/ was NOT MEASURED: the dependency install for packages/@postgrestools/postgrestools/ failed in the analyzer sandbox (npm error code EINVALIDTAGNAME), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the node:test suite in crates/pgls_treesitter_grammar/ was NOT MEASURED: the node:test run in crates/pgls_treesitter_grammar/ produced no per-test report (> pgt-treesitter-grammar@0.0.0 test). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (docker-compose.yml). compose up failed (exit 17 — an image could not be built) — failed to solve: process "/bin/sh -c apt-get update && apt-get install -y postgresql-server-dev-15 gcc make git curl pkg-config libssl-dev libclang-dev clang libicu-dev openssl && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100; runtime evidence skipped.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Rust, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Rust, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X26 Unsynchronised callback handoff — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Kotlin, Scala, Go, Swift, Python and Ruby source only, and no C# was loaded, no Java, Kotlin, Scala, Go, Swift, Python or Ruby was found, and this repository's C is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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. 28 further occurrence(s) are not listed individually; the score already reflects all 68.
Repo exclusion declarations: 7 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
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.
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.
98 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of at 141. A further 18 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 pgls_pretty_print::nodes::emit_node_enum at 272 — they are counted neither in the figure above nor in this dimension's score. 13 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/pgls_pretty_print/src/nodes/mod.rs (pgls_pretty_print::nodes::emit_node_enum at 272), crates/pgls_analyser/src/utils.rs (pgls_analyser::utils::object_type_noun at 44), crates/pgls_pretty_print/src/nodes/clauses/object_type.rs (pgls_pretty_print::nodes::clauses::object_type::object_type_keywords at 44), crates/pgls_typecheck/src/typed_identifier.rs (pgls_typecheck::typed_identifier::resolve_default_value at 31), crates/pgls_catalog/src/catalog/ddl/mod.rs (Catalog::apply at 27), and 8 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.
+ 25 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of (cyclomatic 141), pgls_pretty_print::normalize::clear_location (cyclomatic 106), pgls_pretty_print::nodes::constraint::emit_constraint_of (cyclomatic 75). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 5.7 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
166 method(s) exceeded the cognitive complexity threshold of 15; the worst was pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of at 206.
+ 42 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of (cognitive 206), pgls_pretty_print::nodes::constraint::emit_constraint_of (cognitive 123). — 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 2 together lifts Cognitive Complexity from 3.9 to about 4.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.4 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 29 FunctionTooLong finding(s) in God Classes — start with mod.rs (2), alter_table_cmd.rs, constraint.rs. — One of this dimension's main actionable groups (29 warning-level).
Resolve the 9 FileTooLong finding(s) in God Classes — start with REDACTED, server.rs, mod.rs. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 5 TooManyMethods finding(s) in God Classes — start with mod.rs, session.rs, emitter.rs. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
155 duplicated block group(s) detected. 4.9 % of the production lines (6,290 of 129,502) are in a reported copy. A further 100 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 94 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 14 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with index_elem.rs (2), attrs.rs, diff.rs. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 14 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with markup.rs, a_expr.rs, aggref.rs. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 12 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with overlay.rs, frame.rs, display_github.rs. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.9 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
54 production modules (Cargo+npm), 0 dependency cycle(s), 6 unstable depended-on module(s). Read from the build's own module declarations; 7 module(s) off the main sequence, with abstractness counted on 42 of the 54 (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: pgls_tokenizer · ×7
Unstable project pgls_cli
Unstable project pgls_lsp
Unstable project pgls_plpgsql_check
Unstable project pgls_suppressions
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project pgls_cli finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project pgls_lsp finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with os.rs, statement.rs, linter_rule.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.
Do you agree with this assessment?
D10 · Test Quality9.8 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
1 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 86 tests. Measured on the JavaScript/TypeScript suite only — at least 89 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
33 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 · ×33
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 465 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry) and package.json, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: crates/pgls_workspace/src/workspace/server.rs (64×16=1024); crates/pgls_pretty_print/src/nodes/select_stmt.rs (15×55=825); crates/pgls_pretty_print/src/nodes/constraint.rs (11×75=825) Repeated repair below the complexity floor: crates/pgls_pretty_print/src/emitter.rs (15 of 19 changes were fixes); crates/pgls_pretty_print/src/nodes/mod.rs (11 of 19 changes were fixes); crates/pgls_pretty_print/src/renderer.rs (11 of 18 changes were fixes)
Resolve the 53 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (4), select_stmt.rs (2), create_stmt.rs (2). — One of this dimension's main actionable groups (53 warning-level).
Resolve the 44 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (4), lib.rs (2), REDACTED (2). — One of this dimension's main actionable groups (44 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor6.0 / 10Adequate✓ 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.
170 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/pgls_catalog/src/catalog/tests.rs. Counted over 421 of the 848 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
18 deducted task-comment markers across 129502 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 16 TodoComment finding(s) in Explicit Debt — start with transport.ts (4), glue.rs (3), client.rs. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 2 HackComment finding(s) in Explicit Debt — start with range.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.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 144 document(s) read across 7 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
doc comments repeat the namespackages/@postgres-language-server/wasm/src/lsp.ts:72
What to do
Resolve the 1 redundant comment finding(s) in Comment Value — start with generate-packages.mjs. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
3 of 52 build units (Cargo, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
90 finding(s): 0 critical, 86 high, 4 medium, 0 low. 63 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. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 8 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (2). — One of this dimension's main actionable groups (7 issue-level).
Resolve the 4 REDACTED finding(s) charged to Static Analysis (SAST) — the other 63 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (67 issue-level, 4 of them charged here).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 5 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
Resolve the 5 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 4 High IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 5 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
7 of 421 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/pgls_text_size/src/text_range_replacement.rs. Counted over 421 of the 848 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with text_range_replacement.rs. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 6 Orphaned file finding(s) in Knowledge Freshness — start with insert_columns.rs, function.rs, helper.rs. — One of this dimension's main actionable groups (6 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 7 Change coupling finding(s) in Change Coupling — start with mod.rs (3), document.rs, filtering.rs. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with server.rs, mod.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — 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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 4 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Do you agree with this assessment?
C1 · Data Protection0.0 / 10Critical✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
No encryption usage (RustCrypto's aes-gcm/chacha20poly1305 encrypting, ring or aws-lc-rs aead sealing, orion, libsodium's secretbox, openssl symm, age, SQLCipher keyed by PRAGMA key, pgcrypto, MongoDB client-side field-level encryption, the OS keyring) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore. — crates/pgls_plpgsql_check/src/lib.rs:777
What to do
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Skip if delegated to infra (Postgres TDE, KMS, etc.).
Enforce HTTPS on the server that receives this data: terminate TLS in it (axum-server/actix bind_rustls, tonic ServerTlsConfig, a tokio-rustls acceptor) and send Strict-Transport-Security, or run it behind a TLS-terminating proxy, so data in transit is always encrypted.
Do you agree with this assessment?
C3 · Audit Trail7.5 / 10Strong✓ Tool-verified
Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.
An audit mechanism is present, but the trail is not yet complete — missing: an audit-log / audit-trail table or model to write to, per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).
What to do
Back the audit convention with a structural mechanism: a SeaORM ActiveModelBehavior before_save/after_save hook or a database trigger writing each sensitive change to an audit-log table, with the acting user and time on every entry.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability5.5 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 7/14 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/pgls_postgres_regress`, `crates/pgls_test_utils`, `docs/codegen`, `packages/@postgres-language-server/cli`, `packages/@postgrestools/postgrestools` and 2 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
`package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:5
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
Readiness · Performance — Whether 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.
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.
`readFileSync` in `loadWasm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/@postgres-language-server/wasm/src/common.ts:50
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety6.3 / 10Adequate✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
17 typed · 10 plain JS — the untyped files are REDACTED, packages/@postgres-language-server/backend-jsonrpc/tests/transport.test.mjs, packages/@postgres-language-server/backend-jsonrpc/tests/workspace.test.mjs, packages/@postgres-language-server/cli/scripts/generate-packages.mjs, packages/@postgres-language-server/cli/test/bin.test.js, packages/@postgres-language-server/wasm/e2e/lsp-worker.js (+4 more).
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
6 duplicated blocks under packages/ have copies in at least two of the sibling directories @postgres-language-server, @postgrestools — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/@postgres-language-server/cli/scripts/generate-packages.mjs:7
packages/@postgres-language-server/cli/scripts/generate-packages.mjs:7 · packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:7 — the two spans are one implementation copied and then locally edited — 1387 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/@postgres-language-server/cli/scripts/generate-packages.mjs:7
packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:1 · packages/@postgrestools/backend-jsonrpc/src/transport.ts:1 — these 2 files are line-for-line copies of one another — 144 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:1
packages/@postgres-language-server/backend-jsonrpc/src/command.ts:8 · packages/@postgrestools/backend-jsonrpc/src/command.ts:8 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/@postgres-language-server/backend-jsonrpc/src/command.ts:8
packages/@postgres-language-server/backend-jsonrpc/src/socket.ts:4 · packages/@postgrestools/backend-jsonrpc/src/socket.ts:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/@postgres-language-server/backend-jsonrpc/src/socket.ts:4
packages/@postgres-language-server/backend-jsonrpc/src/index.ts:12 · packages/@postgrestools/backend-jsonrpc/src/index.ts:12 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/@postgres-language-server/backend-jsonrpc/src/index.ts:12
REDACTED:976 · REDACTED:2702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `grammar(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything. — REDACTED:976
REDACTED:2589 · REDACTED:3612 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:2589
packages/@postgres-language-server/wasm/src/workspace.ts:53 · packages/@postgres-language-server/wasm/src/workspace.ts:77 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/@postgres-language-server/wasm/src/workspace.ts:53
REDACTED:3827 · REDACTED:3839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:3827
REDACTED:2427 · REDACTED:2538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `grammar(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything. — REDACTED:2427
REDACTED:590 · REDACTED:608 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:590
REDACTED:3169 · REDACTED:3359 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:3169
REDACTED:1328 · REDACTED:2548 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:1328
REDACTED:3359 · REDACTED:3369 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:3359
REDACTED:1623 · REDACTED:2048 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:1623
packages/@postgres-language-server/wasm/src/lsp.ts:58 · packages/@postgres-language-server/wasm/src/workspace.ts:59 · packages/@postgres-language-server/wasm/src/workspace.ts:87 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/@postgres-language-server/wasm/src/lsp.ts:58
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
Do you agree with this assessment?
R3 · Large Files7.6 / 10Strong✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
REDACTED has 3923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage7.3 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×4) — REDACTED:1, packages/@postgres-language-server/cli/scripts/generate-packages.mjs:1, packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
2 file(s) (~371 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — packages/@postgres-language-server/cli
2 file(s) (~355 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — packages/@postgrestools/postgrestools
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/5 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`downloadSchema` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:41, packages/@postgres-language-server/cli/scripts/generate-packages.mjs:41
`downloadBinary` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:63, packages/@postgres-language-server/cli/scripts/generate-packages.mjs:88
`downloadWasmAssets` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/@postgres-language-server/cli/scripts/generate-packages.mjs:63
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`trace!` at line 108 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/pgls_workspace/src/settings.rs:108
`warn!` at line 971 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/pgls_workspace/src/settings.rs:971
`warn!` at line 1006 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/pgls_workspace/src/settings.rs:1006
`debug!` at line 249 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/pgls_workspace/src/workspace/server.rs:249
`debug!` at line 603 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/pgls_workspace/src/workspace/server.rs:603
`debug!` at line 653 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/pgls_workspace/src/workspace/server.rs:653
`info!` at line 1298 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: `info!(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/pgls_workspace/src/workspace/server.rs:1298
`debug!` at line 1332 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/pgls_workspace/src/workspace/server.rs:1332
`debug!` at line 150 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/pgls_workspace/src/workspace/server/connection_manager.rs:150
`debug!` at line 198 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/pgls_workspace/src/workspace/server/connection_manager.rs:198
`error!` at line 262 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: `error!(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/pgls_workspace/src/workspace/server/connection_manager.rs:262
`debug!` at line 389 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/pgls_workspace/src/workspace/server/connection_manager.rs:389
`warn!` at line 394 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/pgls_workspace/src/workspace/server/connection_manager.rs:394
`debug!` at line 423 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/pgls_workspace/src/workspace/server/connection_manager.rs:423
`debug!` at line 104 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/pgls_workspace/src/workspace/server/document_cache.rs:104
`warn!` at line 80 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/pgls_workspace/src/workspace/server/pgpass.rs:80
`warn!` at line 84 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/pgls_workspace/src/workspace/server/pgpass.rs:84
`debug!` at line 142 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/pgls_workspace/src/workspace/server/snapshot_manager.rs:142
`debug!` at line 174 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/pgls_workspace/src/workspace/server/snapshot_manager.rs:174
`warn!` at line 138 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/pgls_workspace/src/features/code_actions/execute_statement/execution.rs:138
`warn!` at line 158 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/pgls_workspace/src/features/code_actions/execute_statement/execution.rs:158
`info!` at line 113 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: `info!(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/pgls_workspace/src/configuration/project.rs:113
`error!` at line 181 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: `error!(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/pgls_lsp/src/server.rs:181
`error!` at line 203 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: `error!(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/pgls_lsp/src/server.rs:203
`error!` at line 221 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: `error!(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/pgls_lsp/src/server.rs:221
`trace!` at line 308 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/pgls_lsp/src/server.rs:308
`info!` at line 377 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: `info!(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/pgls_lsp/src/server.rs:377
`error!` at line 486 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: `error!(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/pgls_lsp/src/session.rs:486
`info!` at line 492 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: `info!(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/pgls_lsp/src/session.rs:492
`error!` at line 498 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: `error!(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/pgls_lsp/src/session.rs:498
`info!` at line 501 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: `info!(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/pgls_lsp/src/session.rs:501
`error!` at line 552 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: `error!(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/pgls_lsp/src/session.rs:552
`debug!` at line 563 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/pgls_lsp/src/session.rs:563
`error!` at line 624 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: `error!(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/pgls_lsp/src/session.rs:624
`error!` at line 627 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: `error!(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/pgls_lsp/src/session.rs:627
`error!` at line 652 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: `error!(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/pgls_lsp/src/session.rs:652
`error!` at line 683 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: `error!(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/pgls_lsp/src/session.rs:683
`error!` at line 771 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: `error!(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/pgls_lsp/src/session.rs:771
`error!` at line 793 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: `error!(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/pgls_lsp/src/session.rs:793
`error!` at line 807 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: `error!(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/pgls_lsp/src/session.rs:807
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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 — 12 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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.
C4 Data Retention — Repo shows no data-retention / TTL / cleanup mechanism for personal data — absence of evidence is not evidence of a working control. Define retention periods and a purge/cleanup job (or TTL) in code, or document where retention is enforced, so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 66 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: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — Not applicable: Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — AX6 reached only 4% of this repository's production lines — rust (126,859 lines), c (680 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — failed to solve: process "/bin/sh -c apt-get update && apt-get install -y postgresql-server-dev-15 gcc make git curl pkg-config libssl-dev libclang-dev clang libicu-dev openssl && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency does not read html yet; not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, TypeScript surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 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.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the node:test suite in crates/pgls_treesitter_grammar/ ran but wrote no lcov report. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
M4 Documentation accuracy — Not applicable: the 144 current-state document(s) make no claim of a kind M4 checks. 42 claim(s) of kinds M4 does not check were not checked (path 18, command argument 2, install 4, environment variable 13, setting 2, package 2, cd 1); M4 checks only links and versions and artefact counts.
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'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Rust source, so there is no service whose uptime a failing dependency could take down
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — No web surface: 837 Rust file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation and obsolete TLS versions, and none was found. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker. If this codebase starts serving HTTP, the dimension reactivates automatically.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X12 Unreachable branch — X12 reached only 4% of this repository's production lines — rust (126,859 lines), c (680 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — X13 reached only 4% of this repository's production lines — rust (126,859 lines), c (680 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 4% of this repository's production lines — rust (126,859 lines), c (680 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — 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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — 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 4% of this repository's production lines — rust (126,859 lines), c (680 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.
Orphaned knowledge crates/pgls_text_size/src/text_range_replacement.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of (cognitive 206) crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:12— pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of has cognitive complexity 206 (threshold 15). Drivers by points: if/else 84 (191 pts), loops 3 (9 pts), boolean chains 5, match/switch 1 (nesting depth added 113). 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.
pgls_pretty_print::nodes::constraint::emit_constraint_of (cognitive 123) crates/pgls_pretty_print/src/nodes/constraint.rs:27— pgls_pretty_print::nodes::constraint::emit_constraint_of has cognitive complexity 123 (threshold 15). Drivers by points: if/else 54 (111 pts), match/switch 3 (6 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_pretty_print::nodes::select_stmt::emit_select_stmt (cognitive 117) crates/pgls_pretty_print/src/nodes/select_stmt.rs:7— pgls_pretty_print::nodes::select_stmt::emit_select_stmt has cognitive complexity 117 (threshold 15). Drivers by points: if/else 40 (91 pts), match/switch 7 (12 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_pretty_print::nodes::clauses::function_options::format_function_option (cognitive 111) crates/pgls_pretty_print/src/nodes/clauses/function_options.rs:55— pgls_pretty_print::nodes::clauses::function_options::format_function_option has cognitive complexity 111 (threshold 15). Drivers by points: if/else 46 (101 pts), match/switch 2 (5 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 60). 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.
pgls_pretty_print::nodes::create_stmt::emit_create_stmt (cognitive 89) crates/pgls_pretty_print/src/nodes/create_stmt.rs:30— pgls_pretty_print::nodes::create_stmt::emit_create_stmt has cognitive complexity 89 (threshold 15). Drivers by points: if/else 31 (62 pts), loops 6 (18 pts), boolean chains 5, match/switch 2 (4 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.
pgls_pretty_print::nodes::create_role_stmt::format_role_option (cognitive 72) crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:38— pgls_pretty_print::nodes::create_role_stmt::format_role_option has cognitive complexity 72 (threshold 15). Drivers by points: if/else 33 (64 pts), boolean chains 7, match/switch 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.
pgls_pretty_print::nodes::comment_stmt::emit_comment_stmt (cognitive 70) crates/pgls_pretty_print/src/nodes/comment_stmt.rs:6— pgls_pretty_print::nodes::comment_stmt::emit_comment_stmt has cognitive complexity 70 (threshold 15). Drivers by points: if/else 38 (70 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_pretty_print::normalize::clear_location (cognitive 70) crates/pgls_pretty_print/src/normalize.rs:88— pgls_pretty_print::normalize::clear_location has cognitive complexity 70 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 5 (9 pts), boolean chains 6, match/switch 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_pretty_print::nodes::a_expr::emit_aexpr_op (cognitive 66) crates/pgls_pretty_print/src/nodes/a_expr.rs:38— pgls_pretty_print::nodes::a_expr::emit_aexpr_op has cognitive complexity 66 (threshold 15). Drivers by points: if/else 29 (63 pts), boolean chains 2, match/switch 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pgls_pretty_print::nodes::clauses::options::emit_role_option (cognitive 62) crates/pgls_pretty_print/src/nodes/clauses/options.rs:133— pgls_pretty_print::nodes::clauses::options::emit_role_option has cognitive complexity 62 (threshold 15). Drivers by points: if/else 35 (61 pts), match/switch 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.
pgls_pretty_print::nodes::json_expr::emit_json_expr (cognitive 49) crates/pgls_pretty_print/src/nodes/json_expr.rs:5— pgls_pretty_print::nodes::json_expr::emit_json_expr has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (40 pts), loops 2 (4 pts), match/switch 1 (4 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.
pgls_pretty_print::nodes::variable_set_stmt::emit_variable_set_stmt_inner (cognitive 48) crates/pgls_pretty_print/src/nodes/variable_set_stmt.rs:50— pgls_pretty_print::nodes::variable_set_stmt::emit_variable_set_stmt_inner has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (40 pts), loops 2 (6 pts), match/switch 1 (2 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.
pgls_pretty_print::nodes::create_table_as_stmt::emit_create_table_as_stmt (cognitive 42) crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:6— pgls_pretty_print::nodes::create_table_as_stmt::emit_create_table_as_stmt has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (35 pts), match/switch 2 (5 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.
pgls_pretty_print::nodes::define_stmt::emit_collation_definition (cognitive 42) crates/pgls_pretty_print/src/nodes/define_stmt.rs:6— pgls_pretty_print::nodes::define_stmt::emit_collation_definition has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pgls_pretty_print::nodes::do_stmt::emit_do_stmt (cognitive 39) crates/pgls_pretty_print/src/nodes/do_stmt.rs:5— pgls_pretty_print::nodes::do_stmt::emit_do_stmt has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (32 pts), match/switch 3 (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.
pgls_pretty_print::nodes::join_expr::emit_join_expr (cognitive 39) crates/pgls_pretty_print/src/nodes/join_expr.rs:5— pgls_pretty_print::nodes::join_expr::emit_join_expr has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (34 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_pretty_print::nodes::variable_set_stmt::emit_transaction_option (cognitive 37) crates/pgls_pretty_print/src/nodes/variable_set_stmt.rs:248— pgls_pretty_print::nodes::variable_set_stmt::emit_transaction_option has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 4 (9 pts), boolean chains 1 (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.
pgls_pretty_print::nodes::xml_expr::emit_xml_expr (cognitive 37) crates/pgls_pretty_print/src/nodes/xml_expr.rs:5— pgls_pretty_print::nodes::xml_expr::emit_xml_expr has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (29 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pgls_pretty_print::nodes::sub_link::emit_sub_link (cognitive 36) crates/pgls_pretty_print/src/nodes/sub_link.rs:7— pgls_pretty_print::nodes::sub_link::emit_sub_link has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (35 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pgls_pretty_print::nodes::func_call::emit_standard_function (cognitive 34) crates/pgls_pretty_print/src/nodes/func_call.rs:139— pgls_pretty_print::nodes::func_call::emit_standard_function has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 5, loops 1 (4 pts) (nesting depth added 17). 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.
pgls_pretty_print::nodes::clauses::options::emit_sequence_option (cognitive 32) crates/pgls_pretty_print/src/nodes/clauses/options.rs:299— pgls_pretty_print::nodes::clauses::options::emit_sequence_option has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (29 pts), match/switch 2 (3 pts) (nesting depth added 14). 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.
pgls_pretty_print::nodes::create_publication_stmt::emit_create_publication_stmt (cognitive 31) crates/pgls_pretty_print/src/nodes/create_publication_stmt.rs:5— pgls_pretty_print::nodes::create_publication_stmt::emit_create_publication_stmt has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (28 pts), match/switch 1 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt (cognitive 30) crates/pgls_pretty_print/src/nodes/grant_stmt.rs:5— pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (22 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pgls_pretty_print::nodes::range_table_func::emit_range_table_func (cognitive 30) crates/pgls_pretty_print/src/nodes/range_table_func.rs:5— pgls_pretty_print::nodes::range_table_func::emit_range_table_func has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (30 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.
pgls_pretty_print::nodes::range_function::emit_range_function (cognitive 29) crates/pgls_pretty_print/src/nodes/range_function.rs:15— pgls_pretty_print::nodes::range_function::emit_range_function has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (29 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.
Hotspot: crates/pgls_workspace/src/workspace/server.rs crates/pgls_workspace/src/workspace/server.rs:434— crates/pgls_workspace/src/workspace/server.rs changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in WorkspaceServer::database_diagnostics at line 434. 21 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_workspace/src/workspace/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/pgls_pretty_print/src/nodes/select_stmt.rs crates/pgls_pretty_print/src/nodes/select_stmt.rs:7— crates/pgls_pretty_print/src/nodes/select_stmt.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in pgls_pretty_print::nodes::select_stmt::emit_select_stmt at line 7. 9 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/select_stmt.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/pgls_pretty_print/src/nodes/constraint.rs crates/pgls_pretty_print/src/nodes/constraint.rs:27— crates/pgls_pretty_print/src/nodes/constraint.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in pgls_pretty_print::nodes::constraint::emit_constraint_of at line 27. 7 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/constraint.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/pgls_pretty_print/src/normalize.rs crates/pgls_pretty_print/src/normalize.rs:88— crates/pgls_pretty_print/src/normalize.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in pgls_pretty_print::normalize::clear_location at line 88. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/normalize.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/pgls_completions/src/relevance/filtering.rs crates/pgls_completions/src/relevance/filtering.rs:265— crates/pgls_completions/src/relevance/filtering.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in CompletionFilter::check_clause at line 265. 4 of those changes were fix/bug commits, and the other 7 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_completions/src/relevance/filtering.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/pgls_pretty_print/src/nodes/alter_table_cmd.rs crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:12— crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 141 in pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of at line 12. 2 of those changes were fix/bug commits, and the other 2 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/alter_table_cmd.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/pgls_analyser/src/lib.rs crates/pgls_analyser/src/lib.rs:156— crates/pgls_analyser/src/lib.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Analyser::analyse_until at line 156. 13 of those changes were fix/bug commits, and the other 13 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_analyser/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/pgls_pretty_print/src/nodes/create_stmt.rs crates/pgls_pretty_print/src/nodes/create_stmt.rs:30— crates/pgls_pretty_print/src/nodes/create_stmt.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in pgls_pretty_print::nodes::create_stmt::emit_create_stmt at line 30. 6 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/create_stmt.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/pgls_catalog/src/catalog/base.rs crates/pgls_catalog/src/catalog/base.rs:39— crates/pgls_catalog/src/catalog/base.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in CatalogBase::new at line 39. 3 of those changes were fix/bug commits, and the other 8 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/catalog/base.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/pgls_catalog/src/resolve/nodes/mod.rs crates/pgls_catalog/src/resolve/nodes/mod.rs:57— crates/pgls_catalog/src/resolve/nodes/mod.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in pgls_catalog::resolve::nodes::resolve_node_enum at line 57. 1 of those changes was a fix/bug commit, and the other 7 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/resolve/nodes/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/pgls_catalog/src/resolve/column_name.rs crates/pgls_catalog/src/resolve/column_name.rs:112— crates/pgls_catalog/src/resolve/column_name.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in pgls_catalog::resolve::column_name::step at line 112. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/resolve/column_name.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/pgls_pretty_print/src/nodes/func_call.rs crates/pgls_pretty_print/src/nodes/func_call.rs:254— crates/pgls_pretty_print/src/nodes/func_call.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in pgls_pretty_print::nodes::func_call::emit_sql_syntax_call at line 254. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/func_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.
Hotspot: crates/pgls_pretty_print/src/nodes/grant_stmt.rs crates/pgls_pretty_print/src/nodes/grant_stmt.rs:5— crates/pgls_pretty_print/src/nodes/grant_stmt.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt at line 5. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/grant_stmt.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/pgls_pretty_print/src/nodes/a_expr.rs crates/pgls_pretty_print/src/nodes/a_expr.rs:38— crates/pgls_pretty_print/src/nodes/a_expr.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in pgls_pretty_print::nodes::a_expr::emit_aexpr_op at line 38. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/a_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/pgls_pretty_print/src/nodes/join_expr.rs crates/pgls_pretty_print/src/nodes/join_expr.rs:5— crates/pgls_pretty_print/src/nodes/join_expr.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in pgls_pretty_print::nodes::join_expr::emit_join_expr at line 5. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/join_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/pgls_catalog/src/typing/unify.rs crates/pgls_catalog/src/typing/unify.rs:101— crates/pgls_catalog/src/typing/unify.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in pgls_catalog::typing::unify::check_generic_type_consistency at line 101. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/typing/unify.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/pgls_statement_splitter/src/lib.rs crates/pgls_statement_splitter/src/lib.rs:171— crates/pgls_statement_splitter/src/lib.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in pgls_statement_splitter::split_region 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_statement_splitter/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/pgls_pretty_print/src/nodes/create_role_stmt.rs crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:38— crates/pgls_pretty_print/src/nodes/create_role_stmt.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in pgls_pretty_print::nodes::create_role_stmt::format_role_option at line 38. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/create_role_stmt.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/pgls_catalog/src/catalog/ddl/create_function_stmt.rs crates/pgls_catalog/src/catalog/ddl/create_function_stmt.rs:19— crates/pgls_catalog/src/catalog/ddl/create_function_stmt.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in pgls_catalog::catalog::ddl::create_function_stmt::apply_create_function_stmt at line 19. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/catalog/ddl/create_function_stmt.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/pgls_pretty_print/src/nodes/create_table_as_stmt.rs crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:6— crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in pgls_pretty_print::nodes::create_table_as_stmt::emit_create_table_as_stmt at line 6. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/create_table_as_stmt.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/pgls_catalog/src/catalog/materialize.rs crates/pgls_catalog/src/catalog/materialize.rs:25— crates/pgls_catalog/src/catalog/materialize.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Catalog::snapshot at line 25. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/catalog/materialize.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/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs:369— crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in pgls_catalog::catalog::ddl::alter_table_stmt::apply_column_change at line 369. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.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/pgls_catalog/src/resolve/expr/a_expr.rs crates/pgls_catalog/src/resolve/expr/a_expr.rs:18— crates/pgls_catalog/src/resolve/expr/a_expr.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in pgls_catalog::resolve::expr::a_expr::infer_a_expr at line 18. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/resolve/expr/a_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/pgls_pretty_print/src/nodes/sub_link.rs crates/pgls_pretty_print/src/nodes/sub_link.rs:7— crates/pgls_pretty_print/src/nodes/sub_link.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in pgls_pretty_print::nodes::sub_link::emit_sub_link at line 7. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/sub_link.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/pgls_semantic_tokens/src/lib.rs crates/pgls_semantic_tokens/src/lib.rs:78— crates/pgls_semantic_tokens/src/lib.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in pgls_semantic_tokens::semantic_tokens_of_references at line 78. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_semantic_tokens/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/pgls_pretty_print/src/emitter.rs crates/pgls_pretty_print/src/emitter.rs:217— crates/pgls_pretty_print/src/emitter.rs changed 19 times in last 90 days and 15 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is EventEmitter::take_leading_comments_at at line 217), 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(pretty_print): keep comments before DML and DDL keywords in place (#1046)”; “fix(pretty_print): keep comments before clause, join and alias keywords in place (#1031)”; “fix(pretty_print): keep a comment written before a list comma before the comma (#1030)”; “fix(pretty_print): preserve comment order and CASE END boundaries (#1025)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/emitter.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/pgls_pretty_print/src/nodes/mod.rs crates/pgls_pretty_print/src/nodes/mod.rs:559— crates/pgls_pretty_print/src/nodes/mod.rs changed 19 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 1 (its worst body is pgls_pretty_print::nodes::emit_statement at line 559), 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(pretty_print): print an unexpected AST instead of panicking (#1001)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”; “fix(pretty_print): close a lone compact select item under select (#960)”; “fix(pretty_print): break the remaining calls and statement headers within the line width (#946)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/pgls_pretty_print/src/renderer.rs crates/pgls_pretty_print/src/renderer.rs:205— crates/pgls_pretty_print/src/renderer.rs changed 18 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 15 (its worst body is Renderer::render_events_with_breaks at line 205), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(pretty_print): keep comments before CASE and GRANT keywords in place (#934)”; “fix(pretty_print): align expanded CASE from where it starts (#894)”; “fix(pretty_print): no stray spaces around commas and inside parentheses (#890)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/renderer.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/pgls_pretty_print/src/lib.rs crates/pgls_pretty_print/src/lib.rs:80— crates/pgls_pretty_print/src/lib.rs changed 17 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 6 (its worst body is pgls_pretty_print::format_statement at line 80), 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(pretty_print): keep comments before clause, join and alias keywords in place (#1031)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”; “fix(pretty_print): preserve comment order and CASE END boundaries (#1025)”; “fix(pretty_print): keep long identifiers as written (#901)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/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/pgls_pretty_print/src/nodes/bool_expr.rs crates/pgls_pretty_print/src/nodes/bool_expr.rs:52— crates/pgls_pretty_print/src/nodes/bool_expr.rs changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is pgls_pretty_print::nodes::bool_expr::emit_variadic_operands at line 52), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(pretty_print): keep comments before clause, join and alias keywords in place (#1031)”; “fix(pretty_print): print an unexpected AST instead of panicking (#1001)”; “fix(pretty_print): indent the condition of a check constraint (#871)”; “fix(pretty_print): keep exists ( together and break nested boolean groups (#864)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/bool_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.
Repeated repair: crates/pgls_catalog/src/session/locks.rs crates/pgls_catalog/src/session/locks.rs:160— crates/pgls_catalog/src/session/locks.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 15 (its worst body is Locks::apply at line 160), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(analyser): take lock levels from a port of AlterTableGetLockLevel (#1155)”; “fix(analyser): handle NOT ENFORCED foreign keys and ALTER CONSTRAINT ... ENFORCED (#1112)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/session/locks.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/pgls_catalog/src/session/mod.rs crates/pgls_catalog/src/session/mod.rs:206— crates/pgls_catalog/src/session/mod.rs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is Session::apply at line 206), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(analyser): one model of transaction blocks for the transaction rules (#1153)”; “fix(analyser): take lock levels from a port of AlterTableGetLockLevel (#1155)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/session/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/pgls_analyser/src/lint/safety/require_concurrent_index_creation.rs crates/pgls_analyser/src/lint/safety/require_concurrent_index_creation.rs:86— crates/pgls_analyser/src/lint/safety/require_concurrent_index_creation.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is pgls_analyser::lint::safety::require_concurrent_index_creation::add_concurrently at line 86), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(analyser): don't report locking problems on tables created in the same transaction (#1157)”; “fix(catalog): resolve the relations of the session's lock state with the catalog (#1042)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_analyser/src/lint/safety/require_concurrent_index_creation.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/pgls_analyser/src/lint/destructive/changing_column_type.rs crates/pgls_analyser/src/lint/destructive/changing_column_type.rs:158— crates/pgls_analyser/src/lint/destructive/changing_column_type.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 13 (its worst body is pgls_analyser::lint::destructive::changing_column_type::type_change_rewrites at line 158), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(analyser): don't report locking problems on tables created in the same transaction (#1157)”; “fix(analyser): answer volatility, versions and type changes from the catalog (#1156)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_analyser/src/lint/destructive/changing_column_type.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/pgls_pretty_print/src/nodes/alter_table_stmt.rs crates/pgls_pretty_print/src/nodes/alter_table_stmt.rs:5— crates/pgls_pretty_print/src/nodes/alter_table_stmt.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 pgls_pretty_print::nodes::alter_table_stmt::emit_alter_table_stmt at line 5), 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(pretty_print): write the commas of every node list with emit_list_comma (#1045)”; “fix(pretty_print): print an unexpected AST instead of panicking (#1001)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”; “fix(format): stop rewriting SQL and only break lines that do not fit (#849)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/alter_table_stmt.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/pgls_analyser/src/lint/safety/adding_foreign_key_constraint.rs crates/pgls_analyser/src/lint/safety/adding_foreign_key_constraint.rs:149— crates/pgls_analyser/src/lint/safety/adding_foreign_key_constraint.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 4 (its worst body is pgls_analyser::lint::safety::adding_foreign_key_constraint::check_foreign_key_constraint at line 149), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(analyser): a few rule edge cases found while sharing their helpers (#1158)”; “fix(analyser): don't report locking problems on tables created in the same transaction (#1157)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_analyser/src/lint/safety/adding_foreign_key_constraint.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/pgls_pretty_print/src/nodes/view_stmt.rs crates/pgls_pretty_print/src/nodes/view_stmt.rs:5— crates/pgls_pretty_print/src/nodes/view_stmt.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 13 (its worst body is pgls_pretty_print::nodes::view_stmt::emit_view_stmt at line 5), 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(pretty_print): keep comments before DML and DDL keywords in place (#1046)”; “fix(pretty_print): print an unexpected AST instead of panicking (#1001)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”; “fix(format): stop rewriting SQL and only break lines that do not fit (#849)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/view_stmt.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/pgls_analyser/src/utils.rs crates/pgls_analyser/src/utils.rs:133— crates/pgls_analyser/src/utils.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 8 (its worst body is AlterDomainKind::of at line 133), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(analyser): a few rule edge cases found while sharing their helpers (#1158)”; “fix(analyser): one model of transaction blocks for the transaction rules (#1153)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_analyser/src/utils.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/pgls_completions/src/providers/helper.rs crates/pgls_completions/src/providers/helper.rs:93— crates/pgls_completions/src/providers/helper.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 8 (its worst body is pgls_completions::providers::helper::with_schema_or_alias at line 93), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(completions): complete keywords right after an opening parenthesis (#1134)”; “fix(completions): complete inside unterminated quotes and quote policies and roles (#1048)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_completions/src/providers/helper.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/pgls_workspace/src/workspace/server/connection_manager.rs crates/pgls_workspace/src/workspace/server/connection_manager.rs:218— crates/pgls_workspace/src/workspace/server/connection_manager.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ConnectionManager::get_pools at line 218), 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(workspace): don't leak transactions or session settings from executed statements (#907)”; “fix(workspace): only connection failures put the database into backoff (#903)”; “fix(cli): fail check on database login errors and read ~/.pgpass (#839)”; “fix(workspace): apply changed database credentials to cached connection pools (#811)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_workspace/src/workspace/server/connection_manager.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/pgls_analyser/src/lint/style/prefer_big_int.rs crates/pgls_analyser/src/lint/style/prefer_big_int.rs:86— crates/pgls_analyser/src/lint/style/prefer_big_int.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is pgls_analyser::lint::style::prefer_big_int::check_column_def at line 86), 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(catalog): recognise serial columns like Postgres does (#1154)”; “fix(analyser): lint rule edge cases (#970)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_analyser/src/lint/style/prefer_big_int.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/pgls_catalog/src/snapshot/mod.rs crates/pgls_catalog/src/snapshot/mod.rs:135— crates/pgls_catalog/src/snapshot/mod.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is Snapshot::find_tables at line 135), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix: normalise identifiers the same way everywhere (#976)”; “fix(catalog): skip orphaned catalog rows when loading the snapshot (#847)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/snapshot/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/pgls_pretty_print/src/nodes/index_stmt.rs crates/pgls_pretty_print/src/nodes/index_stmt.rs:5— crates/pgls_pretty_print/src/nodes/index_stmt.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is pgls_pretty_print::nodes::index_stmt::emit_index_stmt at line 5), 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(pretty_print): keep comments before DML and DDL keywords in place (#1046)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”; “fix(format): stop rewriting SQL and only break lines that do not fit (#849)”; “fix(pretty-print): suppress child statement semicolons in CREATE SCHEMA (#803)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/index_stmt.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/pgls_pretty_print/src/nodes/merge_stmt.rs crates/pgls_pretty_print/src/nodes/merge_stmt.rs:6— crates/pgls_pretty_print/src/nodes/merge_stmt.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is pgls_pretty_print::nodes::merge_stmt::emit_merge_stmt at line 6), 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(pretty_print): keep comments before DML and DDL keywords in place (#1046)”; “fix(pretty_print): keep comments before clause, join and alias keywords in place (#1031)”; “fix(pretty_print): print an unexpected AST instead of panicking (#1001)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/merge_stmt.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/pgls_pretty_print/src/nodes/create_function_stmt.rs crates/pgls_pretty_print/src/nodes/create_function_stmt.rs:5— crates/pgls_pretty_print/src/nodes/create_function_stmt.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is pgls_pretty_print::nodes::create_function_stmt::emit_create_function_stmt at line 5), 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(pretty_print): write the commas of every node list with emit_list_comma (#1045)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”; “fix(format): stop rewriting SQL and only break lines that do not fit (#849)”; “fix(pretty-print): emit BEGIN ATOMIC bodies and TRANSFORM FOR TYPE (#829)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/create_function_stmt.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/pgls_pretty_print/src/nodes/alter_function_stmt.rs crates/pgls_pretty_print/src/nodes/alter_function_stmt.rs:6— crates/pgls_pretty_print/src/nodes/alter_function_stmt.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is pgls_pretty_print::nodes::alter_function_stmt::emit_alter_function_stmt at line 6), 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(pretty_print): print an unexpected AST instead of panicking (#1001)”; “fix(pretty_print): write the statement terminator only at the top level (#987)”; “fix(format): stop rewriting SQL and only break lines that do not fit (#849)”; “fix(pretty-print): separate ALTER FUNCTION actions with spaces (#846)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/alter_function_stmt.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/pgls_pretty_print/src/nodes/grant_role_stmt.rs crates/pgls_pretty_print/src/nodes/grant_role_stmt.rs:5— crates/pgls_pretty_print/src/nodes/grant_role_stmt.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is pgls_pretty_print::nodes::grant_role_stmt::emit_grant_role_stmt at line 5), 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(pretty_print): write the statement terminator only at the top level (#987)”; “fix(pretty_print): keep comments before CASE and GRANT keywords in place (#934)”; “fix(pretty-print): indent GRANT and REVOKE continuation clauses (#858)”; “fix(format): stop rewriting SQL and only break lines that do not fit (#849)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_pretty_print/src/nodes/grant_role_stmt.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/pgls_line_index/src/line_index.rs crates/pgls_line_index/src/line_index.rs:31— crates/pgls_line_index/src/line_index.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is LineIndex::new at line 31), 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(suppressions): end lines at \n only, with the shared line index (#1072)”; “fix(lsp): share the line index with WASM and keep positions out of CRLF line breaks (#1070)”; “fix(lsp): debug assertions at range boundaries, keep client positions on char boundaries (#952)”; “fix(diagnostics): end lines only at \n, like the shared line index (#1125)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_line_index/src/line_index.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/pgls_analyser/src/lint/style/prefer_identity.rs crates/pgls_analyser/src/lint/style/prefer_identity.rs:69— crates/pgls_analyser/src/lint/style/prefer_identity.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is pgls_analyser::lint::style::prefer_identity::check_column_def at line 69), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(catalog): recognise serial columns like Postgres does (#1154)”; “fix(analyser): lint rule edge cases (#970)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_analyser/src/lint/style/prefer_identity.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/pgls_catalog/src/resolve/nodes/with_clause.rs crates/pgls_catalog/src/resolve/nodes/with_clause.rs:22— crates/pgls_catalog/src/resolve/nodes/with_clause.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is pgls_catalog::resolve::nodes::with_clause::resolve_with_clause 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: restore the changes that the squash of #1027 reverted (#1164)”; “fix(pretty_print): keep an own-line comment before a leading comma in fill lists (#1027)”; “fix(catalog): add the columns of SEARCH and CYCLE to a CTE (#1019)”; “fix(catalog): apply a CTE's column list to typed columns too (#980)”. 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-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 13:26:12 +00:00' --until='2026-11-14 13:26:12 +00:00' --full-history --no-merges -- crates/pgls_catalog/src/resolve/nodes/with_clause.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.
pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of (cyclomatic 141) crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:12— pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of has cyclomatic complexity 141 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_pretty_print::normalize::clear_location (cyclomatic 106) crates/pgls_pretty_print/src/normalize.rs:88— pgls_pretty_print::normalize::clear_location has cyclomatic complexity 106 (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.
pgls_pretty_print::nodes::constraint::emit_constraint_of (cyclomatic 75) crates/pgls_pretty_print/src/nodes/constraint.rs:27— pgls_pretty_print::nodes::constraint::emit_constraint_of has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_pretty_print::nodes::select_stmt::emit_select_stmt (cyclomatic 55) crates/pgls_pretty_print/src/nodes/select_stmt.rs:7— pgls_pretty_print::nodes::select_stmt::emit_select_stmt has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_pretty_print::nodes::clauses::function_options::format_function_option (cyclomatic 50) crates/pgls_pretty_print/src/nodes/clauses/function_options.rs:55— pgls_pretty_print::nodes::clauses::function_options::format_function_option has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_pretty_print::nodes::create_stmt::emit_create_stmt (cyclomatic 46) crates/pgls_pretty_print/src/nodes/create_stmt.rs:30— pgls_pretty_print::nodes::create_stmt::emit_create_stmt has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_pretty_print::nodes::create_role_stmt::format_role_option (cyclomatic 44) crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:38— pgls_pretty_print::nodes::create_role_stmt::format_role_option 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.
pgls_pretty_print::nodes::clauses::options::emit_role_option (cyclomatic 39) crates/pgls_pretty_print/src/nodes/clauses/options.rs:133— pgls_pretty_print::nodes::clauses::options::emit_role_option 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.
pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt (cyclomatic 32) crates/pgls_pretty_print/src/nodes/grant_stmt.rs:5— pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pgls_pretty_print::nodes::join_expr::emit_join_expr (cyclomatic 31) crates/pgls_pretty_print/src/nodes/join_expr.rs:5— pgls_pretty_print::nodes::join_expr::emit_join_expr 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.
pgls_pretty_print::nodes::json_expr::emit_json_expr (cyclomatic 30) crates/pgls_pretty_print/src/nodes/json_expr.rs:5— pgls_pretty_print::nodes::json_expr::emit_json_expr 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.
pgls_pretty_print::nodes::func_call::emit_sql_syntax_call (cyclomatic 27) crates/pgls_pretty_print/src/nodes/func_call.rs:254— pgls_pretty_print::nodes::func_call::emit_sql_syntax_call has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pgls_pretty_print::nodes::variable_set_stmt::emit_variable_set_stmt_inner (cyclomatic 27) crates/pgls_pretty_print/src/nodes/variable_set_stmt.rs:50— pgls_pretty_print::nodes::variable_set_stmt::emit_variable_set_stmt_inner 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.
pgls_pretty_print::nodes::xml_expr::emit_xml_expr (cyclomatic 27) crates/pgls_pretty_print/src/nodes/xml_expr.rs:5— pgls_pretty_print::nodes::xml_expr::emit_xml_expr 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.
pgls_pretty_print::normalize::normalize_merge_support_func_recursive (cyclomatic 27) crates/pgls_pretty_print/src/normalize.rs:505— pgls_pretty_print::normalize::normalize_merge_support_func_recursive has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pgls_pretty_print::nodes::create_table_as_stmt::emit_create_table_as_stmt (cyclomatic 26) crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:6— pgls_pretty_print::nodes::create_table_as_stmt::emit_create_table_as_stmt 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.
pgls_pretty_print::nodes::a_expr::emit_aexpr_op (cyclomatic 25) crates/pgls_pretty_print/src/nodes/a_expr.rs:38— pgls_pretty_print::nodes::a_expr::emit_aexpr_op 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.
pgls_pretty_print::nodes::variable_set_stmt::emit_transaction_option (cyclomatic 25) crates/pgls_pretty_print/src/nodes/variable_set_stmt.rs:248— pgls_pretty_print::nodes::variable_set_stmt::emit_transaction_option 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.
pgls_pretty_print::nodes::clauses::options::emit_sequence_option (cyclomatic 24) crates/pgls_pretty_print/src/nodes/clauses/options.rs:299— pgls_pretty_print::nodes::clauses::options::emit_sequence_option 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.
pgls_pretty_print::nodes::comment_stmt::emit_comment_stmt (cyclomatic 24) crates/pgls_pretty_print/src/nodes/comment_stmt.rs:6— pgls_pretty_print::nodes::comment_stmt::emit_comment_stmt 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.
pgls_pretty_print::nodes::sub_link::emit_sub_link (cyclomatic 24) crates/pgls_pretty_print/src/nodes/sub_link.rs:7— pgls_pretty_print::nodes::sub_link::emit_sub_link 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.
pgls_pretty_print::nodes::create_trig_stmt::emit_create_trig_stmt (cyclomatic 21) crates/pgls_pretty_print/src/nodes/create_trig_stmt.rs:5— pgls_pretty_print::nodes::create_trig_stmt::emit_create_trig_stmt 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.
pgls_pretty_print::nodes::json_func_expr::emit_json_func_expr (cyclomatic 20) crates/pgls_pretty_print/src/nodes/json_func_expr.rs:5— pgls_pretty_print::nodes::json_func_expr::emit_json_func_expr 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.
pgls_pretty_print::nodes::json_table_column::emit_json_table_column (cyclomatic 20) crates/pgls_pretty_print/src/nodes/json_table_column.rs:7— pgls_pretty_print::nodes::json_table_column::emit_json_table_column 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.
pgls_pretty_print::nodes::transaction_stmt::emit_transaction_stmt (cyclomatic 19) crates/pgls_pretty_print/src/nodes/transaction_stmt.rs:5— pgls_pretty_print::nodes::transaction_stmt::emit_transaction_stmt 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.
pgls_catalog::typing::overload::select_candidate (cognitive 89) crates/pgls_catalog/src/typing/overload/mod.rs:107— pgls_catalog::typing::overload::select_candidate has cognitive complexity 89 (threshold 15). Drivers by points: if/else 18 (44 pts), match/switch 9 (24 pts), loops 9 (16 pts), boolean chains 5 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_catalog::resolve::expr::a_expr::infer_a_expr (cognitive 87) crates/pgls_catalog/src/resolve/expr/a_expr.rs:18— pgls_catalog::resolve::expr::a_expr::infer_a_expr has cognitive complexity 87 (threshold 15). Drivers by points: if/else 22 (54 pts), match/switch 8 (17 pts), loops 4 (14 pts), boolean chains 2 (nesting depth added 51). 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.
pgls_catalog::typing::unify::check_generic_type_consistency (cognitive 70) crates/pgls_catalog/src/typing/unify.rs:101— pgls_catalog::typing::unify::check_generic_type_consistency has cognitive complexity 70 (threshold 15). Drivers by points: if/else 15 (34 pts), match/switch 11 (33 pts), boolean chains 2, loops 1 (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.
pgls_catalog::typing::unify::resolve_polymorphic_result (cognitive 58) crates/pgls_catalog/src/typing/unify.rs:234— pgls_catalog::typing::unify::resolve_polymorphic_result has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (33 pts), match/switch 11 (22 pts), boolean chains 2, loops 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.
pgls_catalog::catalog::ddl::index_stmt::index_columns (cognitive 50) crates/pgls_catalog/src/catalog/ddl/index_stmt.rs:78— pgls_catalog::catalog::ddl::index_stmt::index_columns has cognitive complexity 50 (threshold 15). Drivers by points: if/else 7 (24 pts), match/switch 4 (15 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_catalog::catalog::ddl::drop_stmt::apply_drop_stmt (cognitive 44) crates/pgls_catalog/src/catalog/ddl/drop_stmt.rs:15— pgls_catalog::catalog::ddl::drop_stmt::apply_drop_stmt has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (37 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_catalog::catalog::ddl::create_stmt::create_table (cognitive 41) crates/pgls_catalog/src/catalog/ddl/create_stmt.rs:32— pgls_catalog::catalog::ddl::create_stmt::create_table has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 6 (11 pts), match/switch 4 (8 pts), boolean chains 3 (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.
pgls_catalog::typing::overload::candidates::expand_candidates (cognitive 39) crates/pgls_catalog/src/typing/overload/candidates.rs:22— pgls_catalog::typing::overload::candidates::expand_candidates has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 8, 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.
pgls_catalog::catalog::ddl::create_function_stmt::apply_create_function_stmt (cognitive 35) crates/pgls_catalog/src/catalog/ddl/create_function_stmt.rs:19— pgls_catalog::catalog::ddl::create_function_stmt::apply_create_function_stmt has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 5, match/switch 4 (5 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_catalog::resolve::nodes::insert_stmt::resolve_insert (cognitive 30) crates/pgls_catalog/src/resolve/nodes/insert_stmt.rs:42— pgls_catalog::resolve::nodes::insert_stmt::resolve_insert has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (10 pts), match/switch 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.
pgls_catalog::typing::unify::select_common_type (cognitive 30) crates/pgls_catalog/src/typing/unify.rs:19— pgls_catalog::typing::unify::select_common_type has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 4 (10 pts), loops 2, 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.
pgls_catalog::resolve::nodes::range_function::typed_return_columns (cognitive 27) crates/pgls_catalog/src/resolve/nodes/range_function.rs:215— pgls_catalog::resolve::nodes::range_function::typed_return_columns has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (12 pts), loops 2 (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.
pgls_catalog::typing::overload::function::select_function (cognitive 27) crates/pgls_catalog/src/typing/overload/function.rs:20— pgls_catalog::typing::overload::function::select_function has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 4 (8 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pgls_catalog::catalog::ddl::alter_table_stmt::apply_inheritance_changes (cognitive 26) crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs:149— pgls_catalog::catalog::ddl::alter_table_stmt::apply_inheritance_changes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, 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.
pgls_catalog::resolve::nodes::select_stmt::resolve_select (cognitive 26) crates/pgls_catalog/src/resolve/nodes/select_stmt.rs:140— pgls_catalog::resolve::nodes::select_stmt::resolve_select has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 7 (9 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_catalog::resolve::nodes::column_ref::resolve_qualified_column (cognitive 24) crates/pgls_catalog/src/resolve/nodes/column_ref.rs:98— pgls_catalog::resolve::nodes::column_ref::resolve_qualified_column has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, match/switch 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.
pgls_catalog::resolve::nodes::insert_stmt::check_generated_insert (cognitive 24) crates/pgls_catalog/src/resolve/nodes/insert_stmt.rs:228— pgls_catalog::resolve::nodes::insert_stmt::check_generated_insert has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 7 (10 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.
pgls_catalog::resolve::nodes::range_function::resolve_range_function (cognitive 24) crates/pgls_catalog/src/resolve/nodes/range_function.rs:28— pgls_catalog::resolve::nodes::range_function::resolve_range_function has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (6 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.
pgls_catalog::catalog::ddl::alter_table_stmt::apply_index_changes (cognitive 23) crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs:307— pgls_catalog::catalog::ddl::alter_table_stmt::apply_index_changes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 5, 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.
pgls_catalog::catalog::ddl::alter_table_stmt::apply_column_change (cognitive 23) crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs:369— pgls_catalog::catalog::ddl::alter_table_stmt::apply_column_change has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 4 (8 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.
pgls_catalog::resolve::column_name::step (cognitive 23) crates/pgls_catalog/src/resolve/column_name.rs:112— pgls_catalog::resolve::column_name::step has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 12 (23 pts) (nesting depth added 11). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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.
pgls_catalog::resolve::nodes::func_call::resolve_func_call (cognitive 21) crates/pgls_catalog/src/resolve/nodes/func_call.rs:16— pgls_catalog::resolve::nodes::func_call::resolve_func_call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pgls_catalog::catalog::ddl::rename_stmt::apply_rename_stmt (cognitive 20) crates/pgls_catalog/src/catalog/ddl/rename_stmt.rs:16— pgls_catalog::catalog::ddl::rename_stmt::apply_rename_stmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, match/switch 1 (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.
pgls_catalog::typing::coerce::can_coerce (cognitive 20) crates/pgls_catalog/src/typing/coerce.rs:118— pgls_catalog::typing::coerce::can_coerce has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (13 pts), if/else 6 (7 pts) (nesting depth added 6). 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.
pgls_catalog::catalog::ddl::alter_table_stmt::apply_column_changes (cognitive 19) crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs:54— pgls_catalog::catalog::ddl::alter_table_stmt::apply_column_changes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (4 pts), match/switch 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.
FunctionTooLong: pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:12— FunctionTooLong — pgls_pretty_print::nodes::alter_table_cmd::emit_alter_table_cmd_of runs 571 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 471 over it, 5.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_pretty_print::nodes::constraint::emit_constraint_of crates/pgls_pretty_print/src/nodes/constraint.rs:27— FunctionTooLong — pgls_pretty_print::nodes::constraint::emit_constraint_of runs 312 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 212 over it, 3.12× 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: pgls_pretty_print::nodes::emit_node_enum crates/pgls_pretty_print/src/nodes/mod.rs:570— FunctionTooLong — pgls_pretty_print::nodes::emit_node_enum runs 278 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 178 over it, 2.78× 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: pgls_pretty_print::nodes::select_stmt::emit_select_stmt crates/pgls_pretty_print/src/nodes/select_stmt.rs:7— FunctionTooLong — pgls_pretty_print::nodes::select_stmt::emit_select_stmt runs 244 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 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_pretty_print::normalize::clear_location crates/pgls_pretty_print/src/normalize.rs:88— FunctionTooLong — pgls_pretty_print::normalize::clear_location runs 235 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_catalog::resolve::expr::a_expr::infer_a_expr crates/pgls_catalog/src/resolve/expr/a_expr.rs:18— FunctionTooLong — pgls_catalog::resolve::expr::a_expr::infer_a_expr runs 219 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 119 over it, 2.19× 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: pgls_pretty_print::nodes::create_stmt::emit_create_stmt crates/pgls_pretty_print/src/nodes/create_stmt.rs:30— FunctionTooLong — pgls_pretty_print::nodes::create_stmt::emit_create_stmt 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.
FunctionTooLong: pgls_pretty_print::nodes::func_call::emit_sql_syntax_call crates/pgls_pretty_print/src/nodes/func_call.rs:254— FunctionTooLong — pgls_pretty_print::nodes::func_call::emit_sql_syntax_call 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.
FunctionTooLong: pgls_pretty_print::nodes::clauses::function_options::format_function_option crates/pgls_pretty_print/src/nodes/clauses/function_options.rs:55— FunctionTooLong — pgls_pretty_print::nodes::clauses::function_options::format_function_option runs 141 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 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_walk::walk::walk_statements crates/pgls_walk/src/walk.rs:114— FunctionTooLong — pgls_walk::walk::walk_statements runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_diagnostics::display::frame::print_frame crates/pgls_diagnostics/src/display/frame.rs:34— FunctionTooLong — pgls_diagnostics::display::frame::print_frame runs 136 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_catalog::catalog::ddl::create_function_stmt::apply_create_function_stmt crates/pgls_catalog/src/catalog/ddl/create_function_stmt.rs:19— FunctionTooLong — pgls_catalog::catalog::ddl::create_function_stmt::apply_create_function_stmt runs 129 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 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_pretty_print::nodes::variable_set_stmt::emit_variable_set_stmt_inner crates/pgls_pretty_print/src/nodes/variable_set_stmt.rs:50— FunctionTooLong — pgls_pretty_print::nodes::variable_set_stmt::emit_variable_set_stmt_inner runs 121 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 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_pretty_print::nodes::xml_expr::emit_xml_expr crates/pgls_pretty_print/src/nodes/xml_expr.rs:5— FunctionTooLong — pgls_pretty_print::nodes::xml_expr::emit_xml_expr runs 119 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 19 over it, 1.19× 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: pgls_workspace::workspace::server::formatting::format_document crates/pgls_workspace/src/workspace/server/formatting.rs:51— FunctionTooLong — pgls_workspace::workspace::server::formatting::format_document runs 119 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 19 over it, 1.19× 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: pgls_statement_splitter::splitter::common::unknown crates/pgls_statement_splitter/src/splitter/common.rs:166— FunctionTooLong — pgls_statement_splitter::splitter::common::unknown runs 117 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 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_catalog::typing::overload::select_candidate crates/pgls_catalog/src/typing/overload/mod.rs:107— FunctionTooLong — pgls_catalog::typing::overload::select_candidate runs 116 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 16 over it, 1.16× 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: pgls_pretty_print::nodes::create_role_stmt::format_role_option crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:38— FunctionTooLong — pgls_pretty_print::nodes::create_role_stmt::format_role_option runs 114 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 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_pretty_print::nodes::clauses::options::emit_role_option crates/pgls_pretty_print/src/nodes/clauses/options.rs:133— FunctionTooLong — pgls_pretty_print::nodes::clauses::options::emit_role_option runs 113 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_pretty_print::nodes::merge_when_clause::emit_merge_when_clause crates/pgls_pretty_print/src/nodes/merge_when_clause.rs:5— FunctionTooLong — pgls_pretty_print::nodes::merge_when_clause::emit_merge_when_clause runs 111 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 11 over it, 1.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.
FunctionTooLong: pgls_lsp::handlers::code_actions::get_actions crates/pgls_lsp/src/handlers/code_actions.rs:25— FunctionTooLong — pgls_lsp::handlers::code_actions::get_actions runs 109 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 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pgls_pretty_print::nodes::create_table_as_stmt::emit_create_table_as_stmt crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:6— FunctionTooLong — pgls_pretty_print::nodes::create_table_as_stmt::emit_create_table_as_stmt runs 108 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 8 over it, 1.08× 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: pgls_pretty_print_codegen::token_kind::token_kind_mod crates/pgls_pretty_print_codegen/src/token_kind.rs:59— FunctionTooLong — pgls_pretty_print_codegen::token_kind::token_kind_mod runs 108 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 8 over it, 1.08× 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: pgls_typecheck::diagnostics::create_type_error crates/pgls_typecheck/src/diagnostics.rs:157— FunctionTooLong — pgls_typecheck::diagnostics::create_type_error runs 106 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 6 over it, 1.06× 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: pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt crates/pgls_pretty_print/src/nodes/grant_stmt.rs:5— FunctionTooLong — pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
pgls_catalog::resolve::column_name::step (cyclomatic 60) crates/pgls_catalog/src/resolve/column_name.rs:112— pgls_catalog::resolve::column_name::step has cyclomatic complexity 60 (threshold 15). Of this number, 59 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
pgls_catalog::typing::overload::select_candidate (cyclomatic 46) crates/pgls_catalog/src/typing/overload/mod.rs:107— pgls_catalog::typing::overload::select_candidate has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_catalog::resolve::nodes::resolve_node_enum (cyclomatic 45) crates/pgls_catalog/src/resolve/nodes/mod.rs:57— pgls_catalog::resolve::nodes::resolve_node_enum has cyclomatic complexity 45 (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.
pgls_catalog::resolve::expr::a_expr::infer_a_expr (cyclomatic 43) crates/pgls_catalog/src/resolve/expr/a_expr.rs:18— pgls_catalog::resolve::expr::a_expr::infer_a_expr 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.
pgls_catalog::typing::unify::check_generic_type_consistency (cyclomatic 38) crates/pgls_catalog/src/typing/unify.rs:101— pgls_catalog::typing::unify::check_generic_type_consistency has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_catalog::typing::unify::resolve_polymorphic_result (cyclomatic 37) crates/pgls_catalog/src/typing/unify.rs:234— pgls_catalog::typing::unify::resolve_polymorphic_result has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pgls_catalog::session::transaction::prevents_transaction_block (cyclomatic 30) crates/pgls_catalog/src/session/transaction.rs:49— pgls_catalog::session::transaction::prevents_transaction_block has cyclomatic complexity 30 (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.
pgls_catalog::catalog::ddl::create_function_stmt::apply_create_function_stmt (cyclomatic 26) crates/pgls_catalog/src/catalog/ddl/create_function_stmt.rs:19— pgls_catalog::catalog::ddl::create_function_stmt::apply_create_function_stmt 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.
pgls_catalog::catalog::ddl::create_stmt::create_table (cyclomatic 25) crates/pgls_catalog/src/catalog/ddl/create_stmt.rs:32— pgls_catalog::catalog::ddl::create_stmt::create_table 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.
pgls_catalog::catalog::ddl::drop_stmt::apply_drop_stmt (cyclomatic 23) crates/pgls_catalog/src/catalog/ddl/drop_stmt.rs:15— pgls_catalog::catalog::ddl::drop_stmt::apply_drop_stmt 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.
pgls_catalog::catalog::ddl::index_stmt::index_columns (cyclomatic 23) crates/pgls_catalog/src/catalog/ddl/index_stmt.rs:78— pgls_catalog::catalog::ddl::index_stmt::index_columns 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.
pgls_catalog::typing::overload::function::select_function (cyclomatic 21) crates/pgls_catalog/src/typing/overload/function.rs:20— pgls_catalog::typing::overload::function::select_function 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.
pgls_catalog::catalog::ddl::alter_table_stmt::apply_column_change (cyclomatic 20) crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs:369— pgls_catalog::catalog::ddl::alter_table_stmt::apply_column_change 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.
pgls_catalog::typing::coerce::can_coerce (cyclomatic 20) crates/pgls_catalog/src/typing/coerce.rs:118— pgls_catalog::typing::coerce::can_coerce 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.
pgls_catalog::typing::overload::candidates::expand_candidates (cyclomatic 20) crates/pgls_catalog/src/typing/overload/candidates.rs:22— pgls_catalog::typing::overload::candidates::expand_candidates 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.
pgls_catalog::resolve::nodes::create_function_stmt::resolve_create_function_stmt (cyclomatic 19) crates/pgls_catalog/src/resolve/nodes/create_function_stmt.rs:66— pgls_catalog::resolve::nodes::create_function_stmt::resolve_create_function_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.
pgls_catalog::typing::coerce::find_coercion_pathway (cyclomatic 19) crates/pgls_catalog/src/typing/coerce.rs:22— pgls_catalog::typing::coerce::find_coercion_pathway 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.
pgls_catalog::typing::unify::select_common_type (cyclomatic 19) crates/pgls_catalog/src/typing/unify.rs:19— pgls_catalog::typing::unify::select_common_type 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.
pgls_catalog::catalog::ddl::rename_stmt::apply_rename_stmt (cyclomatic 18) crates/pgls_catalog/src/catalog/ddl/rename_stmt.rs:16— pgls_catalog::catalog::ddl::rename_stmt::apply_rename_stmt 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.
pgls_catalog::resolve::nodes::func_call::resolve_func_call (cyclomatic 18) crates/pgls_catalog/src/resolve/nodes/func_call.rs:16— pgls_catalog::resolve::nodes::func_call::resolve_func_call 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.
pgls_catalog::resolve::nodes::create_function_stmt::declared_type (cyclomatic 17) crates/pgls_catalog/src/resolve/nodes/create_function_stmt.rs:298— pgls_catalog::resolve::nodes::create_function_stmt::declared_type 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.
pgls_catalog::resolve::nodes::range_function::resolve_range_function (cyclomatic 17) crates/pgls_catalog/src/resolve/nodes/range_function.rs:28— pgls_catalog::resolve::nodes::range_function::resolve_range_function 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.
pgls_catalog::resolve::nodes::select_stmt::resolve_select (cyclomatic 17) crates/pgls_catalog/src/resolve/nodes/select_stmt.rs:140— pgls_catalog::resolve::nodes::select_stmt::resolve_select 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.
pgls_catalog::catalog::ddl::alter_table_stmt::apply_inheritance_changes (cyclomatic 16) crates/pgls_catalog/src/catalog/ddl/alter_table_stmt.rs:149— pgls_catalog::catalog::ddl::alter_table_stmt::apply_inheritance_changes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TodoComment xtask/codegen/src/glue.rs:201— // TODO: Audit that the environment access only happens in single-threaded code. — 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 xtask/codegen/src/glue.rs:207— // TODO: Audit that the environment access only happens in single-threaded code. — 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 xtask/codegen/src/glue.rs:209— // TODO: Audit that the environment access only happens in single-threaded code. — 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 packages/@postgrestools/backend-jsonrpc/src/transport.ts:252— // TODO: Not implemented at the moment — 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 packages/@postgrestools/backend-jsonrpc/src/transport.ts:257— // TODO: Not implemented at the moment — 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 packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:252— // TODO: Not implemented at the moment — 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 packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:257— // TODO: Not implemented at the moment — 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/pgls_workspace/src/workspace/client.rs:53— // TODO: The current implementation of the JSON-RPC protocol in — 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/pgls_text_size/src/text_range_replacement.rs:234— // todo(@juleswritescode): optimize with windows — 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/pgls_query/src/split.rs:77— // TODO: consider comparing the new value of start to the old value — 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/pgls_pretty_print_codegen/build.rs:6— // TODO make this selectable via feature flags — 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/pgls_pretty_print/src/nodes/column_def.rs:82— // TODO: Handle IDENTITY constraints specially — 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/pgls_pretty_print/src/nodes/scalar_array_op_expr.rs:20— // TODO: derive operator token from opno instead of assuming equality. — 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/pgls_plpgsql_check/src/diagnostics.rs:244— // - TODO: check "LOOP", "CASE", "WHILE", "EXPECTION" and others — 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/pgls_fs/src/fs/os.rs:307— // TODO: remove in 2.0, and directly use `.gitignore` — 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/pgls_diagnostics/src/display/frame.rs:267— // TODO: instead of calculating lines for every match, — 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.
Duplicated block (11 lines × 2) crates/pgls_configuration_macros/src/partial_derive/attrs.rs:52— crates/pgls_configuration_macros/src/partial_derive/attrs.rs:52-62 | crates/pgls_configuration_macros/src/partial_derive/attrs.rs:92-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_configuration_macros/src/partial_derive/attrs.rs:52` 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/pgls_diagnostics/src/display/diff.rs:558— crates/pgls_diagnostics/src/display/diff.rs:558-568 | crates/pgls_diagnostics/src/display/diff.rs:573-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_diagnostics/src/display/diff.rs:558` it begins part-way through the construct above it, so those exact lines 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/pgls_diagnostics_macros/src/generate.rs:27— crates/pgls_diagnostics_macros/src/generate.rs:27-37 | crates/pgls_diagnostics_macros/src/generate.rs:265-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_diagnostics_macros/src/generate.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `DeriveStructInput` in one and `DeriveEnumInput` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) crates/pgls_pretty_print/src/nodes/a_expr.rs:220— crates/pgls_pretty_print/src/nodes/a_expr.rs:220-230 | crates/pgls_pretty_print/src/nodes/a_expr.rs:248-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/pgls_pretty_print/src/nodes/a_expr.rs:220` 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/pgls_pretty_print/src/nodes/a_expr.rs:245` calls `token`, `space` and `crates/pgls_pretty_print/src/nodes/a_expr.rs:217` 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/pgls_pretty_print/src/nodes/alter_domain_stmt.rs:70— crates/pgls_pretty_print/src/nodes/alter_domain_stmt.rs:70-80 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:220-230 — before extracting anything, compare `crates/pgls_pretty_print/src/nodes/alter_domain_stmt.rs` and `crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/pgls_pretty_print/src/nodes/alter_operator_stmt.rs:85— crates/pgls_pretty_print/src/nodes/alter_operator_stmt.rs:85-95 | crates/pgls_pretty_print/src/nodes/define_stmt.rs:164-174 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) crates/pgls_pretty_print/src/nodes/clauses/options.rs:214— crates/pgls_pretty_print/src/nodes/clauses/options.rs:214-224 | crates/pgls_pretty_print/src/nodes/clauses/options.rs:227-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/clauses/options.rs:214` it begins part-way through the construct above it, so those exact lines 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/pgls_pretty_print/src/nodes/grant_role_stmt.rs:70— crates/pgls_pretty_print/src/nodes/grant_role_stmt.rs:70-80 | crates/pgls_pretty_print/src/nodes/grant_stmt.rs:154-164 — 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/pgls_pretty_print/src/nodes/grant_role_stmt.rs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/pgls_pretty_print/src/nodes/index_elem.rs:6— crates/pgls_pretty_print/src/nodes/index_elem.rs:6-16 | crates/pgls_pretty_print/src/nodes/stats_elem.rs:6-16 — 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 `n` to `&IndexElem` in one and `&StatsElem` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) crates/pgls_pretty_print/src/nodes/index_elem.rs:22— crates/pgls_pretty_print/src/nodes/index_elem.rs:22-32 | crates/pgls_pretty_print/src/nodes/partition_elem.rs:19-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/index_elem.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&IndexElem` in one and `&PartitionElem` 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/pgls_pretty_print/src/nodes/index_elem.rs:14` calls `is_empty`, `emit_identifier_maybe_quoted` and `crates/pgls_pretty_print/src/nodes/partition_elem.rs:15` 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/pgls_pretty_print/src/nodes/json_constructor_expr.rs:43— crates/pgls_pretty_print/src/nodes/json_constructor_expr.rs:43-53 | crates/pgls_pretty_print/src/nodes/json_object_constructor.rs:18-28 — 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 `n` to `&JsonConstructorExpr` in one and `&JsonObjectConstructor` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) crates/pgls_pretty_print_codegen/src/proto_analyser.rs:38— crates/pgls_pretty_print_codegen/src/proto_analyser.rs:38-48 | crates/pgls_query_macros/src/proto_analyser.rs:129-139 — 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/pgls_pretty_print_codegen/src/proto_analyser.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.
Duplicated block (11 lines × 2) crates/pgls_pretty_print/src/nodes/clauses/window_frame.rs:127— crates/pgls_pretty_print/src/nodes/clauses/window_frame.rs:127-137 | crates/pgls_pretty_print/src/nodes/clauses/window_frame.rs:160-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/clauses/window_frame.rs:127` 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/pgls_cli/src/service/unix.rs:33— crates/pgls_cli/src/service/unix.rs:33-43 | crates/pgls_cli/src/service/windows.rs:36-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/pgls_cli/src/service/unix.rs:33` 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/pgls_console/src/markup.rs:202— crates/pgls_console/src/markup.rs:202-210 | crates/pgls_console/src/markup.rs:224-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_console/src/markup.rs:202` 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/pgls_pretty_print/src/nodes/a_expr.rs:454— crates/pgls_pretty_print/src/nodes/a_expr.rs:454-462 | crates/pgls_pretty_print/src/nodes/a_expr.rs:514-522 — both copies are in the same file, so extract the 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/pgls_pretty_print/src/nodes/a_expr.rs:523` calls `token`, `space` and `crates/pgls_pretty_print/src/nodes/a_expr.rs:465` 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/pgls_pretty_print/src/nodes/aggref.rs:46— crates/pgls_pretty_print/src/nodes/aggref.rs:46-54 | crates/pgls_pretty_print/src/nodes/window_func.rs:29-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&Aggref` in one and `&WindowFunc` 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/pgls_pretty_print/src/nodes/window_func.rs:27` calls `token` and `crates/pgls_pretty_print/src/nodes/aggref.rs:44` 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/pgls_pretty_print/src/nodes/alter_default_privileges_stmt.rs:29— crates/pgls_pretty_print/src/nodes/alter_default_privileges_stmt.rs:29-37 | crates/pgls_pretty_print/src/nodes/alter_default_privileges_stmt.rs:43-51 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/alter_default_privileges_stmt.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 (9 lines × 2) crates/pgls_pretty_print/src/nodes/alter_publication_stmt.rs:44— crates/pgls_pretty_print/src/nodes/alter_publication_stmt.rs:44-52 | crates/pgls_pretty_print/src/nodes/create_publication_stmt.rs:14-22 — 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/pgls_pretty_print/src/nodes/alter_publication_stmt.rs:44` 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 `n` to `&AlterPublicationStmt` in one and `&CreatePublicationStmt` 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/pgls_pretty_print/src/nodes/create_stmt.rs:230— crates/pgls_pretty_print/src/nodes/create_stmt.rs:230-239 | crates/pgls_pretty_print/src/nodes/into_clause.rs:62-70 — 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/pgls_pretty_print/src/nodes/create_stmt.rs:230` it begins part-way through the construct above it, so those exact lines 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/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:103— crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:103-111 | crates/pgls_pretty_print/src/nodes/into_clause.rs:95-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) crates/pgls_pretty_print/src/nodes/select_stmt.rs:91— crates/pgls_pretty_print/src/nodes/select_stmt.rs:91-99 | crates/pgls_pretty_print/src/nodes/select_stmt.rs:326-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/pgls_pretty_print/src/nodes/select_stmt.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 (9 lines × 2) crates/pgls_pretty_print/src/nodes/sub_link.rs:23— crates/pgls_pretty_print/src/nodes/sub_link.rs:23-32 | crates/pgls_pretty_print/src/nodes/sub_link.rs:70-78 — both copies are in the same file, so extract the 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/pgls_pretty_print/src/nodes/sub_link.rs:35` calls `space`, `token` and `crates/pgls_pretty_print/src/nodes/sub_link.rs:81` 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/pgls_treesitter/src/queries/insert_columns.rs:51— crates/pgls_treesitter/src/queries/insert_columns.rs:51-59 | crates/pgls_treesitter/src/queries/table_aliases.rs:100-108 — 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/pgls_treesitter/src/queries/insert_columns.rs:51` 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/pgls_treesitter/src/queries/mod.rs:62— crates/pgls_treesitter/src/queries/mod.rs:62-70 | crates/pgls_treesitter/src/queries/mod.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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) xtask/codegen/src/generate_configuration.rs:1142— xtask/codegen/src/generate_configuration.rs:1142-1150 | xtask/codegen/src/generate_configuration.rs:1542-1550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_configuration.rs:1142` it begins part-way through the construct above it, so those exact lines 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/pgls_treesitter/src/queries/select_columns.rs:30— crates/pgls_treesitter/src/queries/select_columns.rs:30-38 | crates/pgls_treesitter/src/queries/where_columns.rs:40-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/pgls_pretty_print/src/nodes/multi_assign_ref.rs:5— crates/pgls_pretty_print/src/nodes/multi_assign_ref.rs:5-13 | crates/pgls_pretty_print/src/nodes/raw_stmt.rs:5-13 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&MultiAssignRef` in one and `&RawStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) crates/pgls_catalog/src/catalog/overlay.rs:250— crates/pgls_catalog/src/catalog/overlay.rs:250-259 | crates/pgls_catalog/src/catalog/overlay.rs:657-666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_catalog/src/catalog/overlay.rs:250` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) crates/pgls_diagnostics/src/display/frame.rs:74— crates/pgls_diagnostics/src/display/frame.rs:74-83 | crates/pgls_diagnostics/src/display/frame.rs:121-130 — both copies are in the same file, so extract the 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/pgls_diagnostics/src/display_github.rs:94— crates/pgls_diagnostics/src/display_github.rs:94-103 | crates/pgls_diagnostics/src/display_github.rs:112-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_diagnostics/src/display_github.rs:94` 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/pgls_diagnostics/src/display_github.rs:123` calls `push_str` and `crates/pgls_diagnostics/src/display_github.rs:105` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/pgls_pretty_print/src/nodes/alter_type_stmt.rs:24— crates/pgls_pretty_print/src/nodes/alter_type_stmt.rs:24-33 | crates/pgls_pretty_print/src/nodes/index_elem.rs:38-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/pgls_pretty_print/src/nodes/alter_type_stmt.rs:24` 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/pgls_pretty_print/src/nodes/clauses/set_clause.rs:131— crates/pgls_pretty_print/src/nodes/clauses/set_clause.rs:131-140 | crates/pgls_pretty_print/src/nodes/select_stmt.rs:438-451 — 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/pgls_pretty_print/src/nodes/clauses/set_clause.rs:131` it begins part-way through the construct above it, so those exact lines 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/pgls_pretty_print/src/nodes/create_publication_stmt.rs:36— crates/pgls_pretty_print/src/nodes/create_publication_stmt.rs:36-45 | crates/pgls_pretty_print/src/nodes/publication_table.rs:8-17 — 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/pgls_pretty_print/src/nodes/create_publication_stmt.rs:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:98— crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:98-107 | crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:109-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/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:98` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:96` calls `space`, `token`, `IDENT` and `crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:108` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/pgls_pretty_print/src/nodes/type_name.rs:236— crates/pgls_pretty_print/src/nodes/type_name.rs:236-245 | crates/pgls_pretty_print/src/nodes/type_name.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/pgls_pretty_print/src/nodes/type_name.rs:236` 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) xtask/codegen/src/generate_configuration.rs:1047— xtask/codegen/src/generate_configuration.rs:1047-1056 | xtask/codegen/src/generate_configuration.rs:1512-1521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_configuration.rs:1047` it begins part-way through the construct above it, so those exact lines 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/pgls_wasm/src/ffi.rs:242— crates/pgls_wasm/src/ffi.rs:242-251 | crates/pgls_wasm/src/ffi.rs:273-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_wasm/src/ffi.rs:242` it begins part-way through the construct above it, so those exact lines 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/pgls_fs/src/fs.rs:159— crates/pgls_fs/src/fs.rs:159-168 | crates/pgls_fs/src/fs.rs:169-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_fs/src/fs.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.
Duplicated block (10 lines × 2) docs/codegen/src/rules_index.rs:33— docs/codegen/src/rules_index.rs:33-42 | docs/codegen/src/rules_index.rs:203-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 `docs/codegen/src/rules_index.rs:33` 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/pgls_cli/src/commands/daemon.rs:144— crates/pgls_cli/src/commands/daemon.rs:144-155 | crates/pgls_cli/src/commands/daemon.rs:159-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/pgls_pretty_print/src/nodes/a_expr.rs:209— crates/pgls_pretty_print/src/nodes/a_expr.rs:209-220 | crates/pgls_pretty_print/src/nodes/a_expr.rs:235-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/pgls_pretty_print/src/nodes/alter_domain_stmt.rs:31— crates/pgls_pretty_print/src/nodes/alter_domain_stmt.rs:31-42 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:130-141 — before extracting anything, compare `crates/pgls_pretty_print/src/nodes/alter_domain_stmt.rs` and `crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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/pgls_pretty_print/src/nodes/alter_table_cmd.rs:130` 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/pgls_pretty_print/src/nodes/create_stmt.rs:82— crates/pgls_pretty_print/src/nodes/create_stmt.rs:82-93 | crates/pgls_pretty_print/src/nodes/create_stmt.rs:132-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/create_stmt.rs:82` 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/pgls_pretty_print/src/nodes/on_conflict_clause.rs:28— crates/pgls_pretty_print/src/nodes/on_conflict_clause.rs:28-39 | crates/pgls_pretty_print/src/nodes/on_conflict_expr.rs:33-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/on_conflict_clause.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&OnConflictClause` in one and `&OnConflictExpr` 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/pgls_query_macros/src/node_mut.rs:6— crates/pgls_query_macros/src/node_mut.rs:6-17 | crates/pgls_query_macros/src/node_ref.rs:6-17 — 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/pgls_query_macros/src/node_mut.rs:6` 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) xtask/codegen/src/generate_configuration.rs:946— xtask/codegen/src/generate_configuration.rs:946-957 | xtask/codegen/src/generate_configuration.rs:1464-1475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_configuration.rs:946` it begins part-way through the construct above it, so those exact lines 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) xtask/codegen/src/generate_pglinter.rs:460— xtask/codegen/src/generate_pglinter.rs:460-471 | xtask/codegen/src/generate_pglinter.rs:482-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_pglinter.rs:460` it begins part-way through the construct above it, so those exact lines 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/pgls_pretty_print/src/nodes/load_stmt.rs:5— crates/pgls_pretty_print/src/nodes/load_stmt.rs:5-16 | crates/pgls_pretty_print/src/nodes/variable_show_stmt.rs:5-16 — 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 `n` to `&LoadStmt` in one and `&VariableShowStmt` 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) xtask/codegen/src/generate_pglinter.rs:455— xtask/codegen/src/generate_pglinter.rs:455-466 | xtask/codegen/src/generate_splinter.rs:470-481 — before extracting anything, compare `xtask/codegen/src/generate_pglinter.rs` and `xtask/codegen/src/generate_splinter.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 133 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 `xtask/codegen/src/generate_pglinter.rs:455` it begins part-way through the construct above it, so those 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 `rules` to `&BTreeMap<String, PglinterRuleMeta>` in one and `&BTreeMap<String, SqlRuleMetadata>` 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/pgls_lexer_codegen/src/syntax_kind.rs:120— crates/pgls_lexer_codegen/src/syntax_kind.rs:120-129 | crates/pgls_pretty_print_codegen/src/token_kind.rs:132-139 — 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/pgls_lexer_codegen/src/syntax_kind.rs:120` it begins part-way through the construct above it, so those 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/pgls_lexer_codegen/src/syntax_kind.rs:117` calls `push` and `crates/pgls_pretty_print_codegen/src/token_kind.rs:131` 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/pgls_pretty_print/src/nodes/copy_stmt.rs:56— crates/pgls_pretty_print/src/nodes/copy_stmt.rs:56-63 | crates/pgls_pretty_print/src/nodes/create_stmt.rs:236-243 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/copy_stmt.rs:56` 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/pgls_pretty_print/src/nodes/create_transform_stmt.rs:38— crates/pgls_pretty_print/src/nodes/create_transform_stmt.rs:38-45 | crates/pgls_pretty_print/src/nodes/create_transform_stmt.rs:55-62 — both copies are in the same file, so extract the 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/pgls_pretty_print/src/nodes/json_array_agg.rs:32— crates/pgls_pretty_print/src/nodes/json_array_agg.rs:32-39 | crates/pgls_pretty_print/src/nodes/json_object_agg.rs:33-40 — before extracting anything, compare `crates/pgls_pretty_print/src/nodes/json_array_agg.rs` and `crates/pgls_pretty_print/src/nodes/json_object_agg.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/json_array_agg.rs:32` 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/pgls_pretty_print/src/normalize.rs:219— crates/pgls_pretty_print/src/normalize.rs:219-226 | crates/pgls_pretty_print/src/normalize.rs:228-235 — both copies are in the same file, so extract the 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 (8 lines × 2) crates/pgls_pretty_print/src/renderer.rs:87— crates/pgls_pretty_print/src/renderer.rs:87-94 | crates/pgls_pretty_print/src/renderer.rs:241-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/renderer.rs:87` 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 (8 lines × 2) crates/pgls_treesitter/src/queries/relations.rs:61— crates/pgls_treesitter/src/queries/relations.rs:61-68 | crates/pgls_treesitter/src/queries/select_columns.rs:67-74 — 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/pgls_treesitter/src/queries/relations.rs:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/pgls_workspace/src/workspace/server.rs:1653— crates/pgls_workspace/src/workspace/server.rs:1653-1660 | crates/pgls_workspace/src/workspace/server.rs:1725-1732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_workspace/src/workspace/server.rs:1653` 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) xtask/codegen/src/generate_configuration.rs:291— xtask/codegen/src/generate_configuration.rs:291-298 | xtask/codegen/src/generate_configuration.rs:1270-1277 — both copies are in the same file, so extract the 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) xtask/codegen/src/generate_splinter.rs:212— xtask/codegen/src/generate_splinter.rs:212-219 | xtask/codegen/src/generate_splinter.rs:433-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_splinter.rs:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
pgls_workspace::workspace::server::formatting::format_document (cognitive 73) crates/pgls_workspace/src/workspace/server/formatting.rs:51— pgls_workspace::workspace::server::formatting::format_document has cognitive complexity 73 (threshold 15). Drivers by points: if/else 24 (55 pts), match/switch 3 (9 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_workspace::configuration::layers::apply_override (cognitive 28) crates/pgls_workspace/src/configuration/layers.rs:78— pgls_workspace::configuration::layers::apply_override has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (26 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.
pgls_workspace::workspace_types::generate_type (cognitive 24) crates/pgls_workspace/src/workspace_types.rs:285— pgls_workspace::workspace_types::generate_type has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 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.
pgls_workspace::features::code_actions::lint::fix_file (cognitive 19) crates/pgls_workspace/src/features/code_actions/lint.rs:109— pgls_workspace::features::code_actions::lint::fix_file has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 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.
pgls_workspace::configuration::find_nested_configurations (cognitive 17) crates/pgls_workspace/src/configuration.rs:310— pgls_workspace::configuration::find_nested_configurations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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.
pgls_workspace::features::code_actions::execute_statement::execution::collect_result (cognitive 17) crates/pgls_workspace/src/features/code_actions/execute_statement/execution.rs:234— pgls_workspace::features::code_actions::execute_statement::execution::collect_result has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (3 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.
pgls_workspace::features::code_actions::expand_star::is_at_star_in (cognitive 17) crates/pgls_workspace/src/features/code_actions/expand_star.rs:58— pgls_workspace::features::code_actions::expand_star::is_at_star_in has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pgls_workspace::configuration::apply_extends_transitively (cognitive 16) crates/pgls_workspace/src/configuration.rs:862— pgls_workspace::configuration::apply_extends_transitively has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (5 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.
pgls_workspace::workspace_types::make_union_type (cognitive 16) crates/pgls_workspace/src/workspace_types.rs:138— pgls_workspace::workspace_types::make_union_type has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileTooLong: REDACTED REDACTED— FileTooLong — 3078 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 2578 over it, 6.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: workspace/server.rs crates/pgls_workspace/src/workspace/server.rs— FileTooLong — 1204 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 704 over it, 2.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: nodes/mod.rs crates/pgls_pretty_print/src/nodes/mod.rs— FileTooLong — 829 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 329 over it, 1.66× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/settings.rs crates/pgls_workspace/src/settings.rs— FileTooLong — 728 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 228 over it, 1.46× 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/session.rs crates/pgls_lsp/src/session.rs— FileTooLong — 699 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 199 over it, 1.40× 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/configuration.rs crates/pgls_workspace/src/configuration.rs— FileTooLong — 601 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 101 over it, 1.20× 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: catalog/overlay.rs crates/pgls_catalog/src/catalog/overlay.rs— FileTooLong — 589 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: Catalog (17-818). The bar is 500 significant lines; this is 89 over it, 1.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: nodes/alter_table_cmd.rs crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs— FileTooLong — 576 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 76 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: server/document.rs crates/pgls_workspace/src/workspace/server/document.rs— FileTooLong — 513 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 13 over it, 1.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Duplicated block (14 lines × 2) crates/pgls_catalog/src/resolve/mod.rs:336— crates/pgls_catalog/src/resolve/mod.rs:336-349 | crates/pgls_catalog/src/resolve/mod.rs:352-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. 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/pgls_pretty_print/src/nodes/alter_table_cmd.rs:96— crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:96-109 | crates/pgls_pretty_print/src/nodes/column_def.rs:22-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.
Duplicated block (14 lines × 2) crates/pgls_pretty_print/src/nodes/clauses/options.rs:95— crates/pgls_pretty_print/src/nodes/clauses/options.rs:95-108 | crates/pgls_pretty_print/src/nodes/clauses/options.rs:134-147 — both copies are in the same file, so extract the 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/pgls_pretty_print/src/nodes/coalesce_expr.rs:9— crates/pgls_pretty_print/src/nodes/coalesce_expr.rs:9-22 | crates/pgls_pretty_print/src/nodes/min_max_expr.rs:15-28 — 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/pgls_pretty_print/src/nodes/coalesce_expr.rs:9` 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 `n` to `&CoalesceExpr` in one and `&MinMaxExpr` 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/pgls_pretty_print/src/nodes/create_stmt.rs:95— crates/pgls_pretty_print/src/nodes/create_stmt.rs:95-108 | crates/pgls_pretty_print/src/nodes/create_stmt.rs:146-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/pgls_pretty_print/src/nodes/create_stmt.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/pgls_pretty_print/src/nodes/func_call.rs:300— crates/pgls_pretty_print/src/nodes/func_call.rs:300-313 | crates/pgls_pretty_print/src/nodes/func_call.rs:334-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/func_call.rs:300` 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/pgls_pretty_print/src/nodes/select_stmt.rs:101— crates/pgls_pretty_print/src/nodes/select_stmt.rs:101-114 | crates/pgls_pretty_print/src/nodes/select_stmt.rs:336-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/select_stmt.rs:101` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) crates/pgls_workspace/src/workspace/server.rs:1521— crates/pgls_workspace/src/workspace/server.rs:1521-1534 | crates/pgls_workspace/src/workspace/server.rs:1576-1589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_workspace/src/workspace/server.rs:1521` 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 `params` to `GetCompletionsParams` in one and `OnHoverParams` 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/pgls_catalog/src/resolve/nodes/delete_stmt.rs:27— crates/pgls_catalog/src/resolve/nodes/delete_stmt.rs:27-33 | crates/pgls_catalog/src/resolve/nodes/update_stmt.rs:31-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&DeleteStmt` in one and `&UpdateStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/pgls_catalog/src/resolve/nodes/update_stmt.rs:41` calls `resolve_set_clause` and `crates/pgls_catalog/src/resolve/nodes/delete_stmt.rs:37` 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/pgls_diagnostics_macros/src/generate.rs:192— crates/pgls_diagnostics_macros/src/generate.rs:192-198 | crates/pgls_diagnostics_macros/src/generate.rs:207-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_diagnostics_macros/src/generate.rs:192` 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/pgls_fs/src/fs/os.rs:38— crates/pgls_fs/src/fs/os.rs:38-44 | crates/pgls_fs/src/fs/os.rs:51-57 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_fs/src/fs/os.rs:38` 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/pgls_pretty_print/src/nodes/alter_tsdictionary_stmt.rs:23— crates/pgls_pretty_print/src/nodes/alter_tsdictionary_stmt.rs:23-29 | crates/pgls_pretty_print/src/nodes/create_stmt.rs:241-247 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/pgls_query_macros/src/iter_mut.rs:107— crates/pgls_query_macros/src/iter_mut.rs:107-113 | crates/pgls_query_macros/src/iter_ref.rs:75-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_query_macros/src/iter_mut.rs:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) xtask/codegen/src/generate_configuration.rs:707— xtask/codegen/src/generate_configuration.rs:707-713 | xtask/codegen/src/generate_configuration.rs:1331-1337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_configuration.rs:707` 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/pgls_lsp/src/handlers/code_actions.rs:187— crates/pgls_lsp/src/handlers/code_actions.rs:187-193 | crates/pgls_wasm/src/lsp.rs:665-671 — 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 `requested` to `&ls_types::CodeActionKind` in one and `&CodeActionKind` 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) REDACTED:252— REDACTED:252-258 | xtask/codegen/src/lib.rs:161-167 — 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.
Change coupling: document.rs ↔ tree.rs crates/pgls_workspace/src/workspace/server/document.rs:1— `crates/pgls_workspace/src/workspace/server/document.rs` and `crates/pgls_workspace/src/workspace/server/document_cache/tree.rs` change together 75% of the time (9 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 9 shared commits counted here, the most recent 3 are `9c133868` refactor(workspace): no panics in the document and its caches (#1064); `19a9300d` perf(workspace): drop only the statements an edit removed from the ca…; `4e4b718b` perf(workspace): one memory budget for the caches of the open documen… — run `git show` on any of them.
Change coupling: filtering.rs ↔ scoring.rs crates/pgls_completions/src/relevance/filtering.rs:1— `crates/pgls_completions/src/relevance/filtering.rs` and `crates/pgls_completions/src/relevance/scoring.rs` change together 72% of the time (13 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `2401f198` fix(completions): complete keywords right after an opening parenthesi…; `9740db65` feat(completions): complete inside MERGE (#1130); `7645850a` feat(completions): complete the columns of old and new in RETURNING (… — run `git show` on any of them.
Change coupling: functions.rs ↔ tables.rs crates/pgls_completions/src/providers/functions.rs:1— `crates/pgls_completions/src/providers/functions.rs` and `crates/pgls_completions/src/providers/tables.rs` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `3db26f49` refactor(completions): remove custom parse for policies, use tree-sit… (at that commit the files were still `crates/pgt_completions/src/providers/functions.rs` and `crates/pgt_completions/src/providers/tables.rs`); `98ae38f9` feat(completions): correctly infer (quoted) schema for tables & funct… (at that commit the files were still `crates/pgt_completions/src/providers/functions.rs` and `crates/pgt_completions/src/providers/tables.rs`); `be944613` feat(completions): fill in alias for columns in join clauses (#392) (at that commit the files were still `crates/pgt_completions/src/providers/functions.rs` and `crates/pgt_completions/src/providers/tables.rs`) — run `git show` on any of them.
Change coupling: mod.rs ↔ hovered_node.rs crates/pgls_catalog/src/snapshot/mod.rs:1— `crates/pgls_catalog/src/snapshot/mod.rs` and `crates/pgls_hover/src/hovered_node.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 `0625f0c9` chore: remove dead code (#989); `2097b893` fix: normalise identifiers the same way everywhere (#976); `8e6da9d8` feat(hover): hover on schemas (#514) (at that commit the files were still `crates/pgt_schema_cache/src/schema_cache.rs` and `crates/pgt_hover/src/hovered_node.rs`) — run `git show` on any of them.
Change coupling: mod.rs ↔ settings.rs crates/pgls_cli/src/commands/mod.rs:1— `crates/pgls_cli/src/commands/mod.rs` and `crates/pgls_workspace/src/settings.rs` change together 53% of the time (10 of the 19 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 `72b0def6` perf(workspace): bound nested configuration discovery (#895); `d89118d6` feat: support standard postgres env vars for db connection (#674); `c39d3b8f` fix: address wasm pr feedback (#666) — run `git show` on any of them.
Change coupling: columns.rs ↔ REDACTED crates/pgls_completions/src/providers/columns.rs:1— `crates/pgls_completions/src/providers/columns.rs` and `REDACTED` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `8668c7d6` feat(grammar): parse the alias and USING of DELETE and resolve UPDATE…; `2401f198` fix(completions): complete keywords right after an opening parenthesi…; `9740db65` feat(completions): complete inside MERGE (#1130) — run `git show` on any of them.
Change coupling: mod.rs ↔ database.rs crates/pgls_cli/src/commands/mod.rs:1— `crates/pgls_cli/src/commands/mod.rs` and `crates/pgls_configuration/src/database.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `4cffc840` fix: keep each folder on its own settings (#902); `d89118d6` feat: support standard postgres env vars for db connection (#674); `2820bb5e` fix: do not attempt db connection if jsonc section is missing (#375) (at that commit the files were still `crates/pgt_cli/src/commands/mod.rs` and `crates/pgt_configuration/src/database.rs`) — run `git show` on any of them.
Duplicated block (6 lines × 2) crates/pgls_pretty_print/src/nodes/alter_operator_stmt.rs:22— crates/pgls_pretty_print/src/nodes/alter_operator_stmt.rs:22-27 | crates/pgls_pretty_print/src/nodes/alter_type_stmt.rs:18-23 — 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/pgls_pretty_print/src/nodes/alter_operator_stmt.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&AlterOperatorStmt` in one and `&AlterTypeStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) crates/pgls_suppressions/src/suppression.rs:133— crates/pgls_suppressions/src/suppression.rs:133-138 | crates/pgls_suppressions/src/suppression.rs:140-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) xtask/codegen/src/generate_configuration.rs:1087— xtask/codegen/src/generate_configuration.rs:1087-1092 | xtask/codegen/src/generate_configuration.rs:1526-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 `xtask/codegen/src/generate_configuration.rs:1087` 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/pgls_text_size/src/text_range_replacement.rs:118— crates/pgls_text_size/src/text_range_replacement.rs:118-123 | crates/pgls_text_size/src/text_range_replacement.rs:137-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/pgls_text_size/src/text_range_replacement.rs:118` it begins part-way through the construct above it, so those exact lines 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/pgls_pretty_print/src/nodes/alter_owner_stmt.rs:63— crates/pgls_pretty_print/src/nodes/alter_owner_stmt.rs:63-68 | crates/pgls_pretty_print/src/nodes/rename_stmt.rs:132-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/pgls_query_ext/src/function_body.rs:219— crates/pgls_query_ext/src/function_body.rs:219-224 | crates/pgls_semantic_tokens/src/lib.rs:295-300 — 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/pgls_pretty_print/src/nodes/do_stmt.rs:18— crates/pgls_pretty_print/src/nodes/do_stmt.rs:18-26 | crates/pgls_pretty_print/src/nodes/do_stmt.rs:32-37 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/do_stmt.rs:18` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Off the main sequence: pgls_tokenizer — pgls_tokenizer: 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: pgls_query — pgls_query: abstractness 0.00, instability 0.06, distance 0.94 — zone of pain — concrete and depended on by 17 project(s), so it's rigid to change.
Off the main sequence: pgls_line_index — pgls_line_index: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
Off the main sequence: pgls_env — pgls_env: 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: pgls_text_edit — pgls_text_edit: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: pgls_catalog — pgls_catalog: abstractness 0.03, instability 0.17, distance 0.80 — zone of pain — concrete and depended on by 19 project(s), so it's rigid to change.
Off the main sequence: pgls_text_size — pgls_text_size: abstractness 0.29, instability 0.00, distance 0.71 — zone of pain — concrete and depended on by 25 project(s), so it's rigid to change.
pgls_diagnostics::display::frame::print_frame (cognitive 71) crates/pgls_diagnostics/src/display/frame.rs:34— pgls_diagnostics::display::frame::print_frame has cognitive complexity 71 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 8 (26 pts), match/switch 8 (14 pts), boolean chains 4 (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.
pgls_diagnostics::display::diff::print_full_diff (cognitive 37) crates/pgls_diagnostics/src/display/diff.rs:479— pgls_diagnostics::display::diff::print_full_diff has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3 (9 pts), match/switch 2 (4 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.
pgls_diagnostics::display::frame::print_invisibles (cognitive 31) crates/pgls_diagnostics/src/display/frame.rs:391— pgls_diagnostics::display::frame::print_invisibles has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 7, 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.
pgls_diagnostics::display::backtrace::print_backtrace (cognitive 30) crates/pgls_diagnostics/src/display/backtrace.rs:241— pgls_diagnostics::display::backtrace::print_backtrace has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (3 pts) (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.
pgls_diagnostics::display::diff::process_diff_ops (cognitive 18) crates/pgls_diagnostics/src/display/diff.rs:118— pgls_diagnostics::display::diff::process_diff_ops has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (6 pts), match/switch 2 (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.
pgls_diagnostics::display::diff::process_diff_lines (cognitive 17) crates/pgls_diagnostics/src/display/diff.rs:276— pgls_diagnostics::display::diff::process_diff_lines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×6
Edited copy of a member (19 corresponding lines) crates/pgls_wasm/src/ffi.rs:239— crates/pgls_wasm/src/ffi.rs:239-257 | crates/pgls_wasm/src/ffi.rs:270-288 — 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/pgls_completions/src/providers/columns.rs:17— crates/pgls_completions/src/providers/columns.rs:17-35 | crates/pgls_completions/src/providers/functions.rs:17-35 — 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/pgls_pretty_print/src/nodes/distinct_expr.rs:6— crates/pgls_pretty_print/src/nodes/distinct_expr.rs:6-25 | crates/pgls_pretty_print/src/nodes/op_expr.rs:8-26 — 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/pgls_catalog/src/catalog/ddl/create_seq_stmt.rs:9— crates/pgls_catalog/src/catalog/ddl/create_seq_stmt.rs:9-27 | crates/pgls_catalog/src/catalog/ddl/into_clause.rs:14-32 — 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/pgls_console/src/write/termcolor.rs:21— crates/pgls_console/src/write/termcolor.rs:21-41 | crates/pgls_console/src/write/termcolor.rs:43-61 — 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/pgls_analyser/src/lint/style/prefer_text_field.rs:67— crates/pgls_analyser/src/lint/style/prefer_text_field.rs:67-85 | crates/pgls_analyser/src/lint/style/prefer_timestamptz.rs:81-102 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×6
Edited copy of a member (14 corresponding lines) crates/pgls_pretty_print/src/nodes/clauses/operators.rs:39— crates/pgls_pretty_print/src/nodes/clauses/operators.rs:39-56 | crates/pgls_pretty_print/src/nodes/object_with_args.rs:97-110 — 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/pgls_diagnostics_macros/src/generate.rs:185— crates/pgls_diagnostics_macros/src/generate.rs:185-198 | crates/pgls_diagnostics_macros/src/generate.rs:200-213 — 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/pgls_catalog/src/session/settings.rs:63— crates/pgls_catalog/src/session/settings.rs:63-76 | crates/pgls_catalog/src/session/settings.rs:79-92 — 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/pgls_wasm/src/ffi.rs:200— crates/pgls_wasm/src/ffi.rs:200-213 | crates/pgls_wasm/src/ffi.rs:297-310 — 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/pgls_wasm/src/lib.rs:397— crates/pgls_wasm/src/lib.rs:397-410 | crates/pgls_wasm/src/lib.rs:414-429 — 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/pgls_pretty_print/src/nodes/close_portal_stmt.rs:5— crates/pgls_pretty_print/src/nodes/close_portal_stmt.rs:5-18 | crates/pgls_pretty_print/src/nodes/deallocate_stmt.rs:5-18 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×6
Edited copy of a member (12 corresponding lines) crates/pgls_workspace/src/workspace/server.rs:158— crates/pgls_workspace/src/workspace/server.rs:158-171 | crates/pgls_workspace/src/workspace/server.rs:175-186 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/pgls_pretty_print/src/nodes/rename_stmt.rs:173— crates/pgls_pretty_print/src/nodes/rename_stmt.rs:173-189 | crates/pgls_pretty_print/src/nodes/rename_stmt.rs:207-218 — 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/pgls_console/src/lib.rs:143— crates/pgls_console/src/lib.rs:143-154 | crates/pgls_console/src/lib.rs:156-167 — 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/pgls_fs/src/fs/os.rs:287— crates/pgls_fs/src/fs/os.rs:287-298 | crates/pgls_fs/src/fs/os.rs:351-363 — 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/pgls_diagnostics/src/context.rs:572— crates/pgls_diagnostics/src/context.rs:572-583 | crates/pgls_diagnostics/src/context.rs:585-596 — 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/pgls_inlay_hints/src/lib.rs:56— crates/pgls_inlay_hints/src/lib.rs:56-67 | crates/pgls_semantic_tokens/src/lib.rs:62-73 — 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.
Duplicated block (13 lines × 2) crates/pgls_lsp/src/handlers/inlay_hints.rs:26— crates/pgls_lsp/src/handlers/inlay_hints.rs:26-38 | crates/pgls_lsp/src/handlers/semantic_tokens.rs:88-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_lsp/src/handlers/inlay_hints.rs:26` 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/pgls_lsp/src/server.rs:216— crates/pgls_lsp/src/server.rs:216-228 | crates/pgls_lsp/src/session.rs:282-294 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/pgls_pretty_print/src/nodes/a_expr.rs:154— crates/pgls_pretty_print/src/nodes/a_expr.rs:154-166 | crates/pgls_pretty_print/src/nodes/a_expr.rs:181-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/pgls_pretty_print/src/nodes/reindex_stmt.rs:14— crates/pgls_pretty_print/src/nodes/reindex_stmt.rs:14-26 | crates/pgls_pretty_print/src/nodes/vacuum_stmt.rs:18-30 — 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/pgls_pretty_print/src/nodes/reindex_stmt.rs:14` 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/pgls_treesitter/src/helper.rs:89— crates/pgls_treesitter/src/helper.rs:89-101 | crates/pgls_treesitter/src/helper.rs:107-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_treesitter/src/helper.rs:89` 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/pgls_cli/src/service/windows.rs:160— crates/pgls_cli/src/service/windows.rs:160-172 | crates/pgls_cli/src/service/windows.rs:293-305 — both copies are in the same file, so extract the 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.
TooManyMethods: Catalog crates/pgls_catalog/src/catalog/mod.rs:58— TooManyMethods — 66 methods, declared across 5 files: catalog/overlay.rs (32), catalog/mod.rs (31), ddl/mod.rs (1), catalog/derive.rs (1), +1 more file(s). The bar is 30 methods; this is 36 over it, 2.20× 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: Session crates/pgls_lsp/src/session.rs:64— 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: EventEmitter crates/pgls_pretty_print/src/emitter.rs:45— 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: WorkspaceServer crates/pgls_workspace/src/workspace/server.rs:107— TooManyMethods — 32 methods, declared across 3 files: workspace/server.rs (21), server/walk.rs (7), server/analysis.rs (4). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Resolver crates/pgls_catalog/src/resolve/resolver.rs:22— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×5
X2 · Cancellation propagation· Async function without AbortSignal · ×5
Async function without AbortSignal: downloadSchema packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:41— `downloadSchema` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: downloadBinary packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:63— `downloadBinary` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: downloadSchema packages/@postgres-language-server/cli/scripts/generate-packages.mjs:41— `downloadSchema` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: downloadWasmAssets packages/@postgres-language-server/cli/scripts/generate-packages.mjs:63— `downloadWasmAssets` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: downloadBinary packages/@postgres-language-server/cli/scripts/generate-packages.mjs:88— `downloadBinary` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
MethodTooLong: CatalogBase.new crates/pgls_catalog/src/catalog/base.rs:39— MethodTooLong — new runs 296 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 196 over it, 2.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CompletionFilter.check_clause crates/pgls_completions/src/relevance/filtering.rs:265— MethodTooLong — check_clause runs 137 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 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Cursor.advance_token crates/pgls_tokenizer/src/lib.rs:58— MethodTooLong — advance_token runs 123 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 23 over it, 1.23× 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: CliSession.run crates/pgls_cli/src/lib.rs:95— MethodTooLong — run runs 112 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 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×4
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×4
Edited copy of a member (18 corresponding lines) crates/pgls_catalog/src/resolve/nodes/delete_stmt.rs:26— crates/pgls_catalog/src/resolve/nodes/delete_stmt.rs:26-43 | crates/pgls_catalog/src/resolve/nodes/update_stmt.rs:30-48 — 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/pgls_cli/src/metrics.rs:189— crates/pgls_cli/src/metrics.rs:189-206 | crates/pgls_cli/src/metrics.rs:210-228 — 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/pgls_pretty_print/src/nodes/a_array_expr.rs:5— crates/pgls_pretty_print/src/nodes/a_array_expr.rs:5-26 | crates/pgls_pretty_print/src/nodes/coalesce_expr.rs:5-22 — 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/pgls_pretty_print_codegen/src/proto_analyser.rs:18— crates/pgls_pretty_print_codegen/src/proto_analyser.rs:18-35 | crates/pgls_query_macros/src/proto_analyser.rs:48-71 — 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 (10 corresponding lines) · ×4
Edited copy of a member (10 corresponding lines) crates/pgls_pretty_print/src/nodes/transaction_stmt.rs:160— crates/pgls_pretty_print/src/nodes/transaction_stmt.rs:160-169 | crates/pgls_pretty_print/src/nodes/transaction_stmt.rs:171-181 — 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/pgls_analyse/src/filter.rs:43— crates/pgls_analyse/src/filter.rs:43-52 | crates/pgls_analyse/src/filter.rs:55-64 — 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/pgls_fs/src/fs/os.rs:35— crates/pgls_fs/src/fs/os.rs:35-44 | crates/pgls_fs/src/fs/os.rs:48-57 — 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/pgls_fs/src/fs.rs:534— crates/pgls_fs/src/fs.rs:534-543 | crates/pgls_fs/src/fs.rs:547-556 — 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.
Duplicated block (17 lines × 2) crates/pgls_cli/src/service/windows.rs:131— crates/pgls_cli/src/service/windows.rs:131-147 | crates/pgls_cli/src/service/windows.rs:264-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. 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/pgls_pretty_print/src/nodes/alter_table_cmd.rs:727— crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:727-743 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:746-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/pgls_pretty_print/src/nodes/alter_table_cmd.rs:727` 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) crates/pgls_pretty_print/src/nodes/delete_stmt.rs:31— crates/pgls_pretty_print/src/nodes/delete_stmt.rs:31-47 | crates/pgls_pretty_print/src/nodes/update_stmt.rs:40-56 — 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/pgls_pretty_print/src/nodes/delete_stmt.rs:31` 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 `n` to `&DeleteStmt` in one and `&UpdateStmt` 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/pgls_pretty_print/src/nodes/variable_set_stmt.rs:289— crates/pgls_pretty_print/src/nodes/variable_set_stmt.rs:289-305 | crates/pgls_pretty_print/src/nodes/variable_set_stmt.rs:316-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/pgls_lexer_codegen/src/keywords.rs:13— crates/pgls_lexer_codegen/src/keywords.rs:13-28 | crates/pgls_pretty_print_codegen/src/keywords.rs:7-22 — 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/pgls_lexer_codegen/src/keywords.rs:13` 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/pgls_pretty_print/src/nodes/grant_stmt.rs:51— crates/pgls_pretty_print/src/nodes/grant_stmt.rs:51-66 | crates/pgls_pretty_print/src/nodes/grant_stmt.rs:76-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/grant_stmt.rs:51` 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) xtask/codegen/src/generate_pglinter.rs:344— xtask/codegen/src/generate_pglinter.rs:344-359 | xtask/codegen/src/generate_splinter.rs:343-358 — before extracting anything, compare `xtask/codegen/src/generate_pglinter.rs` and `xtask/codegen/src/generate_splinter.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 133 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 `xtask/codegen/src/generate_pglinter.rs:344` 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 `rules` to `&[&PglinterRuleMeta]` in one and `&[&SqlRuleMetadata]` 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 (16 lines × 2) crates/pgls_configuration/src/plpgsql_check.rs:65— crates/pgls_configuration/src/plpgsql_check.rs:65-80 | crates/pgls_workspace/src/settings.rs:785-800 — 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/pgls_cli/src/service/unix.rs:67— crates/pgls_cli/src/service/unix.rs:67-81 | crates/pgls_cli/src/service/windows.rs:81-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.
Duplicated block (15 lines × 2) xtask/codegen/src/generate_configuration.rs:605— xtask/codegen/src/generate_configuration.rs:605-619 | xtask/codegen/src/generate_configuration.rs:639-653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) xtask/codegen/src/generate_configuration.rs:841— xtask/codegen/src/generate_configuration.rs:841-855 | xtask/codegen/src/generate_configuration.rs:1412-1426 — both copies are in the same file, so extract the 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 (15 lines × 2) xtask/codegen/src/generate_pglinter.rs:675— xtask/codegen/src/generate_pglinter.rs:675-689 | xtask/codegen/src/generate_splinter.rs:704-718 — before extracting anything, compare `xtask/codegen/src/generate_pglinter.rs` and `xtask/codegen/src/generate_splinter.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 3) crates/pgls_catalog/src/resolve/expr/a_expr.rs:29— crates/pgls_catalog/src/resolve/expr/a_expr.rs:29-37 | crates/pgls_catalog/src/resolve/expr/a_expr.rs:51-59 | crates/pgls_catalog/src/resolve/expr/a_expr.rs:212-220 — 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/pgls_catalog/src/resolve/expr/a_expr.rs:29` it begins part-way through the construct above it, so those exact lines 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/pgls_pretty_print/src/nodes/alter_table_cmd.rs:159— crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:159-167 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:197-205 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:683-691 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/pgls_catalog/src/identifier.rs:16— crates/pgls_catalog/src/identifier.rs:16-24 | crates/pgls_pretty_print/src/identifiers.rs:55-63 | crates/pgls_semantic_tokens/src/lib.rs:304-312 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) crates/pgls_catalog/src/resolve/nodes/delete_stmt.rs:16— crates/pgls_catalog/src/resolve/nodes/delete_stmt.rs:16-24 | crates/pgls_catalog/src/resolve/nodes/insert_stmt.rs:32-40 | crates/pgls_catalog/src/resolve/nodes/update_stmt.rs:20-28 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&DeleteStmt` in one and `&InsertStmt` 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.
Low cohesion: OsFileSystem (LCOM4 6) crates/pgls_fs/src/fs/os.rs:29— OsFileSystem's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AnalysableStatement (LCOM4 5) crates/pgls_walk/src/statement.rs:10— AnalysableStatement'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: LinterDiagnostic (LCOM4 4) crates/pgls_analyser/src/linter_rule.rs:26— LinterDiagnostic's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MemoryFileSystem (LCOM4 4) crates/pgls_fs/src/fs/memory.rs:33— MemoryFileSystem'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.
R4 · Test Coverage· No test reaches this file · ×4
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/@postgres-language-server/cli/scripts/generate-packages.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/@postgres-language-server/wasm/src/worker.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
CompletionFilter::check_clause (cyclomatic 55) crates/pgls_completions/src/relevance/filtering.rs:265— CompletionFilter::check_clause has cyclomatic complexity 55 (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.
CompletionFilter::valid_keyword (cyclomatic 22) crates/pgls_completions/src/relevance/filtering.rs:588— CompletionFilter::valid_keyword 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.
CompletionFilter::completable_context (cyclomatic 17) crates/pgls_completions/src/relevance/filtering.rs:116— CompletionFilter::completable_context 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.
pgls_diagnostics::display::frame::print_frame (cyclomatic 33) crates/pgls_diagnostics/src/display/frame.rs:34— pgls_diagnostics::display::frame::print_frame has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
pgls_diagnostics::display::diff::print_full_diff (cyclomatic 19) crates/pgls_diagnostics/src/display/diff.rs:479— pgls_diagnostics::display::diff::print_full_diff 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.
pgls_diagnostics::display::frame::print_invisibles (cyclomatic 19) crates/pgls_diagnostics/src/display/frame.rs:391— pgls_diagnostics::display::frame::print_invisibles 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: pgls_diagnostics::display::frame::show_invisible_char (cyclomatic 26) 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.
docs_codegen::rules_docs::write_documentation (cognitive 53) docs/codegen/src/rules_docs.rs:186— docs_codegen::rules_docs::write_documentation has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (43 pts), match/switch 3 (9 pts), 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.
docs_codegen::schema::rename_partial_references_in_schema (cognitive 28) docs/codegen/src/schema.rs:40— docs_codegen::schema::rename_partial_references_in_schema has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 3 (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.
docs_codegen::schema::rename_partial_references_in_schema_object (cognitive 18) docs/codegen/src/schema.rs:122— docs_codegen::schema::rename_partial_references_in_schema_object has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 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.
CompletionFilter::valid_keyword (cognitive 39) crates/pgls_completions/src/relevance/filtering.rs:588— CompletionFilter::valid_keyword has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompletionFilter::check_clause (cognitive 29) crates/pgls_completions/src/relevance/filtering.rs:265— CompletionFilter::check_clause has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 16, match/switch 6 (11 pts), if/else 2 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CompletionFilter::completable_context (cognitive 19) crates/pgls_completions/src/relevance/filtering.rs:116— CompletionFilter::completable_context has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 7, match/switch 2 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Catalog::snapshot (cognitive 33) crates/pgls_catalog/src/catalog/materialize.rs:25— Catalog::snapshot has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 8 (10 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Catalog::drop_column_indexes (cognitive 24) crates/pgls_catalog/src/catalog/overlay.rs:358— Catalog::drop_column_indexes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (8 pts), match/switch 1 (3 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.
Catalog::move_relation (cognitive 18) crates/pgls_catalog/src/catalog/overlay.rs:242— Catalog::move_relation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cursor::advance_token (cognitive 33) crates/pgls_tokenizer/src/lib.rs:58— Cursor::advance_token has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 7 (16 pts), if/else 7 (10 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 16). 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.
Cursor::number (cognitive 21) crates/pgls_tokenizer/src/lib.rs:370— Cursor::number has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 4 (7 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.
Cursor::dollar_quoted_string (cognitive 21) crates/pgls_tokenizer/src/lib.rs:522— Cursor::dollar_quoted_string has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (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.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) crates/pgls_query/src/split.rs:24— crates/pgls_query/src/split.rs:24-46 | crates/pgls_query/src/split.rs:59-86 — 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) docs/codegen/src/rules_docs.rs:22— docs/codegen/src/rules_docs.rs:22-44 | docs/codegen/src/splinter_docs.rs:21-43 — 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/pgls_pretty_print/src/nodes/a_expr.rs:328— crates/pgls_pretty_print/src/nodes/a_expr.rs:328-350 | crates/pgls_pretty_print/src/nodes/a_expr.rs:353-375 — 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 (28 corresponding lines) · ×3
Edited copy of a member (28 corresponding lines) crates/pgls_lexer_codegen/src/keywords.rs:11— crates/pgls_lexer_codegen/src/keywords.rs:11-40 | crates/pgls_pretty_print_codegen/src/keywords.rs:5-32 — 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/pgls_pretty_print/src/nodes/alter_tsdictionary_stmt.rs:5— crates/pgls_pretty_print/src/nodes/alter_tsdictionary_stmt.rs:5-33 | crates/pgls_pretty_print/src/nodes/create_range_stmt.rs:5-32 — 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/pgls_statement_splitter/src/splitter/common.rs:70— crates/pgls_statement_splitter/src/splitter/common.rs:70-97 | crates/pgls_statement_splitter/src/splitter/common.rs:99-126 — 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 copy of a member (26 corresponding lines) · ×3
Edited copy of a member (26 corresponding lines) crates/pgls_analyse/src/categories.rs:267— crates/pgls_analyse/src/categories.rs:267-295 | crates/pgls_diagnostics/src/serde.rs:349-374 — 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/pgls_completions/src/providers/policies.rs:16— crates/pgls_completions/src/providers/policies.rs:16-43 | crates/pgls_completions/src/providers/roles.rs:15-40 — 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) docs/codegen/src/rules_docs.rs:423— docs/codegen/src/rules_docs.rs:423-450 | xtask/rules_check/src/lib.rs:199-224 — 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 (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) crates/pgls_wasm/src/lsp.rs:471— crates/pgls_wasm/src/lsp.rs:471-487 | crates/pgls_wasm/src/lsp.rs:489-510 — 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/pgls_diagnostics/src/display_github.rs:93— crates/pgls_diagnostics/src/display_github.rs:93-109 | crates/pgls_diagnostics/src/display_github.rs:111-129 — 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/pgls_pretty_print/src/nodes/clauses/json.rs:15— crates/pgls_pretty_print/src/nodes/clauses/json.rs:15-32 | crates/pgls_pretty_print/src/nodes/json_output.rs:5-21 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) crates/pgls_configuration/src/database.rs:68— crates/pgls_configuration/src/database.rs:68-87 | crates/pgls_workspace/src/settings.rs:883-907 — 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/pgls_console/src/markup.rs:201— crates/pgls_console/src/markup.rs:201-221 | crates/pgls_console/src/markup.rs:223-242 — 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) docs/codegen/src/rules_docs.rs:151— docs/codegen/src/rules_docs.rs:151-170 | docs/codegen/src/splinter_docs.rs:132-153 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×3
Edited copy of a member (15 corresponding lines) crates/pgls_statement_splitter/src/lib.rs:136— crates/pgls_statement_splitter/src/lib.rs:136-150 | crates/pgls_statement_splitter/src/lib.rs:153-169 — 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/pgls_treesitter/src/helper.rs:87— crates/pgls_treesitter/src/helper.rs:87-101 | crates/pgls_treesitter/src/helper.rs:103-119 — 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/pgls_lsp/src/session.rs:1194— crates/pgls_lsp/src/session.rs:1194-1208 | crates/pgls_matcher/src/pattern.rs:330-347 — 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.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) crates/pgls_analyser/src/lint/style/ban_char_field.rs:84— crates/pgls_analyser/src/lint/style/ban_char_field.rs:84-93 | crates/pgls_analyser/src/lint/style/prefer_text_field.rs:88-96 — 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/pgls_query_ext/src/function_body.rs:208— crates/pgls_query_ext/src/function_body.rs:208-217 | crates/pgls_semantic_tokens/src/lib.rs:254-262 — 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/pgls_pretty_print/src/nodes/a_expr.rs:617— crates/pgls_pretty_print/src/nodes/a_expr.rs:617-625 | crates/pgls_pretty_print/src/nodes/func_call.rs:506-514 — 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 (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) crates/pgls_catalog/src/snapshot/functions.rs:87— crates/pgls_catalog/src/snapshot/functions.rs:87-91 | crates/pgls_catalog/src/snapshot/types.rs:23-27 — 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/pgls_walk/src/statement.rs:70— crates/pgls_walk/src/statement.rs:70-74 | crates/pgls_workspace/src/workspace/server/document.rs:439-443 — 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/pgls_cli/src/service/unix.rs:195— crates/pgls_cli/src/service/unix.rs:195-199 | crates/pgls_cli/src/service/windows.rs:217-221 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (12 lines × 3) crates/pgls_configuration/src/rules/configuration.rs:39— crates/pgls_configuration/src/rules/configuration.rs:39-50 | crates/pgls_configuration/src/rules/configuration.rs:111-122 | crates/pgls_configuration/src/rules/configuration.rs:214-225 — 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.
Duplicated block (12 lines × 3) crates/pgls_pretty_print/src/nodes/constraint.rs:217— crates/pgls_pretty_print/src/nodes/constraint.rs:217-228 | crates/pgls_pretty_print/src/nodes/constraint.rs:282-293 | crates/pgls_pretty_print/src/nodes/constraint.rs:342-353 — 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/pgls_pretty_print/src/nodes/a_expr.rs:330— crates/pgls_pretty_print/src/nodes/a_expr.rs:330-341 | crates/pgls_pretty_print/src/nodes/a_expr.rs:355-366 | crates/pgls_pretty_print/src/nodes/a_expr.rs:380-391 — 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/pgls_pretty_print/src/nodes/a_expr.rs:330` it begins part-way through the construct above it, so those 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/pgls_pretty_print/src/nodes/a_expr.rs:394` calls `space`, `token` and `crates/pgls_pretty_print/src/nodes/a_expr.rs:345` 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 × 3) crates/pgls_configuration/src/format.rs:362— crates/pgls_configuration/src/format.rs:362-372 | crates/pgls_pretty_print/src/config.rs:114-124 | crates/pgls_workspace/src/settings.rs:701-711 — 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 (11 lines × 3) crates/pgls_pretty_print/src/nodes/json_array_agg.rs:43— crates/pgls_pretty_print/src/nodes/json_array_agg.rs:43-53 | crates/pgls_pretty_print/src/nodes/json_array_constructor.rs:25-35 | crates/pgls_pretty_print/src/nodes/json_object_agg.rs:44-54 — before extracting anything, compare `crates/pgls_pretty_print/src/nodes/json_array_agg.rs` and `crates/pgls_pretty_print/src/nodes/json_object_agg.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/json_array_agg.rs:43` it begins part-way through the construct above it, so those 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 `n` to `&JsonArrayAgg` in one and `&JsonArrayConstructor` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 3) crates/pgls_pretty_print/src/nodes/clauses/options.rs:228— crates/pgls_pretty_print/src/nodes/clauses/options.rs:228-238 | crates/pgls_pretty_print/src/nodes/clauses/options.rs:242-252 | crates/pgls_pretty_print/src/nodes/create_extension_stmt.rs:55-65 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/clauses/options.rs:228` 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/pgls_pretty_print/src/nodes/clauses/options.rs:240` calls `space`, `token` and `crates/pgls_pretty_print/src/nodes/clauses/options.rs:254` 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/pgls_pretty_print/src/nodes/dropdb_stmt.rs:24— crates/pgls_pretty_print/src/nodes/dropdb_stmt.rs:24-28 | crates/pgls_pretty_print/src/nodes/vacuum_stmt.rs:16-20 — 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/pgls_pretty_print/src/nodes/dropdb_stmt.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&DropdbStmt` in one and `&VacuumStmt` 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) xtask/codegen/src/generate_configuration.rs:688— xtask/codegen/src/generate_configuration.rs:688-692 | xtask/codegen/src/generate_configuration.rs:1059-1063 — both copies are in the same file, so extract the 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/pgls_pretty_print/src/nodes/float.rs:5— crates/pgls_pretty_print/src/nodes/float.rs:5-9 | crates/pgls_pretty_print/src/nodes/integer.rs:5-9 — 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 `n` to `&Float` in one and `&Integer` 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.
Lexer::extend_token (cyclomatic 47) crates/pgls_lexer/src/lexer.rs:79— Lexer::extend_token has cyclomatic complexity 47 (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.
Lexer::extend_literal (cyclomatic 17) crates/pgls_lexer/src/lexer.rs:166— Lexer::extend_literal 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.
docs_codegen::rules_docs::write_documentation (cyclomatic 42) docs/codegen/src/rules_docs.rs:186— docs_codegen::rules_docs::write_documentation 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.
docs_codegen::schema::rename_partial_references_in_schema (cyclomatic 25) docs/codegen/src/schema.rs:40— docs_codegen::schema::rename_partial_references_in_schema has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CompletionScore::check_matching_clause_type (cyclomatic 37) crates/pgls_completions/src/relevance/scoring.rs:156— CompletionScore::check_matching_clause_type has cyclomatic complexity 37 (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.
CompletionScore::check_matches_query_input (cyclomatic 18) crates/pgls_completions/src/relevance/scoring.rs:55— CompletionScore::check_matches_query_input 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.
pgls_statement_splitter::split_region (cyclomatic 32) crates/pgls_statement_splitter/src/lib.rs:171— pgls_statement_splitter::split_region has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pgls_statement_splitter::splitter::common::unknown (cyclomatic 24) crates/pgls_statement_splitter/src/splitter/common.rs:166— pgls_statement_splitter::splitter::common::unknown 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.
pgls_workspace::workspace::server::formatting::format_document (cyclomatic 31) crates/pgls_workspace/src/workspace/server/formatting.rs:51— pgls_workspace::workspace::server::formatting::format_document 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.
pgls_workspace::configuration::layers::apply_override (cyclomatic 20) crates/pgls_workspace/src/configuration/layers.rs:78— pgls_workspace::configuration::layers::apply_override 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.
HackComment crates/pgls_text_size/src/range.rs:134— // HACK for const fn: math on primitives only — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment crates/pgls_text_size/src/range.rs:143— // HACK for const fn: math on primitives only — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
pgls_statement_splitter::split_region (cognitive 42) crates/pgls_statement_splitter/src/lib.rs:171— pgls_statement_splitter::split_region has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 9, loops 6 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pgls_statement_splitter::splitter::common::unknown (cognitive 36) crates/pgls_statement_splitter/src/splitter/common.rs:166— pgls_statement_splitter::splitter::common::unknown has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 3 (8 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.
pgls_plpgsql_check::diagnostics::find_text_outside_strings (cognitive 30) crates/pgls_plpgsql_check/src/diagnostics.rs:24— pgls_plpgsql_check::diagnostics::find_text_outside_strings has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 5, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pgls_plpgsql_check::check_plpgsql (cognitive 22) crates/pgls_plpgsql_check/src/lib.rs:203— pgls_plpgsql_check::check_plpgsql has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_analyser::lint::correctness::identifier_too_long::unicode_identifier_value (cognitive 19) crates/pgls_analyser/src/lint/correctness/identifier_too_long.rs:227— pgls_analyser::lint::correctness::identifier_too_long::unicode_identifier_value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_analyser::lint::correctness::identifier_too_long::may_contain_long_identifier (cognitive 17) crates/pgls_analyser/src/lint/correctness/identifier_too_long.rs:165— pgls_analyser::lint::correctness::identifier_too_long::may_contain_long_identifier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 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.
pgls_cli::commands::daemon::start_lsp_proxy (cognitive 19) crates/pgls_cli/src/commands/daemon.rs:132— pgls_cli::commands::daemon::start_lsp_proxy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 3 (7 pts), loops 2 (4 pts) (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.
pgls_cli::service::read_task (cognitive 19) crates/pgls_cli/src/service/mod.rs:263— pgls_cli::service::read_task has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (7 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.
WorkspaceServer::database_diagnostics (cognitive 19) crates/pgls_workspace/src/workspace/server.rs:434— WorkspaceServer::database_diagnostics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkspaceServer::check_database_connection (cognitive 18) crates/pgls_workspace/src/workspace/server.rs:1412— WorkspaceServer::check_database_connection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), loops 2, 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.
CompletionScore::check_matching_clause_type (cognitive 18) crates/pgls_completions/src/relevance/scoring.rs:156— CompletionScore::check_matching_clause_type has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 8 (14 pts), if/else 2 (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.
CompletionScore::check_matches_query_input (cognitive 17) crates/pgls_completions/src/relevance/scoring.rs:55— CompletionScore::check_matches_query_input has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 6 (7 pts), boolean chains 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.
pgls_fs::fs::os::handle_any_file (cognitive 18) crates/pgls_fs/src/fs/os.rs:365— pgls_fs::fs::os::handle_any_file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 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.
pgls_fs::path::normalize_path (cognitive 16) crates/pgls_fs/src/path.rs:202— pgls_fs::path::normalize_path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, match/switch 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.
Transport.processIncomingBody (cognitive 16) packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:246— Transport.processIncomingBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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.
Transport.processIncomingBody (cognitive 16) packages/@postgrestools/backend-jsonrpc/src/transport.ts:246— Transport.processIncomingBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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.
Change-coupling hub: server.rs → mod.rs, database.rs, lib.rs, text_document.rs, lib.rs, client.rs, parse.rs, tree.rs crates/pgls_workspace/src/workspace/server.rs— `crates/pgls_workspace/src/workspace/server.rs` changes together with 8 other files — `crates/pgls_cli/src/commands/mod.rs`, `crates/pgls_configuration/src/database.rs`, `crates/pgls_configuration/src/lib.rs`, `crates/pgls_lsp/src/handlers/text_document.rs`, `crates/pgls_pretty_print/src/lib.rs`, `crates/pgls_workspace/src/workspace/client.rs`, `crates/pgls_workspace/src/workspace/server/document_cache/parse.rs`, `crates/pgls_workspace/src/workspace/server/document_cache/tree.rs` — none of which declares a dependency on it: one file is the hub of 8 separate couplings, not 8 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 8.
Change-coupling hub: mod.rs → sanitization.rs, test_helper.rs, REDACTED crates/pgls_treesitter/src/context/mod.rs— `crates/pgls_treesitter/src/context/mod.rs` changes together with 3 other files — `crates/pgls_completions/src/sanitization.rs`, `crates/pgls_completions/src/test_helper.rs`, `REDACTED` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/pgls_query/src/deparse.rs:32— crates/pgls_query/src/deparse.rs:32-53 | crates/pgls_query/src/fingerprint.rs:24-41 | crates/pgls_query/src/normalize.rs:16-30 | crates/pgls_query/src/parse.rs:22-43 | crates/pgls_query/src/plpgsql.rs:25-38 — 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/pgls_workspace/src/workspace/server.rs:882— crates/pgls_workspace/src/workspace/server.rs:882-954 | crates/pgls_workspace/src/workspace/server.rs:1519-1567 | crates/pgls_workspace/src/workspace/server.rs:1574-1623 | crates/pgls_workspace/src/workspace/server.rs:1633-1702 | crates/pgls_workspace/src/workspace/server.rs:1712-1782 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/pgls_cli/src/service/windows.rs:130— crates/pgls_cli/src/service/windows.rs:130-147 | crates/pgls_cli/src/service/windows.rs:159-172 | crates/pgls_cli/src/service/windows.rs:263-280 | crates/pgls_cli/src/service/windows.rs:292-305 — 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/pgls_pretty_print/src/nodes/a_expr.rs:425— crates/pgls_pretty_print/src/nodes/a_expr.rs:425-450 | crates/pgls_pretty_print/src/nodes/a_expr.rs:453-480 | crates/pgls_pretty_print/src/nodes/a_expr.rs:483-510 | crates/pgls_pretty_print/src/nodes/a_expr.rs:513-542 — 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 (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) crates/pgls_pretty_print/src/nodes/delete_stmt.rs:5— crates/pgls_pretty_print/src/nodes/delete_stmt.rs:5-47 | crates/pgls_pretty_print/src/nodes/update_stmt.rs:5-56 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) crates/pgls_wasm/src/lsp.rs:250— crates/pgls_wasm/src/lsp.rs:250-296 | crates/pgls_wasm/src/lsp.rs:298-340 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) xtask/codegen/src/generate_pglinter.rs:343— xtask/codegen/src/generate_pglinter.rs:343-384 | xtask/codegen/src/generate_splinter.rs:342-383 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) crates/pgls_query_macros/src/node_mut.rs:5— crates/pgls_query_macros/src/node_mut.rs:5-50 | crates/pgls_query_macros/src/node_ref.rs:5-46 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) crates/pgls_pretty_print/src/nodes/a_expr.rs:153— crates/pgls_pretty_print/src/nodes/a_expr.rs:153-177 | crates/pgls_pretty_print/src/nodes/a_expr.rs:180-204 — 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/pgls_cli/src/service/unix.rs:62— crates/pgls_cli/src/service/unix.rs:62-103 | crates/pgls_cli/src/service/windows.rs:77-101 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) crates/pgls_pretty_print/src/nodes/a_expr.rs:207— crates/pgls_pretty_print/src/nodes/a_expr.rs:207-230 | crates/pgls_pretty_print/src/nodes/a_expr.rs:233-258 — 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) docs/codegen/src/rules_index.rs:19— docs/codegen/src/rules_index.rs:19-42 | docs/codegen/src/rules_index.rs:189-212 — 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 copy of a member (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) crates/pgls_cli/src/service/unix.rs:28— crates/pgls_cli/src/service/unix.rs:28-43 | crates/pgls_cli/src/service/windows.rs:31-46 — 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/pgls_pretty_print/src/nodes/json_argument.rs:5— crates/pgls_pretty_print/src/nodes/json_argument.rs:5-20 | crates/pgls_pretty_print/src/nodes/target_entry.rs:5-20 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×2
Edited copies of one member (3 members, 19+ corresponding lines) crates/pgls_pretty_print/src/nodes/alter_database_refresh_coll_stmt.rs:8— crates/pgls_pretty_print/src/nodes/alter_database_refresh_coll_stmt.rs:8-28 | crates/pgls_pretty_print/src/nodes/alter_database_set_stmt.rs:5-23 | crates/pgls_pretty_print/src/nodes/alter_database_stmt.rs:5-23 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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, 19+ corresponding lines) crates/pgls_pretty_print/src/nodes/drop_owned_stmt.rs:5— crates/pgls_pretty_print/src/nodes/drop_owned_stmt.rs:5-23 | crates/pgls_pretty_print/src/nodes/drop_role_stmt.rs:5-23 | crates/pgls_pretty_print/src/nodes/drop_subscription_stmt.rs:5-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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 (13 corresponding lines) · ×2
Edited copy of a member (13 corresponding lines) crates/pgls_wasm/src/ffi.rs:341— crates/pgls_wasm/src/ffi.rs:341-353 | crates/pgls_wasm/src/ffi.rs:362-374 — 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/pgls_catalog/src/resolve/nodes/alias.rs:40— crates/pgls_catalog/src/resolve/nodes/alias.rs:40-53 | crates/pgls_catalog/src/resolve/nodes/with_clause.rs:145-157 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×2
Edited copies of one member (3 members, 12+ corresponding lines) crates/pgls_wasm/src/ffi.rs:114— crates/pgls_wasm/src/ffi.rs:114-125 | crates/pgls_wasm/src/ffi.rs:141-152 | crates/pgls_wasm/src/ffi.rs:320-332 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crates/pgls_analyser/src/fix.rs:50— crates/pgls_analyser/src/fix.rs:50-61 | crates/pgls_analyser/src/fix.rs:74-89 | crates/pgls_catalog/src/resolve/span.rs:110-125 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×2
Edited copy of a member (11 corresponding lines) crates/pgls_pretty_print/src/nodes/utils/layout.rs:75— crates/pgls_pretty_print/src/nodes/utils/layout.rs:75-85 | crates/pgls_pretty_print/src/nodes/utils/lists.rs:110-120 — 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/pgls_walk/src/walk.rs:426— crates/pgls_walk/src/walk.rs:426-436 | crates/pgls_workspace/src/features/code_actions/execute_statement/execution.rs:73-83 — 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 (7 corresponding lines) · ×2
Edited copy of a member (7 corresponding lines) crates/pgls_diagnostics/src/display/message.rs:88— crates/pgls_diagnostics/src/display/message.rs:88-96 | crates/pgls_diagnostics/src/display_github.rs:131-137 — 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/pgls_pretty_print/src/nodes/window_clause.rs:5— crates/pgls_pretty_print/src/nodes/window_clause.rs:5-16 | crates/pgls_pretty_print/src/nodes/window_def.rs:47-53 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) crates/pgls_pretty_print/src/nodes/alter_tsconfiguration_stmt.rs:67— crates/pgls_pretty_print/src/nodes/alter_tsconfiguration_stmt.rs:67-72 | crates/pgls_pretty_print/src/nodes/define_stmt.rs:156-161 — 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) docs/codegen/src/utils.rs:49— docs/codegen/src/utils.rs:49-56 | xtask/codegen/src/generate_configuration.rs:112-117 — 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.
Duplicated block (33 lines × 2) crates/pgls_pretty_print/src/nodes/alter_fdw_stmt.rs:26— crates/pgls_pretty_print/src/nodes/alter_fdw_stmt.rs:26-58 | crates/pgls_pretty_print/src/nodes/create_fdw_stmt.rs:23-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/pgls_pretty_print/src/nodes/create_fdw_stmt.rs:56` calls `space` and `crates/pgls_pretty_print/src/nodes/alter_fdw_stmt.rs:59` 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 (33 lines × 2) crates/pgls_pretty_print/src/nodes/json_array_agg.rs:60— crates/pgls_pretty_print/src/nodes/json_array_agg.rs:60-92 | crates/pgls_pretty_print/src/nodes/json_object_agg.rs:70-102 — before extracting anything, compare `crates/pgls_pretty_print/src/nodes/json_array_agg.rs` and `crates/pgls_pretty_print/src/nodes/json_object_agg.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/json_array_agg.rs:60` 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 `n` to `&JsonArrayAgg` in one and `&JsonObjectAgg` 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 (26–27 lines × 2) crates/pgls_pretty_print/src/nodes/insert_stmt.rs:39— crates/pgls_pretty_print/src/nodes/insert_stmt.rs:39-65 | crates/pgls_pretty_print/src/nodes/merge_when_clause.rs:87-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/insert_stmt.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.
Duplicated block (26–27 lines × 2) xtask/codegen/src/generate_configuration.rs:797— xtask/codegen/src/generate_configuration.rs:797-822 | xtask/codegen/src/generate_configuration.rs:1376-1402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_configuration.rs:1376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) crates/pgls_pretty_print/src/renderer.rs:96— crates/pgls_pretty_print/src/renderer.rs:96-121 | crates/pgls_pretty_print/src/renderer.rs:251-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/renderer.rs:96` 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 (26 lines × 2) xtask/codegen/src/generate_pglinter.rs:391— xtask/codegen/src/generate_pglinter.rs:391-416 | xtask/codegen/src/generate_splinter.rs:390-415 — before extracting anything, compare `xtask/codegen/src/generate_pglinter.rs` and `xtask/codegen/src/generate_splinter.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 133 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 `xtask/codegen/src/generate_pglinter.rs:391` 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 `rules_by_category` to `&BTreeMap<String, Vec<&PglinterRuleMeta>>` in one and `&BTreeMap<String, Vec<&SqlRuleMetadata>>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19 lines × 2) crates/pgls_pretty_print/src/nodes/json_object_constructor.rs:31— crates/pgls_pretty_print/src/nodes/json_object_constructor.rs:31-49 | crates/pgls_pretty_print/src/nodes/json_parse_expr.rs:20-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/json_object_constructor.rs:31` 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 `n` to `&JsonObjectConstructor` in one and `&JsonParseExpr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19 lines × 2) docs/codegen/src/rules_docs.rs:517— docs/codegen/src/rules_docs.rs:517-535 | xtask/rules_check/src/lib.rs:154-172 — 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 `docs/codegen/src/rules_docs.rs:517` 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/pgls_pretty_print/src/nodes/json_table.rs:41— crates/pgls_pretty_print/src/nodes/json_table.rs:41-58 | crates/pgls_pretty_print/src/nodes/json_table_column.rs:19-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) xtask/codegen/src/generate_configuration.rs:1026— xtask/codegen/src/generate_configuration.rs:1026-1043 | xtask/codegen/src/generate_configuration.rs:1502-1519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_configuration.rs:1026` 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–14 lines × 2) crates/pgls_pretty_print/src/nodes/create_stmt.rs:38— crates/pgls_pretty_print/src/nodes/create_stmt.rs:38-51 | crates/pgls_pretty_print/src/nodes/create_table_as_stmt.rs:23-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/pgls_pretty_print/src/nodes/create_stmt.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 (13–14 lines × 2) crates/pgls_pretty_print/src/nodes/select_stmt.rs:76— crates/pgls_pretty_print/src/nodes/select_stmt.rs:76-89 | crates/pgls_pretty_print/src/nodes/select_stmt.rs:312-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/pgls_pretty_print/src/nodes/select_stmt.rs:76` it begins part-way through the construct above it, so those exact lines 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/pgls_query/src/split.rs:27— crates/pgls_query/src/split.rs:27-33 | crates/pgls_query/src/split.rs:62-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/pgls_query/src/split.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.
Duplicated block (7–9 lines × 2) xtask/codegen/src/generate_configuration.rs:971— xtask/codegen/src/generate_configuration.rs:971-979 | xtask/codegen/src/generate_configuration.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. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/codegen/src/generate_configuration.rs:971` 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–7 lines × 4) crates/pgls_cli/src/service/windows.rs:139— crates/pgls_cli/src/service/windows.rs:139-144 | crates/pgls_cli/src/service/windows.rs:164-170 | crates/pgls_cli/src/service/windows.rs:272-277 | crates/pgls_cli/src/service/windows.rs:297-303 — 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/pgls_cli/src/service/windows.rs:139` 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 × 4) crates/pgls_query/src/deparse.rs:39— crates/pgls_query/src/deparse.rs:39-44 | crates/pgls_query/src/fingerprint.rs:27-32 | crates/pgls_query/src/normalize.rs:19-24 | crates/pgls_query/src/parse.rs:25-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_query/src/deparse.rs:39` 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 (18 lines × 2 locations) REDACTED:976— REDACTED:976 · REDACTED:2702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `grammar(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything.
Duplicated block (18 lines × 2 locations) REDACTED:2589— REDACTED:2589 · REDACTED:3612 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) REDACTED:1328— REDACTED:1328 · REDACTED:2548 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) REDACTED:3359— REDACTED:3359 · REDACTED:3369 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
C1 · Data Protection· No data-protection/encryption · ×1
No data-protection/encryption crates/pgls_plpgsql_check/src/lib.rs:777— No encryption usage (RustCrypto's aes-gcm/chacha20poly1305 encrypting, ring or aws-lc-rs aead sealing, orion, libsodium's secretbox, openssl symm, age, SQLCipher keyed by PRAGMA key, pgcrypto, MongoDB client-side field-level encryption, the OS keyring) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
Cursor::advance_token (cyclomatic 57) crates/pgls_tokenizer/src/lib.rs:58— Cursor::advance_token has cyclomatic complexity 57 (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.
CatalogBase::new (cyclomatic 34) crates/pgls_catalog/src/catalog/base.rs:39— CatalogBase::new has cyclomatic complexity 34 (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.
pgls_markup::markup (cyclomatic 29) crates/pgls_markup/src/lib.rs:34— pgls_markup::markup has cyclomatic complexity 29 (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.
pgls_semantic_tokens::semantic_tokens_of_references (cyclomatic 27) crates/pgls_semantic_tokens/src/lib.rs:78— pgls_semantic_tokens::semantic_tokens_of_references 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.
DeriveStructInput::parse (cyclomatic 25) crates/pgls_diagnostics_macros/src/parse.rs:64— DeriveStructInput::parse 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.
pgls_walk::walk::walk_statements (cyclomatic 25) crates/pgls_walk/src/walk.rs:114— pgls_walk::walk::walk_statements 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.
Catalog::snapshot (cyclomatic 24) crates/pgls_catalog/src/catalog/materialize.rs:25— Catalog::snapshot 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.
HoveredNode::get (cyclomatic 22) crates/pgls_hover/src/hovered_node.rs:18— HoveredNode::get 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.
pgls_typecheck::diagnostics::create_type_error (cyclomatic 22) crates/pgls_typecheck/src/diagnostics.rs:157— pgls_typecheck::diagnostics::create_type_error has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pgls_query_ext::function_body::atomic_body (cyclomatic 18) crates/pgls_query_ext/src/function_body.rs:556— pgls_query_ext::function_body::atomic_body 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.
Settings::apply_variable_set (cyclomatic 17) crates/pgls_catalog/src/session/settings.rs:94— Settings::apply_variable_set 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.
pgls_completions::sanitization::cursor_between_parentheses (cyclomatic 17) crates/pgls_completions/src/sanitization.rs:255— pgls_completions::sanitization::cursor_between_parentheses 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.
PrintHeader::fmt (cyclomatic 17) crates/pgls_diagnostics/src/display.rs:97— PrintHeader::fmt 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.
pgls_inlay_hints::inlay_hints_of_references (cyclomatic 17) crates/pgls_inlay_hints/src/lib.rs:71— pgls_inlay_hints::inlay_hints_of_references 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.
pgls_lexer::params::convert_to_positional_params_with_metadata (cyclomatic 17) crates/pgls_lexer/src/params.rs:57— pgls_lexer::params::convert_to_positional_params_with_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.
pgls_splinter::run_splinter (cyclomatic 17) crates/pgls_splinter/src/lib.rs:51— pgls_splinter::run_splinter 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.
QueryResult::within_range (cyclomatic 17) crates/pgls_treesitter/src/queries/mod.rs:33— QueryResult::within_range 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.
Analyser::analyse_until (cyclomatic 16) crates/pgls_analyser/src/lib.rs:156— Analyser::analyse_until 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.
Suppression::matches (cyclomatic 16) crates/pgls_suppressions/src/suppression.rs:261— Suppression::matches 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.
TreesitterContext::gather_context_from_node (cyclomatic 16) crates/pgls_treesitter/src/context/mod.rs:391— TreesitterContext::gather_context_from_node 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: TreesitterContext::get_wrapping_clause_from_current_node (cyclomatic 30) 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.
WorkspaceServer::database_diagnostics (cyclomatic 16) crates/pgls_workspace/src/workspace/server.rs:434— WorkspaceServer::database_diagnostics 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.
pgls_markup::markup (cognitive 65) crates/pgls_markup/src/lib.rs:34— pgls_markup::markup has cognitive complexity 65 (threshold 15). Drivers by points: match/switch 9 (37 pts), if/else 6 (21 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 46). 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.
DeriveStructInput::parse (cognitive 60) crates/pgls_diagnostics_macros/src/parse.rs:64— DeriveStructInput::parse has cognitive complexity 60 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 5 (19 pts), loops 5 (12 pts) (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.
pgls_walk::walk::walk_statements (cognitive 60) crates/pgls_walk/src/walk.rs:114— pgls_walk::walk::walk_statements has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (42 pts), loops 5 (12 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiagnosticsPrinter::run (cognitive 46) crates/pgls_cli/src/execute/walk.rs:247— DiagnosticsPrinter::run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 6 (25 pts), match/switch 3 (12 pts), loops 3 (9 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_semantic_tokens::semantic_tokens_of_references (cognitive 40) crates/pgls_semantic_tokens/src/lib.rs:78— pgls_semantic_tokens::semantic_tokens_of_references has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 4 (12 pts), loops 2 (4 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.
CatalogBase::new (cognitive 32) crates/pgls_catalog/src/catalog/base.rs:39— CatalogBase::new has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 8 (9 pts), match/switch 6 (9 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.
pgls_typecheck::diagnostics::create_type_error (cognitive 29) crates/pgls_typecheck/src/diagnostics.rs:157— pgls_typecheck::diagnostics::create_type_error has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26 (27 pts), match/switch 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.
PrintHeader::fmt (cognitive 28) crates/pgls_diagnostics/src/display.rs:97— PrintHeader::fmt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (27 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.
pgls_inlay_hints::inlay_hints_of_references (cognitive 28) crates/pgls_inlay_hints/src/lib.rs:71— pgls_inlay_hints::inlay_hints_of_references has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 2 (3 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.
PrintAdvices::record_table (cognitive 27) crates/pgls_diagnostics/src/display.rs:492— PrintAdvices::record_table has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Settings::apply_variable_set (cognitive 26) crates/pgls_catalog/src/session/settings.rs:94— Settings::apply_variable_set has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_splinter::run_splinter (cognitive 26) crates/pgls_splinter/src/lib.rs:51— pgls_splinter::run_splinter has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_lexer::params::convert_to_positional_params_with_metadata (cognitive 25) crates/pgls_lexer/src/params.rs:57— pgls_lexer::params::convert_to_positional_params_with_metadata has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (5 pts), boolean chains 3, 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.
pgls_migrations::goose::envsub::substitute (cognitive 24) crates/pgls_migrations/src/goose/envsub.rs:16— pgls_migrations::goose::envsub::substitute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (8 pts), match/switch 1 (2 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.
SanitizeAdapter::write_str (cognitive 22) crates/pgls_console/src/write/termcolor.rs:143— SanitizeAdapter::write_str has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystem::auto_search (cognitive 21) crates/pgls_fs/src/fs.rs:92— FileSystem::auto_search 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.
Locks::apply (cognitive 20) crates/pgls_catalog/src/session/locks.rs:160— Locks::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, 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.
pgls_completions::sanitization::cursor_between_parentheses (cognitive 20) crates/pgls_completions/src/sanitization.rs:255— pgls_completions::sanitization::cursor_between_parentheses has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, 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.
xtask_codegen::generate_configuration::generate_lint_mod_file (cognitive 20) xtask/codegen/src/generate_configuration.rs:176— xtask_codegen::generate_configuration::generate_lint_mod_file has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rules_check::assert_lint (cognitive 20) xtask/rules_check/src/lib.rs:67— rules_check::assert_lint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5 (9 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::extend_literal (cognitive 19) crates/pgls_lexer/src/lexer.rs:166— Lexer::extend_literal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pgls_pglinter::run_pglinter (cognitive 19) crates/pgls_pglinter/src/lib.rs:82— pgls_pglinter::run_pglinter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2, match/switch 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.
Analyser::analyse_until (cognitive 18) crates/pgls_analyser/src/lib.rs:156— Analyser::analyse_until has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (7 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Renderer::single_line_if_fits (cognitive 18) crates/pgls_pretty_print/src/renderer.rs:285— Renderer::single_line_if_fits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, 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.
pgls_query_ext::function_body::atomic_body (cognitive 18) crates/pgls_query_ext/src/function_body.rs:556— pgls_query_ext::function_body::atomic_body has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 7). 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.
DatabaseSettings::from (cognitive 18) crates/pgls_workspace/src/settings.rs:930— DatabaseSettings::from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (5 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.
SanitizedCompletionParams::with_adjusted_sql (cognitive 17) crates/pgls_completions/src/sanitization.rs:86— SanitizedCompletionParams::with_adjusted_sql has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 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.
DeriveInput::parse (cognitive 17) crates/pgls_configuration_macros/src/partial_derive/mod.rs:25— DeriveInput::parse has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 1 (2 pts) (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.
Role::hover_body (cognitive 16) crates/pgls_hover/src/hoverables/role.rs:19— Role::hover_body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 3 (6 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.
MemoryTraversalScope::evaluate (cognitive 16) crates/pgls_fs/src/fs/memory.rs:405— MemoryTraversalScope::evaluate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SuppressionsParser::parse_suppressions (cognitive 16) crates/pgls_suppressions/src/parser.rs:100— SuppressionsParser::parse_suppressions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (4 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.
Near-duplicate member pair (68 shared lines) xtask/codegen/src/generate_configuration.rs:700— xtask/codegen/src/generate_configuration.rs:700-957 | xtask/codegen/src/generate_configuration.rs:1328-1475 — These two members are variants of one another: 68 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) crates/pgls_pretty_print/src/nodes/json_array_agg.rs:6— crates/pgls_pretty_print/src/nodes/json_array_agg.rs:6-92 | crates/pgls_pretty_print/src/nodes/json_object_agg.rs:5-102 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (42 shared lines) xtask/codegen/src/generate_configuration.rs:964— xtask/codegen/src/generate_configuration.rs:964-1191 | xtask/codegen/src/generate_configuration.rs:1481-1563 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) crates/pgls_pretty_print/src/nodes/alter_fdw_stmt.rs:5— crates/pgls_pretty_print/src/nodes/alter_fdw_stmt.rs:5-72 | crates/pgls_pretty_print/src/nodes/create_fdw_stmt.rs:5-70 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (70 corresponding lines) · ×1
Edited copy of a member (70 corresponding lines) xtask/codegen/src/generate_pglinter.rs:573— xtask/codegen/src/generate_pglinter.rs:573-666 | xtask/codegen/src/generate_splinter.rs:626-695 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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/pgls_pretty_print/src/renderer.rs:72— crates/pgls_pretty_print/src/renderer.rs:72-121 | crates/pgls_pretty_print/src/renderer.rs:209-276 — 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 (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) crates/pgls_pretty_print/src/nodes/window_clause.rs:19— crates/pgls_pretty_print/src/nodes/window_clause.rs:19-71 | crates/pgls_pretty_print/src/nodes/window_def.rs:55-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 (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) crates/pgls_query_macros/src/iter_mut.rs:105— crates/pgls_query_macros/src/iter_mut.rs:105-147 | crates/pgls_query_macros/src/iter_ref.rs:74-110 — 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) xtask/codegen/src/generate_pglinter.rs:390— xtask/codegen/src/generate_pglinter.rs:390-430 | xtask/codegen/src/generate_splinter.rs:389-429 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) docs/codegen/src/rules_index.rs:48— docs/codegen/src/rules_index.rs:48-89 | docs/codegen/src/rules_index.rs:218-253 — 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 copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) crates/pgls_pretty_print/src/nodes/create_user_mapping_stmt.rs:5— crates/pgls_pretty_print/src/nodes/create_user_mapping_stmt.rs:5-39 | crates/pgls_pretty_print/src/nodes/drop_user_mapping_stmt.rs:5-35 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) xtask/codegen/src/generate_pglinter.rs:177— xtask/codegen/src/generate_pglinter.rs:177-211 | xtask/codegen/src/generate_splinter.rs:175-208 — 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) · ×1
Edited copy of a member (30 corresponding lines) crates/pgls_pretty_print/src/nodes/alter_operator_stmt.rs:5— crates/pgls_pretty_print/src/nodes/alter_operator_stmt.rs:5-34 | crates/pgls_pretty_print/src/nodes/dropdb_stmt.rs:5-34 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) crates/pgls_pretty_print/src/nodes/range_table_sample.rs:5— crates/pgls_pretty_print/src/nodes/range_table_sample.rs:5-37 | crates/pgls_pretty_print/src/nodes/table_sample_clause.rs:5-31 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) crates/pgls_configuration/src/format.rs:357— crates/pgls_configuration/src/format.rs:357-378 | crates/pgls_workspace/src/settings.rs:696-717 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) crates/pgls_pretty_print/src/nodes/json_array_query_constructor.rs:8— crates/pgls_pretty_print/src/nodes/json_array_query_constructor.rs:8-36 | crates/pgls_pretty_print/src/nodes/json_scalar_expr.rs:5-25 | crates/pgls_pretty_print/src/nodes/json_serialize_expr.rs:6-26 — 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, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) crates/pgls_query_ext/src/function_body.rs:78— crates/pgls_query_ext/src/function_body.rs:78-90 | crates/pgls_query_ext/src/function_body.rs:101-113 | crates/pgls_query_ext/src/function_body.rs:117-129 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) crates/pgls_pretty_print/src/nodes/cluster_stmt.rs:5— crates/pgls_pretty_print/src/nodes/cluster_stmt.rs:5-31 | crates/pgls_pretty_print/src/nodes/create_op_family_stmt.rs:5-25 — 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 (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) crates/pgls_treesitter/src/queries/insert_columns.rs:50— crates/pgls_treesitter/src/queries/insert_columns.rs:50-68 | crates/pgls_treesitter/src/queries/relations.rs:60-76 | crates/pgls_treesitter/src/queries/select_columns.rs:66-87 | crates/pgls_treesitter/src/queries/table_aliases.rs:99-121 — These 4 members are one piece of code written 4 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 4 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/pgls_diagnostics_macros/src/generate.rs:54— crates/pgls_diagnostics_macros/src/generate.rs:54-70 | crates/pgls_diagnostics_macros/src/generate.rs:72-88 | crates/pgls_diagnostics_macros/src/generate.rs:232-251 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) crates/pgls_workspace/src/workspace/server/document.rs:534— crates/pgls_workspace/src/workspace/server/document.rs:534-543 | crates/pgls_workspace/src/workspace/server/document.rs:555-564 | crates/pgls_workspace/src/workspace/server/document.rs:576-587 — 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, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) crates/pgls_pretty_print/src/nodes/inference_elem.rs:5— crates/pgls_pretty_print/src/nodes/inference_elem.rs:5-15 | crates/pgls_pretty_print/src/nodes/json_value_expr.rs:5-19 | crates/pgls_pretty_print/src/nodes/table_func.rs:5-17 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×1
Edited copy of a member (8 corresponding lines) crates/pgls_pretty_print/src/nodes/transaction_stmt.rs:183— crates/pgls_pretty_print/src/nodes/transaction_stmt.rs:183-190 | crates/pgls_pretty_print/src/nodes/utils/tokens.rs:77-84 — 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.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) crates/pgls_treesitter/src/queries/parameters.rs:47— crates/pgls_treesitter/src/queries/parameters.rs:47-54 | crates/pgls_treesitter/src/queries/relations.rs:45-52 | crates/pgls_treesitter/src/queries/returning_aliases.rs:95-102 | crates/pgls_treesitter/src/queries/table_aliases.rs:84-91 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (43 lines × 2) docs/codegen/src/rules_docs.rs:473— docs/codegen/src/rules_docs.rs:473-515 | xtask/rules_check/src/lib.rs:110-152 — 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 `docs/codegen/src/rules_docs.rs:473` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (31 lines × 2) crates/pgls_pretty_print/src/nodes/constraint.rs:222— crates/pgls_pretty_print/src/nodes/constraint.rs:222-252 | crates/pgls_pretty_print/src/nodes/constraint.rs:287-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/constraint.rs:222` 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 (24 lines × 2) xtask/codegen/src/generate_pglinter.rs:361— xtask/codegen/src/generate_pglinter.rs:361-384 | xtask/codegen/src/generate_splinter.rs:360-383 — before extracting anything, compare `xtask/codegen/src/generate_pglinter.rs` and `xtask/codegen/src/generate_splinter.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 133 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 `xtask/codegen/src/generate_pglinter.rs:361` it begins part-way through the construct above it, so those 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 `rules` to `&[&PglinterRuleMeta]` in one and `&[&SqlRuleMetadata]` 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 (18–23 lines × 2) xtask/codegen/src/generate_pglinter.rs:225— xtask/codegen/src/generate_pglinter.rs:225-242 | xtask/codegen/src/generate_splinter.rs:219-241 — before extracting anything, compare `xtask/codegen/src/generate_pglinter.rs` and `xtask/codegen/src/generate_splinter.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 133 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 `xtask/codegen/src/generate_pglinter.rs:225` 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 `rules` to `&BTreeMap<String, PglinterRuleMeta>` in one and `&BTreeMap<String, SqlRuleMetadata>` 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 (18–20 lines × 2) crates/pgls_query_macros/src/iter_mut.rs:7— crates/pgls_query_macros/src/iter_mut.rs:7-26 | crates/pgls_query_macros/src/iter_ref.rs:7-24 — 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/pgls_query_macros/src/iter_mut.rs:7` 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 × 4) crates/pgls_pretty_print/src/nodes/a_expr.rs:432— crates/pgls_pretty_print/src/nodes/a_expr.rs:432-450 | crates/pgls_pretty_print/src/nodes/a_expr.rs:462-480 | crates/pgls_pretty_print/src/nodes/a_expr.rs:492-510 | crates/pgls_pretty_print/src/nodes/a_expr.rs:524-542 — 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/pgls_pretty_print/src/nodes/a_expr.rs:432` 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/pgls_pretty_print/src/nodes/a_expr.rs:459` calls `token`, `space` and `crates/pgls_pretty_print/src/nodes/a_expr.rs:429` 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–19 lines × 2) xtask/codegen/src/generate_configuration.rs:787— xtask/codegen/src/generate_configuration.rs:787-794 | xtask/codegen/src/generate_configuration.rs:1355-1373 — both copies are in the same file, so extract the 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 (14 lines × 4) crates/pgls_pretty_print/src/nodes/comment_stmt.rs:59— crates/pgls_pretty_print/src/nodes/comment_stmt.rs:59-72 | crates/pgls_pretty_print/src/nodes/comment_stmt.rs:77-90 | crates/pgls_pretty_print/src/nodes/comment_stmt.rs:95-108 | crates/pgls_pretty_print/src/nodes/comment_stmt.rs:113-126 — 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/pgls_pretty_print/src/nodes/comment_stmt.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 (11–12 lines × 2) crates/pgls_pretty_print/src/nodes/range_subselect.rs:19— crates/pgls_pretty_print/src/nodes/range_subselect.rs:19-29 | crates/pgls_pretty_print/src/nodes/range_table_func.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/pgls_pretty_print/src/nodes/range_subselect.rs:19` 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 `n` to `&RangeSubselect` in one and `&RangeTableFunc` 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–11 lines × 2) crates/pgls_pretty_print/src/nodes/range_function.rs:89— crates/pgls_pretty_print/src/nodes/range_function.rs:89-98 | crates/pgls_pretty_print/src/nodes/range_function.rs:108-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/pgls_pretty_print/src/nodes/range_function.rs:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 3) crates/pgls_pretty_print/src/nodes/alter_domain_stmt.rs:73— crates/pgls_pretty_print/src/nodes/alter_domain_stmt.rs:73-82 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:51-60 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:223-232 — before extracting anything, compare `crates/pgls_pretty_print/src/nodes/alter_domain_stmt.rs` and `crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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/pgls_pretty_print/src/nodes/alter_domain_stmt.rs:73` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/pgls_catalog/src/catalog/base.rs:62— crates/pgls_catalog/src/catalog/base.rs:62-71 | crates/pgls_catalog/src/catalog/base.rs:248-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_catalog/src/catalog/base.rs:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–10 lines × 2) crates/pgls_wasm/src/lsp.rs:261— crates/pgls_wasm/src/lsp.rs:261-270 | crates/pgls_wasm/src/lsp.rs:313-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 5) crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:144— crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:144-152 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:175-183 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:315-323 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:373-381 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:391-399 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:185` calls `line`, `token` and `crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:154` 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/pgls_pretty_print/src/nodes/alias.rs:20— crates/pgls_pretty_print/src/nodes/alias.rs:20-28 | crates/pgls_pretty_print/src/nodes/join_expr.rs:156-163 — 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/pgls_pretty_print/src/nodes/alias.rs:20` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 11) crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:143— crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:143-150 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:158-165 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:174-181 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:196-203 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:314-321 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:332-339 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:348-356 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:372-379 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:390-397 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:682-689 | crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:719-726 — 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/pgls_pretty_print/src/nodes/alter_table_cmd.rs:348` 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/pgls_pretty_print/src/nodes/alter_table_cmd.rs:143` calls `token` and `crates/pgls_pretty_print/src/nodes/alter_table_cmd.rs:348` 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–8 lines × 2) crates/pgls_statement_splitter/src/splitter/common.rs:54— crates/pgls_statement_splitter/src/splitter/common.rs:54-59 | crates/pgls_statement_splitter/src/splitter/dml.rs:64-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/pgls_statement_splitter/src/splitter/dml.rs:64` 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 × 5) crates/pgls_pretty_print/src/nodes/comment_stmt.rs:38— crates/pgls_pretty_print/src/nodes/comment_stmt.rs:38-44 | crates/pgls_pretty_print/src/nodes/comment_stmt.rs:58-64 | crates/pgls_pretty_print/src/nodes/comment_stmt.rs:76-82 | crates/pgls_pretty_print/src/nodes/comment_stmt.rs:94-100 | crates/pgls_pretty_print/src/nodes/comment_stmt.rs:112-118 — 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/pgls_pretty_print/src/nodes/comment_stmt.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/pgls_pretty_print/src/nodes/comment_stmt.rs:45` calls `emit_keyword`, `space` and `crates/pgls_pretty_print/src/nodes/comment_stmt.rs:66` 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 (6 lines × 5) crates/pgls_workspace/src/workspace/server.rs:883— crates/pgls_workspace/src/workspace/server.rs:883-888 | crates/pgls_workspace/src/workspace/server.rs:1520-1525 | crates/pgls_workspace/src/workspace/server.rs:1575-1580 | crates/pgls_workspace/src/workspace/server.rs:1634-1639 | crates/pgls_workspace/src/workspace/server.rs:1713-1718 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `CodeActionsParams` in one and `GetCompletionsParams` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/pgls_workspace/src/workspace/server.rs:1719` calls `is_none_or`, `Ok`, `default` and `crates/pgls_workspace/src/workspace/server.rs:1528` 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 × 4) crates/pgls_query/src/fingerprint.rs:27— crates/pgls_query/src/fingerprint.rs:27-32 | crates/pgls_query/src/normalize.rs:19-24 | crates/pgls_query/src/parse.rs:25-30 | crates/pgls_query/src/plpgsql.rs:28-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 all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_query/src/fingerprint.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.
Duplicated block (5 lines × 5) crates/pgls_catalog/src/resolve/expr/a_expr.rs:28— crates/pgls_catalog/src/resolve/expr/a_expr.rs:28-35 | crates/pgls_catalog/src/resolve/expr/a_expr.rs:50-57 | crates/pgls_catalog/src/resolve/expr/a_expr.rs:84-88 | crates/pgls_catalog/src/resolve/expr/a_expr.rs:163-167 | crates/pgls_catalog/src/resolve/expr/a_expr.rs:211-218 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) crates/pgls_pretty_print/src/nodes/delete_stmt.rs:38— crates/pgls_pretty_print/src/nodes/delete_stmt.rs:38-42 | crates/pgls_pretty_print/src/nodes/merge_stmt.rs:68-72 | crates/pgls_pretty_print/src/nodes/update_stmt.rs:47-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/pgls_pretty_print/src/nodes/delete_stmt.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `n` to `&DeleteStmt` in one and `&MergeStmt` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) crates/pgls_treesitter/src/queries/insert_columns.rs:35— crates/pgls_treesitter/src/queries/insert_columns.rs:35-42 | crates/pgls_treesitter/src/queries/select_columns.rs:51-58 | crates/pgls_treesitter/src/queries/where_columns.rs:61-68 — 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 (14–17 lines × 2) xtask/codegen/src/generate_pglinter.rs:634— xtask/codegen/src/generate_pglinter.rs:634-647 | xtask/codegen/src/generate_splinter.rs:660-676 — before extracting anything, compare `xtask/codegen/src/generate_pglinter.rs` and `xtask/codegen/src/generate_splinter.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 133 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 `xtask/codegen/src/generate_pglinter.rs:634` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:43— crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:43-48 | crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:67-72 | crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:79-84 | crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:91-96 | crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:103-108 | crates/pgls_pretty_print/src/nodes/create_role_stmt.rs:115-120 — 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/pgls_pretty_print/src/nodes/create_role_stmt.rs:43` 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.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the node:test suite in crates/pgls_treesitter_grammar/ ran but wrote no lcov report. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
Sync-over-async blocking packages/@postgres-language-server/wasm/src/common.ts:50— `readFileSync` in `loadWasm` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Duplication concentrated across 2 sibling directories (6 clone groups) packages/@postgres-language-server/cli/scripts/generate-packages.mjs:7— 6 duplicated blocks under packages/ have copies in at least two of the sibling directories @postgres-language-server, @postgrestools — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (190 matched lines × 2 locations) · ×1
Duplicated block with local edits (190 matched lines × 2 locations) packages/@postgres-language-server/cli/scripts/generate-packages.mjs:7— packages/@postgres-language-server/cli/scripts/generate-packages.mjs:7 · packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:7 — the two spans are one implementation copied and then locally edited — 1387 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (144 identical lines × 2 files) packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:1— packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:1 · packages/@postgrestools/backend-jsonrpc/src/transport.ts:1 — these 2 files are line-for-line copies of one another — 144 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Duplicated block (60 lines × 2 locations) packages/@postgres-language-server/backend-jsonrpc/src/command.ts:8— packages/@postgres-language-server/backend-jsonrpc/src/command.ts:8 · packages/@postgrestools/backend-jsonrpc/src/command.ts:8 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (22 lines × 2 locations) packages/@postgres-language-server/backend-jsonrpc/src/socket.ts:4— packages/@postgres-language-server/backend-jsonrpc/src/socket.ts:4 · packages/@postgrestools/backend-jsonrpc/src/socket.ts:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (19 lines × 2 locations) packages/@postgres-language-server/backend-jsonrpc/src/index.ts:12— packages/@postgres-language-server/backend-jsonrpc/src/index.ts:12 · packages/@postgrestools/backend-jsonrpc/src/index.ts:12 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (16 lines × 2 locations) packages/@postgres-language-server/wasm/src/workspace.ts:53— packages/@postgres-language-server/wasm/src/workspace.ts:53 · packages/@postgres-language-server/wasm/src/workspace.ts:77 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) REDACTED:3827— REDACTED:3827 · REDACTED:3839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2 locations) REDACTED:2427— REDACTED:2427 · REDACTED:2538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `grammar(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything.
Duplicated block (10 lines × 2 locations) REDACTED:590— REDACTED:590 · REDACTED:608 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) REDACTED:3169— REDACTED:3169 · REDACTED:3359 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) REDACTED:1623— REDACTED:1623 · REDACTED:2048 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 3 locations) packages/@postgres-language-server/wasm/src/lsp.ts:58— packages/@postgres-language-server/wasm/src/lsp.ts:58 · packages/@postgres-language-server/wasm/src/workspace.ts:59 · packages/@postgres-language-server/wasm/src/workspace.ts:87 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
REDACTED: 3923 lines of code REDACTED:1— REDACTED has 3923 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Interpolated log message defeats structured logging crates/pgls_workspace/src/settings.rs:108— `trace!` at line 108 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/pgls_workspace/src/settings.rs:971— `warn!` at line 971 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/pgls_workspace/src/settings.rs:1006— `warn!` at line 1006 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/pgls_workspace/src/workspace/server.rs:249— `debug!` at line 249 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/pgls_workspace/src/workspace/server.rs:603— `debug!` at line 603 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/pgls_workspace/src/workspace/server.rs:653— `debug!` at line 653 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/pgls_workspace/src/workspace/server.rs:1298— `info!` at line 1298 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: `info!(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/pgls_workspace/src/workspace/server.rs:1332— `debug!` at line 1332 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/pgls_workspace/src/workspace/server/connection_manager.rs:150— `debug!` at line 150 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/pgls_workspace/src/workspace/server/connection_manager.rs:198— `debug!` at line 198 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/pgls_workspace/src/workspace/server/connection_manager.rs:262— `error!` at line 262 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: `error!(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/pgls_workspace/src/workspace/server/connection_manager.rs:389— `debug!` at line 389 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/pgls_workspace/src/workspace/server/connection_manager.rs:394— `warn!` at line 394 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/pgls_workspace/src/workspace/server/connection_manager.rs:423— `debug!` at line 423 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/pgls_workspace/src/workspace/server/document_cache.rs:104— `debug!` at line 104 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/pgls_workspace/src/workspace/server/pgpass.rs:80— `warn!` at line 80 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/pgls_workspace/src/workspace/server/pgpass.rs:84— `warn!` at line 84 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/pgls_workspace/src/workspace/server/snapshot_manager.rs:142— `debug!` at line 142 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/pgls_workspace/src/workspace/server/snapshot_manager.rs:174— `debug!` at line 174 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/pgls_workspace/src/features/code_actions/execute_statement/execution.rs:138— `warn!` at line 138 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/pgls_workspace/src/features/code_actions/execute_statement/execution.rs:158— `warn!` at line 158 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/pgls_workspace/src/configuration/project.rs:113— `info!` at line 113 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: `info!(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/pgls_lsp/src/server.rs:181— `error!` at line 181 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: `error!(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/pgls_lsp/src/server.rs:203— `error!` at line 203 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: `error!(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/pgls_lsp/src/server.rs:221— `error!` at line 221 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: `error!(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`.
Duplicated predicate packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:51— `!("id" in message) && "method" in message && typeof message.method === "string" && "params" in message` appears character-identically in 2 files — packages/@postgres-language-server/backend-jsonrpc/src/transport.ts, packages/@postgrestools/backend-jsonrpc/src/transport.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:72— `"id" in message && typeof message.id === "number" && !("method" in message) && ("result" in message || "error" in message)` appears character-identically in 2 files — packages/@postgres-language-server/backend-jsonrpc/src/transport.ts, packages/@postgrestools/backend-jsonrpc/src/transport.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:35— `"id" in message && typeof message.id === "number" && "method" in message && typeof message.method === "string" && "params" in message` appears character-identically in 2 files — packages/@postgres-language-server/backend-jsonrpc/src/transport.ts, packages/@postgrestools/backend-jsonrpc/src/transport.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/@postgres-language-server/cli/scripts/generate-packages.mjs:29— `platform.endsWith("musl") && arch === "aarch64"` appears character-identically in 2 files — packages/@postgres-language-server/cli/scripts/generate-packages.mjs, packages/@postgrestools/postgrestools/scripts/generate-packages.mjs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/@postgres-language-server/backend-jsonrpc/src/command.ts:70— `typeof err === "object" && err !== null && "stderr" in err` appears character-identically in 2 files — packages/@postgres-language-server/backend-jsonrpc/src/command.ts, packages/@postgrestools/backend-jsonrpc/src/command.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/@postgres-language-server/backend-jsonrpc/src/transport.ts:83— `typeof message === "object" && message !== null && "jsonrpc" in message && message.jsonrpc === "2.0"` appears character-identically in 2 files — packages/@postgres-language-server/backend-jsonrpc/src/transport.ts, packages/@postgrestools/backend-jsonrpc/src/transport.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/pgls_workspace/src/workspace/server/analysis.rs:207— `(i + 1).is_multiple_of(STOP_CHECK_INTERVAL) && should_stop()` appears character-identically in 2 files — crates/pgls_workspace/src/workspace/server/analysis.rs, crates/pgls_workspace/src/workspace/server/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/pgls_query_macros/src/iter_mut.rs:121— `matches!(field.r#type, FieldType::Node(_)) && !field.is_one_of` appears character-identically in 2 files — crates/pgls_query_macros/src/iter_mut.rs, crates/pgls_query_macros/src/iter_ref.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/pgls_query_macros/src/iter_mut.rs:111— `matches!(field.r#type, FieldType::Node(_)) && field.repeated` appears character-identically in 2 files — crates/pgls_query_macros/src/iter_mut.rs, crates/pgls_query_macros/src/iter_ref.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/pgls_pretty_print/src/nodes/json_array_agg.rs:28— `n.constructor && !constructor.agg_order.is_empty()` appears character-identically in 2 files — crates/pgls_pretty_print/src/nodes/json_array_agg.rs, crates/pgls_pretty_print/src/nodes/json_object_agg.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/pgls_catalog/src/resolve/nodes/func_call.rs:36— `schema && r.check_schema(schema, n.location)` appears character-identically in 3 files — crates/pgls_catalog/src/resolve/nodes/func_call.rs, crates/pgls_catalog/src/resolve/nodes/range_var.rs, crates/pgls_catalog/src/resolve/nodes/type_name.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/pgls_pretty_print/src/nodes/a_expr.rs:588— `sub_link.sub_link_type == SubLinkType::ExprSublink as i32 || sub_link.sub_link_type == SubLinkType::ArraySublink as i32` appears character-identically in 2 files — crates/pgls_pretty_print/src/nodes/a_expr.rs, crates/pgls_pretty_print/src/nodes/utils/predicates.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Orphaned file crates/pgls_treesitter/src/queries/insert_columns.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pgls_hover/src/hoverables/function.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pgls_treesitter/src/helper.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pgls_hover/src/hoverables/postgres_type.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pgls_hover/src/hoverables/role.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pgls_treesitter/src/queries/object_references.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Silent fallback default on Err crates/pgls_inlay_hints/src/lib.rs:105— `inlay_hints_of_references` 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/pgls_migrations/src/detect.rs:138— `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/pgls_pretty_print/src/comments.rs:260— `keywords_after_comments` turns every `Err` into `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 crates/pgls_pretty_print/src/comments.rs:332— `collect_comments` 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/pgls_pretty_print/src/identifiers.rs:16— `truncated_identifiers` turns every `Err` into `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 crates/pgls_suppressions/src/lib.rs:111— `get_unused_suppressions_as_errors` turns every `Err` into `false` — 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.
Partial audit-trail evidence — An audit mechanism is present, but the trail is not yet complete — missing: an audit-log / audit-trail table or model to write to, per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 167 significant file(s) lose their only recent owner: crates/pgls_catalog/src/catalog/tests.rs, crates/pgls_workspace/src/workspace/server/document.rs, crates/pgls_catalog/src/resolve/tests.rs, crates/pgls_workspace/src/configuration.rs, crates/pgls_wasm/src/lsp.rs, crates/pgls_catalog/src/catalog/overlay.rs, crates/pgls_plpgsql_check/src/lib.rs, crates/pgls_analyser/src/lib.rs (+159 more). Pair on, review, or document these before any departure.
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 (170 single-owned of 421 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; 421 of the 848 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (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/pgls_treesitter/src/queries/where_columns.rs, crates/pgls_treesitter/src/queries/select_columns.rs, crates/pgls_cli/src/commands/parse.rs.
No ADRs found crates/pgls_test_utils/Cargo.toml:14— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `crates/pgls_test_utils/Cargo.toml` makes this repository a deployable product (line 14).
redundant comment packages/@postgrestools/postgrestools/scripts/generate-packages.mjs:225— "Add deprecation notice for @postgrestools packages" repeats the code it sits on: 4 of its 5 words (deprecation, notice, postgrestools, packages) are already in `const deprecationNotice = `> [!WARNING]`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 3 of 52 project(s) overshoot their size bounds, lowering Project Cohesion to 8.8/10. The most over is `crates/pgls_catalog` (21584 LoC, 168 module-visible types across 10 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 6 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: crates/pgls_treesitter/src/queries/insert_columns.rs, crates/pgls_hover/src/hoverables/function.rs, crates/pgls_treesitter/src/helper.rs, crates/pgls_hover/src/hoverables/postgres_type.rs, crates/pgls_hover/src/hoverables/role.rs, crates/pgls_treesitter/src/queries/object_references.rs (7 orphaned of 421 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; 421 of the 848 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 7/14 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/pgls_postgres_regress`, `crates/pgls_test_utils`, `docs/codegen`, `packages/@postgres-language-server/cli`, `packages/@postgrestools/postgrestools` and 2 more.
No dependency-update automation package.json:5— `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 0/5 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Subsumed condition operand crates/pgls_fs/src/fs/memory.rs:411— `base.starts_with("./")` can never decide this `||` — every value satisfying `base.starts_with("./")` also satisfies `base.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.
Outdated: anyhow — `anyhow` is locked at 1.0.101 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0.92"` requirement declared in crates/pgls_cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
Outdated: backtrace — `backtrace` is locked at 0.3.76 but 0.3.77 is the current stable release on crates.io, and it already satisfies the `"0.3.74"` requirement declared in crates/pgls_diagnostics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p backtrace` and commit the updated REDACTED.
Outdated: bpaf — `bpaf` is locked at 0.9.23 but 0.9.29 is the current stable release on crates.io, and it already satisfies the `"0.9.15"` requirement declared in crates/pgls_cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bpaf` and commit the updated REDACTED.
Outdated: cc — `cc` is locked at 1.2.55 but 1.11.2 is the current stable release on crates.io, and it already satisfies the `"1.0.83"` requirement declared in crates/pgls_query/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cc` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.5.57 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.5.23"` requirement declared in crates/pgls_test_utils/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 — `crossbeam` is locked at 0.8.4 but 0.8.5 is the current stable release on crates.io, and it already satisfies the `"0.8.4"` requirement declared in crates/pgls_cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam` and commit the updated REDACTED.
Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1.1"` requirement declared in crates/pgls_postgres_regress/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
Outdated: futures — `futures` is locked at 0.3.31 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3.31"` requirement declared in crates/pgls_lsp/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
Outdated: futures-util — `futures-util` is locked at 0.3.31 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3.31"` requirement declared in crates/pgls_catalog/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: glob — `glob` is locked at 0.3.3 but 0.3.4 is the current stable release on crates.io, and it already satisfies the `"0.3.1"` requirement declared in crates/pgls_query/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p glob` 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.16"` requirement declared in crates/pgls_catalog/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p globset` and commit the updated REDACTED.
Outdated: hdrhistogram — `hdrhistogram` is locked at 7.5.4 but 7.6.0 is the current stable release on crates.io, and it already satisfies the `"7.5.4"` requirement declared in crates/pgls_cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hdrhistogram` 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.23"` requirement declared in crates/pgls_fs/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.13.0 but 2.14.2 is the current stable release on crates.io, and it already satisfies the `"2.6.0"` requirement declared in crates/pgls_configuration/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p indexmap` and commit the updated REDACTED.
Outdated: json-strip-comments — `json-strip-comments` is locked at 3.1.0 but 3.1.3 is the current stable release on crates.io, and it already satisfies the `"3.1.0"` requirement declared in crates/pgls_workspace/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p json-strip-comments` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.181 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2.161"` requirement declared in crates/pgls_cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: mimalloc — `mimalloc` is locked at 0.1.48 but 0.1.52 is the current stable release on crates.io, and it already satisfies the `"0.1.43"` requirement declared in crates/pgls_cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p mimalloc` and commit the updated REDACTED.
Outdated: once_cell — `once_cell` is locked at 1.21.3 but 1.21.4 is the current stable release on crates.io, and it already satisfies the `"1.20.2"` requirement declared in crates/pgls_typecheck/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p once_cell` and commit the updated REDACTED.
Outdated: proc-macro2 — `proc-macro2` is locked at 1.0.106 but 1.0.107 is the current stable release on crates.io, and it already satisfies the `"1.0.66"` requirement declared in crates/pgls_configuration_macros/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p proc-macro2` and commit the updated REDACTED.
Outdated: quote — `quote` is locked at 1.0.44 but 1.0.47 is the current stable release on crates.io, and it already satisfies the `"1.0.33"` requirement declared in crates/pgls_configuration_macros/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p quote` and commit the updated REDACTED.
Outdated: rayon — `rayon` is locked at 1.11.0 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1.10.0"` requirement declared in crates/pgls_cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rayon` and commit the updated REDACTED.
Outdated: 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.11.1"` requirement declared in crates/pgls_plpgsql_check/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
Outdated: rustc-hash — `rustc-hash` is locked at 2.1.1 but 2.1.3 is the current stable release on crates.io, and it already satisfies the `"2.0.0"` requirement declared in crates/pgls_analyse/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustc-hash` and commit the updated REDACTED.
Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1.0.195"` requirement declared in crates/pgls_analyse/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.149 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1.0.114"` requirement declared in crates/pgls_catalog/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
doc comments repeat the names packages/@postgres-language-server/wasm/src/lsp.ts:72— 0 of 1 documented parameters and 4 of 70 summaries in `@postgres-language-server/wasm` only repeat the member or parameter name (e.g. "Create a new LanguageServer instance." for `createLanguageServer`). Delete the restating tags, or add what the name does not say.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1db74-dd09-7d62-a2fb-7bd9e5aa0c06 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 92 · Warnings: 769 · Recommendations: 81 · Info: 34 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 19:07 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.