Public report of tobymao/sqlglot, published 17 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, 17 November 2026, 20:41 UTC · Survey ID cd_20a08c052b374a439a05b37fa557ec04
tobymao/sqlglot
Measured 17 November 2026, 20:40 UTC, at code version 3721a79
First survey, so nothing to compare with yet
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
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 medium codebase: 73,305 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 1.1 person-years · Weakest lens: Security and Compliance, 58.4
Findings by how serious they are
31 critical535 serious60 minor
13 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
17 November 2026, 20:40 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
45of 45 dimensions measured by tools.
616of 626 findings point to an exact file and line, so you can open each one in the code. The other 10 concern the repository as a whole, such as missing documentation.
45dimensions across 6 lenses, read from 73,305 lines of product code in 2 projects.
tobymao/sqlglot falls short of our standard for production, in part because it has pipeline tools referenced by a changeable name. It scores 62.4 out of 100 and is rated Adequate, and all 31 of its critical findings are security problems in the build pipeline and in its code.
Security and Compliance, at 58.4, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step is pinning the build's installs, worth about 2.3 points. Stopping the two pipeline steps that hand secrets to unpinned tools comes next, worth about 2.0 points.
Twenty-five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three pipeline steps install packages that can change without warning, and two secrets can leak from the build pipeline. Pinning each tool to an exact version, pinning what the pipeline installs and limiting each secret to its own step would close these risks. The place where the code runs text as code or as a command needs a direct call instead.
The product code is 73,305 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.
The weakest lenses score close to each other, so improving any of them moves the score.
Code composition: what the lines of code are
Product code 53%Tests 47%
Rebuild cost: about €150,000 · Estimate
Cost to rebuild
€51,000 to €260,000, for 856 to 2,714 hours of work, about 1.1 person-years for 1 to 3 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.9 at a score of 62. 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
Medium: 73,305 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Files that change often carry extra risk · Combined risk
8 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (45 files) · Code Coverage (22 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: unnest_subqueries.py, bigquery.py and canonicalize_internal_names.py
What to do: Add tests to these files and have a second person review every change to them, starting with unnest_subqueries.py, bigquery.py and canonicalize_internal_names.py.
Where the investment is most exposed · Value at risk
This code would cost about €150,000 to build again, about 1.1 person-years of work. Its weakest lens is Security and Compliance, at 58.4 (Adequate). 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
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST). Of all the actions in this report, it raises the score most for the work it takes: about 2.3 points for low effort, because it clears the 3 Static Analysis (SAST) findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 32,422 lines over the last 90 days, which is about 131,489 lines a year. At that pace, the extra work comes to an estimated 17.3 to 103.8 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: 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.
154 modules, with 534 dependencies between them. 2 loops run through 4 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 114 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.
expressions.datatypes uses expressions.core, so a change to expressions.core can break expressions.datatypes, while a change to expressions.datatypes can't break expressions.core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
expressions.core uses expressions.datatypes, so a change to expressions.datatypes can break expressions.core, while a change to expressions.core can't break expressions.datatypes.
Position
Below the diagonal: expressions.core uses a module listed above it, which is the healthy direction.
147 pairs of types, where a type in expressions.aggregate uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.aggregate uses expressions.core, so a change to expressions.core can break expressions.aggregate, while a change to expressions.aggregate can't break expressions.core.
Position
Below the diagonal: expressions.aggregate uses a module listed above it, which is the healthy direction.
78 pairs of types, where a type in expressions.constraints uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.constraints uses expressions.core, so a change to expressions.core can break expressions.constraints, while a change to expressions.constraints can't break expressions.core.
Position
Below the diagonal: expressions.constraints uses a module listed above it, which is the healthy direction.
55 pairs of types, where a type in expressions.ddl uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.ddl uses expressions.core, so a change to expressions.core can break expressions.ddl, while a change to expressions.ddl can't break expressions.core.
Position
Below the diagonal: expressions.ddl uses a module listed above it, which is the healthy direction.
6→13 expressions.ddl uses expressions.querypart of a loop✕
Connections
1 pair of types, where a type in expressions.ddl uses a type in expressions.query.
expressions.ddl uses expressions.query, so a change to expressions.query can break expressions.ddl, while a change to expressions.ddl can't break expressions.query.
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.
expressions.functions uses expressions.datatypes, so a change to expressions.datatypes can break expressions.functions, while a change to expressions.functions can't break expressions.datatypes.
Position
Below the diagonal: expressions.functions uses a module listed above it, which is the healthy direction.
190 pairs of types, where a type in expressions.functions uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.functions uses expressions.core, so a change to expressions.core can break expressions.functions, while a change to expressions.functions can't break expressions.core.
Position
Below the diagonal: expressions.functions uses a module listed above it, which is the healthy direction.
91 pairs of types, where a type in expressions.json uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.json uses expressions.core, so a change to expressions.core can break expressions.json, while a change to expressions.json can't break expressions.core.
Position
Below the diagonal: expressions.json uses a module listed above it, which is the healthy direction.
expressions.properties uses expressions.core, so a change to expressions.core can break expressions.properties, while a change to expressions.properties can't break expressions.core.
Position
Below the diagonal: expressions.properties uses a module listed above it, which is the healthy direction.
214 pairs of types, where a type in expressions.string uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.string uses expressions.core, so a change to expressions.core can break expressions.string, while a change to expressions.string can't break expressions.core.
Position
Below the diagonal: expressions.string uses a module listed above it, which is the healthy direction.
expressions.temporal uses expressions.datatypes, so a change to expressions.datatypes can break expressions.temporal, while a change to expressions.temporal can't break expressions.datatypes.
Position
Below the diagonal: expressions.temporal uses a module listed above it, which is the healthy direction.
233 pairs of types, where a type in expressions.temporal uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.temporal uses expressions.core, so a change to expressions.core can break expressions.temporal, while a change to expressions.temporal can't break expressions.core.
Position
Below the diagonal: expressions.temporal uses a module listed above it, which is the healthy direction.
expressions.dml uses expressions.core, so a change to expressions.core can break expressions.dml, while a change to expressions.dml can't break expressions.core.
Position
Below the diagonal: expressions.dml uses a module listed above it, which is the healthy direction.
expressions.dml uses expressions.ddl, so a change to expressions.ddl can break expressions.dml, while a change to expressions.dml can't break expressions.ddl.
Position
Below the diagonal: expressions.dml uses a module listed above it, which is the healthy direction.
138 pairs of types, where a type in expressions.query uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
expressions.query uses expressions.core, so a change to expressions.core can break expressions.query, while a change to expressions.query can't break expressions.core.
Position
Below the diagonal: expressions.query uses a module listed above it, which is the healthy direction.
expressions.query uses expressions.ddl, so a change to expressions.ddl can break expressions.query, while a change to expressions.query can't break expressions.ddl.
Position
Below the diagonal: expressions.query uses a module listed above it, which is the healthy direction.
generator uses expressions.datatypes, so a change to expressions.datatypes can break generator, while a change to generator can't break expressions.datatypes.
Position
Below the diagonal: generator uses a module listed above it, which is the healthy direction.
93 pairs of types, where a type in generator uses a type in expressions.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
generator uses expressions.aggregate, so a change to expressions.aggregate can break generator, while a change to generator can't break expressions.aggregate.
Position
Below the diagonal: generator uses a module listed above it, which is the healthy direction.
generator uses expressions.constraints, so a change to expressions.constraints can break generator, while a change to generator can't break expressions.constraints.
Position
Below the diagonal: generator uses a module listed above it, which is the healthy direction.
52 pairs of types, where a type in generator uses a type in expressions.ddl. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
29 pairs of types, where a type in generator uses a type in expressions.functions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
generator uses expressions.functions, so a change to expressions.functions can break generator, while a change to generator can't break expressions.functions.
Position
Below the diagonal: generator uses a module listed above it, which is the healthy direction.
43 pairs of types, where a type in generator uses a type in expressions.properties. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
generator uses expressions.properties, so a change to expressions.properties can break generator, while a change to generator can't break expressions.properties.
Position
Below the diagonal: generator uses a module listed above it, which is the healthy direction.
generator uses expressions.temporal, so a change to expressions.temporal can break generator, while a change to generator can't break expressions.temporal.
Position
Below the diagonal: generator uses a module listed above it, which is the healthy direction.
116 pairs of types, where a type in generator uses a type in expressions.query. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
generators.spark uses expressions.core, so a change to expressions.core can break generators.spark, while a change to generators.spark can't break expressions.core.
Position
Below the diagonal: generators.spark uses a module listed above it, which is the healthy direction.
generators.spark uses expressions.aggregate, so a change to expressions.aggregate can break generators.spark, while a change to generators.spark can't break expressions.aggregate.
Position
Below the diagonal: generators.spark uses a module listed above it, which is the healthy direction.
generators.spark uses expressions.constraints, so a change to expressions.constraints can break generators.spark, while a change to generators.spark can't break expressions.constraints.
Position
Below the diagonal: generators.spark uses a module listed above it, which is the healthy direction.
generators.spark uses expressions.functions, so a change to expressions.functions can break generators.spark, while a change to generators.spark can't break expressions.functions.
Position
Below the diagonal: generators.spark uses a module listed above it, which is the healthy direction.
generators.spark uses expressions.temporal, so a change to expressions.temporal can break generators.spark, while a change to generators.spark can't break expressions.temporal.
Position
Below the diagonal: generators.spark uses a module listed above it, which is the healthy direction.
generators.spark uses expressions.query, so a change to expressions.query can break generators.spark, while a change to generators.spark can't break expressions.query.
Position
Below the diagonal: generators.spark uses a module listed above it, which is the healthy direction.
optimizer.annotate_types uses expressions.core, so a change to expressions.core can break optimizer.annotate_types, while a change to optimizer.annotate_types can't break expressions.core.
Position
Below the diagonal: optimizer.annotate_types uses a module listed above it, which is the healthy direction.
optimizer.annotate_types uses expressions.temporal, so a change to expressions.temporal can break optimizer.annotate_types, while a change to optimizer.annotate_types can't break expressions.temporal.
Position
Below the diagonal: optimizer.annotate_types uses a module listed above it, which is the healthy direction.
optimizer.annotate_types uses expressions.query, so a change to expressions.query can break optimizer.annotate_types, while a change to optimizer.annotate_types can't break expressions.query.
Position
Below the diagonal: optimizer.annotate_types uses a module listed above it, which is the healthy direction.
parser uses expressions.constraints, so a change to expressions.constraints can break parser, while a change to parser can't break expressions.constraints.
Position
Below the diagonal: parser uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in parser uses a type in expressions.properties. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
parser uses expressions.properties, so a change to expressions.properties can break parser, while a change to parser can't break expressions.properties.
Position
Below the diagonal: parser uses a module listed above it, which is the healthy direction.
dialects.dialect uses expressions.core, so a change to expressions.core can break dialects.dialect, while a change to dialects.dialect can't break expressions.core.
Position
Below the diagonal: dialects.dialect uses a module listed above it, which is the healthy direction.
dialects.dialect uses expressions.query, so a change to expressions.query can break dialects.dialect, while a change to dialects.dialect can't break expressions.query.
Position
Below the diagonal: dialects.dialect uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.core, so a change to expressions.core can break generators.bigquery, while a change to generators.bigquery can't break expressions.core.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.aggregate, so a change to expressions.aggregate can break generators.bigquery, while a change to generators.bigquery can't break expressions.aggregate.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.functions, so a change to expressions.functions can break generators.bigquery, while a change to generators.bigquery can't break expressions.functions.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.json, so a change to expressions.json can break generators.bigquery, while a change to generators.bigquery can't break expressions.json.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.properties, so a change to expressions.properties can break generators.bigquery, while a change to generators.bigquery can't break expressions.properties.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.string, so a change to expressions.string can break generators.bigquery, while a change to generators.bigquery can't break expressions.string.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.temporal, so a change to expressions.temporal can break generators.bigquery, while a change to generators.bigquery can't break expressions.temporal.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses expressions.query, so a change to expressions.query can break generators.bigquery, while a change to generators.bigquery can't break expressions.query.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.bigquery uses generator, so a change to generator can break generators.bigquery, while a change to generators.bigquery can't break generator.
Position
Below the diagonal: generators.bigquery uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.datatypes, so a change to expressions.datatypes can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.datatypes.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.core, so a change to expressions.core can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.core.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.aggregate, so a change to expressions.aggregate can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.aggregate.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.constraints, so a change to expressions.constraints can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.constraints.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.ddl, so a change to expressions.ddl can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.ddl.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.functions, so a change to expressions.functions can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.functions.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.properties, so a change to expressions.properties can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.properties.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.string, so a change to expressions.string can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.string.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.temporal, so a change to expressions.temporal can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.temporal.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses expressions.query, so a change to expressions.query can break generators.clickhouse, while a change to generators.clickhouse can't break expressions.query.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.clickhouse uses generator, so a change to generator can break generators.clickhouse, while a change to generators.clickhouse can't break generator.
Position
Below the diagonal: generators.clickhouse uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.datatypes, so a change to expressions.datatypes can break generators.duckdb, while a change to generators.duckdb can't break expressions.datatypes.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.core, so a change to expressions.core can break generators.duckdb, while a change to generators.duckdb can't break expressions.core.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.aggregate, so a change to expressions.aggregate can break generators.duckdb, while a change to generators.duckdb can't break expressions.aggregate.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.ddl, so a change to expressions.ddl can break generators.duckdb, while a change to generators.duckdb can't break expressions.ddl.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.functions, so a change to expressions.functions can break generators.duckdb, while a change to generators.duckdb can't break expressions.functions.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.json, so a change to expressions.json can break generators.duckdb, while a change to generators.duckdb can't break expressions.json.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
44 pairs of types, where a type in generators.duckdb uses a type in expressions.string. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
generators.duckdb uses expressions.string, so a change to expressions.string can break generators.duckdb, while a change to generators.duckdb can't break expressions.string.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.temporal, so a change to expressions.temporal can break generators.duckdb, while a change to generators.duckdb can't break expressions.temporal.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.duckdb uses expressions.query, so a change to expressions.query can break generators.duckdb, while a change to generators.duckdb can't break expressions.query.
Position
Below the diagonal: generators.duckdb uses a module listed above it, which is the healthy direction.
generators.exasol uses expressions.datatypes, so a change to expressions.datatypes can break generators.exasol, while a change to generators.exasol can't break expressions.datatypes.
Position
Below the diagonal: generators.exasol uses a module listed above it, which is the healthy direction.
generators.exasol uses expressions.core, so a change to expressions.core can break generators.exasol, while a change to generators.exasol can't break expressions.core.
Position
Below the diagonal: generators.exasol uses a module listed above it, which is the healthy direction.
generators.exasol uses expressions.ddl, so a change to expressions.ddl can break generators.exasol, while a change to generators.exasol can't break expressions.ddl.
Position
Below the diagonal: generators.exasol uses a module listed above it, which is the healthy direction.
generators.exasol uses expressions.functions, so a change to expressions.functions can break generators.exasol, while a change to generators.exasol can't break expressions.functions.
Position
Below the diagonal: generators.exasol uses a module listed above it, which is the healthy direction.
generators.exasol uses expressions.json, so a change to expressions.json can break generators.exasol, while a change to generators.exasol can't break expressions.json.
Position
Below the diagonal: generators.exasol uses a module listed above it, which is the healthy direction.
generators.exasol uses expressions.temporal, so a change to expressions.temporal can break generators.exasol, while a change to generators.exasol can't break expressions.temporal.
Position
Below the diagonal: generators.exasol uses a module listed above it, which is the healthy direction.
generators.exasol uses expressions.query, so a change to expressions.query can break generators.exasol, while a change to generators.exasol can't break expressions.query.
Position
Below the diagonal: generators.exasol uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.datatypes, so a change to expressions.datatypes can break generators.hive, while a change to generators.hive can't break expressions.datatypes.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.core, so a change to expressions.core can break generators.hive, while a change to generators.hive can't break expressions.core.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.aggregate, so a change to expressions.aggregate can break generators.hive, while a change to generators.hive can't break expressions.aggregate.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.constraints, so a change to expressions.constraints can break generators.hive, while a change to generators.hive can't break expressions.constraints.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.ddl, so a change to expressions.ddl can break generators.hive, while a change to generators.hive can't break expressions.ddl.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.functions, so a change to expressions.functions can break generators.hive, while a change to generators.hive can't break expressions.functions.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.properties, so a change to expressions.properties can break generators.hive, while a change to generators.hive can't break expressions.properties.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.temporal, so a change to expressions.temporal can break generators.hive, while a change to generators.hive can't break expressions.temporal.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.hive uses expressions.query, so a change to expressions.query can break generators.hive, while a change to generators.hive can't break expressions.query.
Position
Below the diagonal: generators.hive uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.datatypes, so a change to expressions.datatypes can break generators.mysql, while a change to generators.mysql can't break expressions.datatypes.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.core, so a change to expressions.core can break generators.mysql, while a change to generators.mysql can't break expressions.core.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.constraints, so a change to expressions.constraints can break generators.mysql, while a change to generators.mysql can't break expressions.constraints.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.ddl, so a change to expressions.ddl can break generators.mysql, while a change to generators.mysql can't break expressions.ddl.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.functions, so a change to expressions.functions can break generators.mysql, while a change to generators.mysql can't break expressions.functions.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.json, so a change to expressions.json can break generators.mysql, while a change to generators.mysql can't break expressions.json.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.properties, so a change to expressions.properties can break generators.mysql, while a change to generators.mysql can't break expressions.properties.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.string, so a change to expressions.string can break generators.mysql, while a change to generators.mysql can't break expressions.string.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.temporal, so a change to expressions.temporal can break generators.mysql, while a change to generators.mysql can't break expressions.temporal.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.mysql uses expressions.query, so a change to expressions.query can break generators.mysql, while a change to generators.mysql can't break expressions.query.
Position
Below the diagonal: generators.mysql uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.datatypes, so a change to expressions.datatypes can break generators.oracle, while a change to generators.oracle can't break expressions.datatypes.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.core, so a change to expressions.core can break generators.oracle, while a change to generators.oracle can't break expressions.core.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.aggregate, so a change to expressions.aggregate can break generators.oracle, while a change to generators.oracle can't break expressions.aggregate.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.functions, so a change to expressions.functions can break generators.oracle, while a change to generators.oracle can't break expressions.functions.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.properties, so a change to expressions.properties can break generators.oracle, while a change to generators.oracle can't break expressions.properties.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.string, so a change to expressions.string can break generators.oracle, while a change to generators.oracle can't break expressions.string.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.temporal, so a change to expressions.temporal can break generators.oracle, while a change to generators.oracle can't break expressions.temporal.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.oracle uses expressions.query, so a change to expressions.query can break generators.oracle, while a change to generators.oracle can't break expressions.query.
Position
Below the diagonal: generators.oracle uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.datatypes, so a change to expressions.datatypes can break generators.postgres, while a change to generators.postgres can't break expressions.datatypes.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.core, so a change to expressions.core can break generators.postgres, while a change to generators.postgres can't break expressions.core.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.constraints, so a change to expressions.constraints can break generators.postgres, while a change to generators.postgres can't break expressions.constraints.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.ddl, so a change to expressions.ddl can break generators.postgres, while a change to generators.postgres can't break expressions.ddl.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.functions, so a change to expressions.functions can break generators.postgres, while a change to generators.postgres can't break expressions.functions.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.properties, so a change to expressions.properties can break generators.postgres, while a change to generators.postgres can't break expressions.properties.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.string, so a change to expressions.string can break generators.postgres, while a change to generators.postgres can't break expressions.string.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses expressions.query, so a change to expressions.query can break generators.postgres, while a change to generators.postgres can't break expressions.query.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.postgres uses generator, so a change to generator can break generators.postgres, while a change to generators.postgres can't break generator.
Position
Below the diagonal: generators.postgres uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.datatypes, so a change to expressions.datatypes can break generators.presto, while a change to generators.presto can't break expressions.datatypes.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.core, so a change to expressions.core can break generators.presto, while a change to generators.presto can't break expressions.core.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.aggregate, so a change to expressions.aggregate can break generators.presto, while a change to generators.presto can't break expressions.aggregate.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.ddl, so a change to expressions.ddl can break generators.presto, while a change to generators.presto can't break expressions.ddl.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.functions, so a change to expressions.functions can break generators.presto, while a change to generators.presto can't break expressions.functions.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.json, so a change to expressions.json can break generators.presto, while a change to generators.presto can't break expressions.json.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.string, so a change to expressions.string can break generators.presto, while a change to generators.presto can't break expressions.string.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.temporal, so a change to expressions.temporal can break generators.presto, while a change to generators.presto can't break expressions.temporal.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.presto uses expressions.dml, so a change to expressions.dml can break generators.presto, while a change to generators.presto can't break expressions.dml.
Position
Below the diagonal: generators.presto uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.datatypes, so a change to expressions.datatypes can break generators.snowflake, while a change to generators.snowflake can't break expressions.datatypes.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.core, so a change to expressions.core can break generators.snowflake, while a change to generators.snowflake can't break expressions.core.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.aggregate, so a change to expressions.aggregate can break generators.snowflake, while a change to generators.snowflake can't break expressions.aggregate.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.constraints, so a change to expressions.constraints can break generators.snowflake, while a change to generators.snowflake can't break expressions.constraints.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.ddl, so a change to expressions.ddl can break generators.snowflake, while a change to generators.snowflake can't break expressions.ddl.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.functions, so a change to expressions.functions can break generators.snowflake, while a change to generators.snowflake can't break expressions.functions.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.json, so a change to expressions.json can break generators.snowflake, while a change to generators.snowflake can't break expressions.json.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.properties, so a change to expressions.properties can break generators.snowflake, while a change to generators.snowflake can't break expressions.properties.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.string, so a change to expressions.string can break generators.snowflake, while a change to generators.snowflake can't break expressions.string.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.temporal, so a change to expressions.temporal can break generators.snowflake, while a change to generators.snowflake can't break expressions.temporal.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses expressions.query, so a change to expressions.query can break generators.snowflake, while a change to generators.snowflake can't break expressions.query.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.snowflake uses generator, so a change to generator can break generators.snowflake, while a change to generators.snowflake can't break generator.
Position
Below the diagonal: generators.snowflake uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.core, so a change to expressions.core can break generators.sqlite, while a change to generators.sqlite can't break expressions.core.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.aggregate, so a change to expressions.aggregate can break generators.sqlite, while a change to generators.sqlite can't break expressions.aggregate.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.constraints, so a change to expressions.constraints can break generators.sqlite, while a change to generators.sqlite can't break expressions.constraints.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.ddl, so a change to expressions.ddl can break generators.sqlite, while a change to generators.sqlite can't break expressions.ddl.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.functions, so a change to expressions.functions can break generators.sqlite, while a change to generators.sqlite can't break expressions.functions.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.json, so a change to expressions.json can break generators.sqlite, while a change to generators.sqlite can't break expressions.json.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.properties, so a change to expressions.properties can break generators.sqlite, while a change to generators.sqlite can't break expressions.properties.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.string, so a change to expressions.string can break generators.sqlite, while a change to generators.sqlite can't break expressions.string.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.temporal, so a change to expressions.temporal can break generators.sqlite, while a change to generators.sqlite can't break expressions.temporal.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.dml, so a change to expressions.dml can break generators.sqlite, while a change to generators.sqlite can't break expressions.dml.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.sqlite uses expressions.query, so a change to expressions.query can break generators.sqlite, while a change to generators.sqlite can't break expressions.query.
Position
Below the diagonal: generators.sqlite uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.datatypes, so a change to expressions.datatypes can break generators.teradata, while a change to generators.teradata can't break expressions.datatypes.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.core, so a change to expressions.core can break generators.teradata, while a change to generators.teradata can't break expressions.core.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.ddl, so a change to expressions.ddl can break generators.teradata, while a change to generators.teradata can't break expressions.ddl.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.functions, so a change to expressions.functions can break generators.teradata, while a change to generators.teradata can't break expressions.functions.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.properties, so a change to expressions.properties can break generators.teradata, while a change to generators.teradata can't break expressions.properties.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.temporal, so a change to expressions.temporal can break generators.teradata, while a change to generators.teradata can't break expressions.temporal.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.dml, so a change to expressions.dml can break generators.teradata, while a change to generators.teradata can't break expressions.dml.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses expressions.query, so a change to expressions.query can break generators.teradata, while a change to generators.teradata can't break expressions.query.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.teradata uses generator, so a change to generator can break generators.teradata, while a change to generators.teradata can't break generator.
Position
Below the diagonal: generators.teradata uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.core, so a change to expressions.core can break generators.tsql, while a change to generators.tsql can't break expressions.core.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.aggregate, so a change to expressions.aggregate can break generators.tsql, while a change to generators.tsql can't break expressions.aggregate.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.constraints, so a change to expressions.constraints can break generators.tsql, while a change to generators.tsql can't break expressions.constraints.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.ddl, so a change to expressions.ddl can break generators.tsql, while a change to generators.tsql can't break expressions.ddl.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.functions, so a change to expressions.functions can break generators.tsql, while a change to generators.tsql can't break expressions.functions.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.properties, so a change to expressions.properties can break generators.tsql, while a change to generators.tsql can't break expressions.properties.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.string, so a change to expressions.string can break generators.tsql, while a change to generators.tsql can't break expressions.string.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.temporal, so a change to expressions.temporal can break generators.tsql, while a change to generators.tsql can't break expressions.temporal.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.dml, so a change to expressions.dml can break generators.tsql, while a change to generators.tsql can't break expressions.dml.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
generators.tsql uses expressions.query, so a change to expressions.query can break generators.tsql, while a change to generators.tsql can't break expressions.query.
Position
Below the diagonal: generators.tsql uses a module listed above it, which is the healthy direction.
parsers.mysql uses expressions.core, so a change to expressions.core can break parsers.mysql, while a change to parsers.mysql can't break expressions.core.
Position
Below the diagonal: parsers.mysql uses a module listed above it, which is the healthy direction.
parsers.mysql uses expressions.constraints, so a change to expressions.constraints can break parsers.mysql, while a change to parsers.mysql can't break expressions.constraints.
Position
Below the diagonal: parsers.mysql uses a module listed above it, which is the healthy direction.
parsers.mysql uses expressions.ddl, so a change to expressions.ddl can break parsers.mysql, while a change to parsers.mysql can't break expressions.ddl.
Position
Below the diagonal: parsers.mysql uses a module listed above it, which is the healthy direction.
parsers.mysql uses expressions.query, so a change to expressions.query can break parsers.mysql, while a change to parsers.mysql can't break expressions.query.
Position
Below the diagonal: parsers.mysql uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.core, so a change to expressions.core can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.core.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.aggregate, so a change to expressions.aggregate can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.aggregate.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.constraints, so a change to expressions.constraints can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.constraints.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.ddl, so a change to expressions.ddl can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.ddl.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.json, so a change to expressions.json can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.json.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.properties, so a change to expressions.properties can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.properties.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.string, so a change to expressions.string can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.string.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.dml, so a change to expressions.dml can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.dml.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
parsers.snowflake uses expressions.query, so a change to expressions.query can break parsers.snowflake, while a change to parsers.snowflake can't break expressions.query.
Position
Below the diagonal: parsers.snowflake uses a module listed above it, which is the healthy direction.
sqlglot uses expressions.functions, so a change to expressions.functions can break sqlglot, while a change to sqlglot can't break expressions.functions.
Position
Below the diagonal: sqlglot uses a module listed above it, which is the healthy direction.
sqlglot uses optimizer.annotate_types, so a change to optimizer.annotate_types can break sqlglot, while a change to sqlglot can't break optimizer.annotate_types.
Position
Below the diagonal: sqlglot uses a module listed above it, which is the healthy direction.
dialects uses expressions.aggregate, so a change to expressions.aggregate can break dialects, while a change to dialects can't break expressions.aggregate.
Position
Below the diagonal: dialects uses a module listed above it, which is the healthy direction.
dialects uses expressions.constraints, so a change to expressions.constraints can break dialects, while a change to dialects can't break expressions.constraints.
Position
Below the diagonal: dialects uses a module listed above it, which is the healthy direction.
dialects uses expressions.functions, so a change to expressions.functions can break dialects, while a change to dialects can't break expressions.functions.
Position
Below the diagonal: dialects uses a module listed above it, which is the healthy direction.
dialects uses expressions.properties, so a change to expressions.properties can break dialects, while a change to dialects can't break expressions.properties.
Position
Below the diagonal: dialects uses a module listed above it, which is the healthy direction.
dialects uses expressions.temporal, so a change to expressions.temporal can break dialects, while a change to dialects can't break expressions.temporal.
Position
Below the diagonal: dialects uses a module listed above it, which is the healthy direction.
generators uses expressions.datatypes, so a change to expressions.datatypes can break generators, while a change to generators can't break expressions.datatypes.
Position
Below the diagonal: generators uses a module listed above it, which is the healthy direction.
generators uses expressions.aggregate, so a change to expressions.aggregate can break generators, while a change to generators can't break expressions.aggregate.
Position
Below the diagonal: generators uses a module listed above it, which is the healthy direction.
generators uses expressions.functions, so a change to expressions.functions can break generators, while a change to generators can't break expressions.functions.
Position
Below the diagonal: generators uses a module listed above it, which is the healthy direction.
generators uses expressions.properties, so a change to expressions.properties can break generators, while a change to generators can't break expressions.properties.
Position
Below the diagonal: generators uses a module listed above it, which is the healthy direction.
generators uses expressions.string, so a change to expressions.string can break generators, while a change to generators can't break expressions.string.
Position
Below the diagonal: generators uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in generators uses a type in expressions.temporal. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
generators uses expressions.temporal, so a change to expressions.temporal can break generators, while a change to generators can't break expressions.temporal.
Position
Below the diagonal: generators uses a module listed above it, which is the healthy direction.
generators.redshift uses expressions.datatypes, so a change to expressions.datatypes can break generators.redshift, while a change to generators.redshift can't break expressions.datatypes.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.redshift uses expressions.core, so a change to expressions.core can break generators.redshift, while a change to generators.redshift can't break expressions.core.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.redshift uses expressions.aggregate, so a change to expressions.aggregate can break generators.redshift, while a change to generators.redshift can't break expressions.aggregate.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.redshift uses expressions.ddl, so a change to expressions.ddl can break generators.redshift, while a change to generators.redshift can't break expressions.ddl.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.redshift uses expressions.functions, so a change to expressions.functions can break generators.redshift, while a change to generators.redshift can't break expressions.functions.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.redshift uses expressions.temporal, so a change to expressions.temporal can break generators.redshift, while a change to generators.redshift can't break expressions.temporal.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.redshift uses expressions.query, so a change to expressions.query can break generators.redshift, while a change to generators.redshift can't break expressions.query.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.redshift uses generators.postgres, so a change to generators.postgres can break generators.redshift, while a change to generators.redshift can't break generators.postgres.
Position
Below the diagonal: generators.redshift uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.datatypes, so a change to expressions.datatypes can break generators.singlestore, while a change to generators.singlestore can't break expressions.datatypes.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.core, so a change to expressions.core can break generators.singlestore, while a change to generators.singlestore can't break expressions.core.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.constraints, so a change to expressions.constraints can break generators.singlestore, while a change to generators.singlestore can't break expressions.constraints.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.ddl, so a change to expressions.ddl can break generators.singlestore, while a change to generators.singlestore can't break expressions.ddl.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.functions, so a change to expressions.functions can break generators.singlestore, while a change to generators.singlestore can't break expressions.functions.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.json, so a change to expressions.json can break generators.singlestore, while a change to generators.singlestore can't break expressions.json.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.string, so a change to expressions.string can break generators.singlestore, while a change to generators.singlestore can't break expressions.string.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.temporal, so a change to expressions.temporal can break generators.singlestore, while a change to generators.singlestore can't break expressions.temporal.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses expressions.query, so a change to expressions.query can break generators.singlestore, while a change to generators.singlestore can't break expressions.query.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
generators.singlestore uses generators.mysql, so a change to generators.mysql can break generators.singlestore, while a change to generators.singlestore can't break generators.mysql.
Position
Below the diagonal: generators.singlestore uses a module listed above it, which is the healthy direction.
optimizer uses expressions.datatypes, so a change to expressions.datatypes can break optimizer, while a change to optimizer can't break expressions.datatypes.
Position
Below the diagonal: optimizer uses a module listed above it, which is the healthy direction.
optimizer uses expressions.temporal, so a change to expressions.temporal can break optimizer, while a change to optimizer can't break expressions.temporal.
Position
Below the diagonal: optimizer uses a module listed above it, which is the healthy direction.
optimizer uses optimizer.annotate_types, so a change to optimizer.annotate_types can break optimizer, while a change to optimizer can't break optimizer.annotate_types.
Position
Below the diagonal: optimizer uses a module listed above it, which is the healthy direction.
parsers uses expressions.datatypes, so a change to expressions.datatypes can break parsers, while a change to parsers can't break expressions.datatypes.
Position
Below the diagonal: parsers uses a module listed above it, which is the healthy direction.
parsers uses expressions.aggregate, so a change to expressions.aggregate can break parsers, while a change to parsers can't break expressions.aggregate.
Position
Below the diagonal: parsers uses a module listed above it, which is the healthy direction.
parsers uses expressions.functions, so a change to expressions.functions can break parsers, while a change to parsers can't break expressions.functions.
Position
Below the diagonal: parsers uses a module listed above it, which is the healthy direction.
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
32
High / Critical
A03:2025 — Software Supply Chain Failures
9
Medium
Roadmap
Top priorities: Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED; Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2); Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED.
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
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.
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 — 31
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 — 535
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 — 60
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 13
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 45 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 — 45 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, 616 of 626 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.
D12 Dependency Hygiene — 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. Not scored — 0 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and the index lookup answered not published for every exact pin asked about (0 lookup(s)), so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — 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. Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Python pyproject.toml/requirements.txt (pip/uv/Poetry)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (pyproject.toml), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
C1 Data Protection — 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
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, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Python 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, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Python 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.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
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 reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, 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.
X18 Disposal-pattern correctness — 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 JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP, Rust and Elixir source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP, Rust or Elixir was found in this repository, 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.
X29 Per-element action decided by a fixed element — 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 JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, 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.
X5 Nullable reference types — 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 MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Python 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.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
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.
D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
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").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
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.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
115 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was unnest_subqueries.decorrelate at 101. A further 1 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 Parser._parse_alter_table_set at 17 — they are counted neither in the figure above nor in this dimension's score.
+ 110 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 8 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with unnest_subqueries.decorrelate (cyclomatic 101), canonicalize_internal_names.canonicalize_internal_names (cyclomatic 85), Parser._parse_types (cyclomatic 78). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cyclomatic Complexity from 5.2 to about 6.0/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.
+ 207 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 23 bodies over 60 down to 60 or less in Cognitive Complexity — start with canonicalize_internal_names.canonicalize_internal_names (cognitive 237), qualify_columns._expand_stars (cognitive 171), Simplifier._simplify_comparison (cognitive 164). — 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 23 together lifts Cognitive Complexity from 2.0 to about 4.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; 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.3 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 26 FileTooLong finding(s) in God Classes — start with snowflake.py (2), clickhouse.py (2), bigquery.py (2). — One of this dimension's main actionable groups (26 warning-level).
Resolve the 12 TooManyMethods finding(s) in God Classes — start with core.py (2), snowflake.py (2), clickhouse.py (2). — One of this dimension's main actionable groups (12 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.
16 duplicated block group(s) detected. 1.5 % of the production lines (1,134 of 73,305) are in a reported copy. A further 37 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
Edited copy of a member (8 corresponding lines) · ×4sqlglot/parser.py:145
Edited copy of a member (4 corresponding lines) · ×4sqlglot/generators/duckdb.py:1511
Edited copy of a member (10 corresponding lines) · ×3sqlglot/generators/hive.py:600
Edited copy of a member (2 corresponding lines) · ×3sqlglot/parsers/exasol.py:20
+ 30 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 Edited copy of a member (8 corresponding lines) finding(s) in Code Duplication — start with parser.py (2), snowflake.py (2). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 4 Edited copy of a member (4 corresponding lines) finding(s) in Code Duplication — start with duckdb.py, generator.py, parser.py. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 Edited copy of a member (10 corresponding lines) finding(s) in Code Duplication — start with presto.py (2), hive.py. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d4_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 9 Low cohesion finding(s) in Cohesion (LCOM4) — start with duckdb.py, snowflake.py, clickhouse.py. — One of this dimension's main actionable groups (9 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 85.2% — 23 file(s) below 50%. Measured from the Python suite (repository root: `coverage run -m pytest`, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it.
Resolve the 23 Low coverage finding(s) in Code Coverage — start with python.py (2), compare.py, optimize.py. — One of this dimension's main actionable groups (23 warning-level).
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
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: 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: sqlglot/parser.py (102×78=7956); sqlglot/optimizer/unnest_subqueries.py (24×101=2424); sqlglot/optimizer/qualify_columns.py (32×71=2272) Repeated repair below the complexity floor: sqlglot/generators/sqlite.py (23 of 26 changes were fixes); sqlglot/generators/clickhouse.py (22 of 25 changes were fixes); sqlglot/generators/postgres.py (19 of 19 changes were fixes)
Resolve the 40 Repeated repair finding(s) in Churn × Complexity Hotspots — start with clickhouse.py (3), oracle.py (3), sqlite.py (2). — One of this dimension's main actionable groups (40 warning-level).
Resolve the 21 Hotspot finding(s) in Churn × Complexity Hotspots — start with bigquery.py (2), parser.py, unnest_subqueries.py. — One of this dimension's main actionable groups (21 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 Factor9.9 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
1 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is REDACTED. Counted over 131 of the 191 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
✓ On the Gold path — maintain.
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.
15 deducted task-comment markers across 73305 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 15 TodoComment finding(s) in Explicit Debt — start with annotate_types.py (5), qualify_columns.py (3), test_duckdb.py. — One of this dimension's main actionable groups (15 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 2 build units (Python) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionpyproject.toml:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with pyproject.toml. — 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.
Do you agree with this assessment?
D27 · Navigability7.1 / 10Strong✓ Tool-verified
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
88 % of calls cross a namespace and 0 % go through an interface, but 34 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.
Scattered collaborators
What to do
Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d27_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).
32 finding(s): 0 critical, 31 high, 1 medium, 0 low. 25 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 1 file(s) — `.github/scripts/integration_tests_sync.sh` (line 102) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 25 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (25 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 131 of the 191 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 2 Change coupling finding(s) in Change Coupling — start with oracle.py, trino.py. — 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 anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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.
No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 4 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:6
`sqlglotc/pyproject.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — sqlglotc/pyproject.toml:9
What to do
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
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.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release. — REDACTED:82
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
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.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document4.3 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`convert` is public and takes `value: t.Any` from its caller, and it calls itself at line 2498 (`convert`) with a piece of `value` (and at line 2502, line 2508, line 2509, line 2516) — and nowhere in `convert` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `convert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sqlglot/expressions/core.py:2498
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — sqlglot/generators/duckdb.py:1435, sqlglot/expressions/core.py:1777
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`warning` at line 342 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — sqlglot/lineage.py:342
`warning` at line 2368 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — sqlglot/parser.py:2368
`warning` at line 835 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — sqlglot/optimizer/annotate_types.py:835
`info` at line 45 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — sqlglot/optimizer/normalize.py:45
`warning` at line 1342 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — sqlglot/dialects/dialect.py:1342
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 68 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 Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~64639 lines of test source are present (.py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D12 Dependency Hygiene — Not scored — 0 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and the index lookup answered not published for every exact pin asked about (0 lookup(s)), so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — Package manifest not parsed for licence data — analyzer language-coverage gap
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 2 candidate(s) found and not reported.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
D5 Coupling — Not applicable — this Python build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
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
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (7 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
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, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — 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 Python source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 190 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
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.
PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — 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
X18 Disposal-pattern correctness — 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
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
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.
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — 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
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.
X5 Nullable reference types — 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
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Repeated repair: sqlglot/generators/sqlite.py sqlglot/generators/sqlite.py:23— sqlglot/generators/sqlite.py changed 26 times in last 90 days and 23 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 sqlite._transform_create at line 23), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sqlite): preserve fractional seconds in strftime formats (#9178)”; “fix(sqlite): preserve integer RANDOM semantics in DuckDB (#9177)”; “fix(sqlite): use DATETIME for sub-day DATE_ADD/DATE_SUB units (#9155)”; “fix(sqlite): translate week date arithmetic to days [CODEX] (#9168)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/sqlite.py`: 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: sqlglot/generators/clickhouse.py sqlglot/generators/clickhouse.py:575— sqlglot/generators/clickhouse.py changed 25 times in last 90 days and 22 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 ClickHouseGenerator.regexpcount_sql at line 575), 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(clickhouse)!: treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] (#9156)”; “fix(clickhouse): map formatDateTime specifiers that differ from strftime”; “fix(oracle): keep VARIANCE and VAR_SAMP apart (#9075)”; “fix(clickhouse): preserve logical aggregate null and numeric semantics”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/clickhouse.py`: 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: sqlglot/generators/postgres.py sqlglot/generators/postgres.py:105— sqlglot/generators/postgres.py changed 19 times in last 90 days and 19 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 postgres._date_diff_sql at line 105), 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(postgres): generate CARDINALITY for ArraySize without a dimension [CLAUDE] (#9157)”; “fix(generator): concatenate CHR calls for multi-argument CHAR (#9119)”; “fix(oracle): keep VARIANCE and VAR_SAMP apart (#9075)”; “fix(postgres): parse CONVERT as charset conversion (#9024)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/postgres.py`: 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: sqlglot/parsers/sqlite.py sqlglot/parsers/sqlite.py:207— sqlglot/parsers/sqlite.py changed 20 times in last 90 days and 18 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 SQLiteParser._parse_factor_operand at line 207), 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(sqlite): preserve character length across dialects (#9183)”; “fix(sqlite): preserve NUL-terminated LENGTH in DuckDB (#9182)”; “fix(sqlite): preserve fractional seconds in strftime formats (#9178)”; “fix(sqlite): preserve integer RANDOM semantics in DuckDB (#9177)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/sqlite.py`: 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: sqlglot/parsers/snowflake.py sqlglot/parsers/snowflake.py:1247— sqlglot/parsers/snowflake.py changed 20 times in last 90 days and 14 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 SnowflakeParser._parse_show_snowflake at line 1247), 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(sqlite): preserve integer RANDOM semantics in DuckDB (#9177)”; “fix: stop walking into udtf for walk_in_scope (#9099)”; “fix(snowflake): resolve 'e' flag capture group default in REGEXP_SUBSTR / REGEXP_SUBSTR_ALL (#8961)”; “fix(duckdb): preserve Snowflake and BigQuery regex extraction semantics”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/snowflake.py`: 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: sqlglot/parsers/clickhouse.py sqlglot/parsers/clickhouse.py:882— sqlglot/parsers/clickhouse.py changed 20 times in last 90 days and 14 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 ClickHouseParser._parse_auto_refresh_property at line 882), 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(clickhouse)!: treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] (#9156)”; “fix(clickhouse): raise ParseError for empty XOR calls [CODEX] (#9106)”; “fix(clickhouse): generate array sorts and logical aggregates (#9072)”; “fix(parser)!: respect dialect `INTERSECT` precedence in set operations (#8704)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/clickhouse.py`: 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: sqlglot/parsers/duckdb.py sqlglot/parsers/duckdb.py:441— sqlglot/parsers/duckdb.py changed 19 times in last 90 days and 13 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 DuckDBParser._parse_join at line 441), 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(duckdb): distinguish printf and brace formatting [CODEX] (#9176)”; “fix(parser): distinguish conditionless JOIN from comma joins (#9076)”; “fix: preserve TRUNC calendar semantics across dialects (#9021)”; “fix(parser): support TABLE query shorthand (#8897)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/duckdb.py`: 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: sqlglot/parsers/postgres.py sqlglot/parsers/postgres.py:68— sqlglot/parsers/postgres.py changed 15 times in last 90 days and 13 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 postgres._build_regexp_replace at line 68), 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(postgres): preserve generate_series step semantics [CODEX] (#9023)”; “fix(postgres): parse CONVERT as charset conversion (#9024)”; “fix(postgres): avoid duplicate function parameter modes (#9020)”; “fix(parser): support TABLE query shorthand (#8897)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/postgres.py`: 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: sqlglot/generators/oracle.py sqlglot/generators/oracle.py:153— sqlglot/generators/oracle.py changed 14 times in last 90 days and 13 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 OracleGenerator.version_sql at line 153), 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(generator): concatenate CHR calls for multi-argument CHAR (#9119)”; “fix(oracle): preserve variance semantics for windows and empty inputs”; “fix(oracle): keep VARIANCE and VAR_SAMP apart (#9075)”; “fix(oracle): eliminate SEMI/ANTI joins, map VAR_POP and APPROX_COUNT_DISTINCT (#9067)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/oracle.py`: 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: sqlglot/generators/teradata.py sqlglot/generators/teradata.py:143— sqlglot/generators/teradata.py changed 17 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is TeradataGenerator.tablesample_sql at line 143), 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(teradata): generate native DAYOFWEEK [CODEX] (#9064)”; “fix(teradata): omit empty parentheses from CURRENT_TIME [CODEX] (#9050)”; “fix: preserve TRUNC calendar semantics across dialects (#9021)”; “fix(teradata): preserve BYTEINT type identity [CODEX] (#9030)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/teradata.py`: 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: sqlglot/parsers/oracle.py sqlglot/parsers/oracle.py:215— sqlglot/parsers/oracle.py changed 11 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 4 (its worst body is OracleParser._parse_to_number at line 215), 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(oracle): keep VARIANCE and VAR_SAMP apart (#9075)”; “fix: preserve TRUNC calendar semantics across dialects (#9021)”; “fix(oracle): preserve nlsparam in TO_DATE and TO_TIMESTAMP [CLAUDE] (#8874)”; “fix(oracle): preserve end of month in ADD_MONTHS closes #8824 [CLAUDE] (#8825)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/oracle.py`: 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: sqlglot/parsers/starrocks.py sqlglot/parsers/starrocks.py:100— sqlglot/parsers/starrocks.py changed 14 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 10 (its worst body is StarRocksParser._parse_pivot at line 100), 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(duckdb): align Snowflake TIME_SLICE transpilation to epoch origin (#8899)”; “fix(starrocks): infer static pivot output columns [CODEX] (#8689)”; “fix(starrocks): parse map{...} literals as maps [CLAUDE] (#8682)”; “fix(starrocks): don't default column names for multi-array UNNEST [CLAUDE] (#8671)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/starrocks.py`: 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: sqlglot/generators/presto.py sqlglot/generators/presto.py:239— sqlglot/generators/presto.py changed 12 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is presto.amend_exploded_column_table at line 239), 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: stop walking into udtf for walk_in_scope (#9099)”; “fix(generator): keep the lambda of Spark's EXISTS(array, lambda) (#9140)”; “fix(duckdb): keep NULL and empty arrays for LATERAL VIEW OUTER as LEFT JOIN UNNEST [CLAUDE] (#9091)”; “fix(generator): concatenate CHR calls for multi-argument CHAR (#9119)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/presto.py`: 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: sqlglot/generators/spark2.py sqlglot/generators/spark2.py:265— sqlglot/generators/spark2.py changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Spark2Generator.cast_sql at line 265), 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(duckdb): distinguish printf and brace formatting [CODEX] (#9176)”; “fix(hive): handle MILLISECOND and MICROSECOND in DATEADD (#9161)”; “fix(clickhouse)!: treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] (#9156)”; “fix(hive): preserve sub-day DATEADD units in Hive and Spark [CODEX] (#9085)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/spark2.py`: 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: sqlglot/parsers/spark2.py sqlglot/parsers/spark2.py:21— sqlglot/parsers/spark2.py changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is spark2.build_int_div at line 21), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(parser): gate multi-part interval addition behind dialect setting (#9057)”; “fix(mysql, spark): return an empty string for a negative LEFT/RIGHT length in DuckDB [CLAUDE] (#8967)”; “fix(spark): preserve CREATE TABLE data source options (#8919)”; “fix(parser)!: respect dialect precedence of IS predicates (#8676)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/spark2.py`: 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: sqlglot/optimizer/eliminate_joins.py sqlglot/optimizer/eliminate_joins.py:160— sqlglot/optimizer/eliminate_joins.py 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 14 (its worst body is eliminate_joins.join_condition 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(optimizer): keep LEFT JOINs onto UNION ALL derived tables in eliminate_joins [CLAUDE] (#9092)”; “fix(optimizer): preserve single-row joins with USING, NATURAL, or outer sides [GEMINI] (#9053)”; “fix(optimizer): preserve filters around special joins (#9040)”; “fix(optimizer): preserve left joins with casted keys [CODEX] (#8859)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/eliminate_joins.py`: 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: sqlglot/dialects/duckdb.py sqlglot/dialects/duckdb.py:70— sqlglot/dialects/duckdb.py 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 4 (its worst body is DuckDB.column_alias_precedence at line 70), 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(optimizer): preserve source bindings in ORDER BY expressions [CODEX] (#8951)”; “fix(optimizer)!: respect input column precedence in HAVING and QUALIFY (#8898)”; “fix(duckdb): prevent SORT BY tokenization”; “fix(optimizer): annotate struct-valued subqueries and row references (#8694)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/dialects/duckdb.py`: 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: sqlglot/tokens.py sqlglot/tokens.py:84— sqlglot/tokens.py 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 8 (its worst body is _TokenizerBase.__init_subclass__ at line 84), 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(tokenizer): parse SAVEPOINT and RELEASE as commands (#8920)”; “fix(oracle): expand alternative quoting and support national literals (#8606)”; “fix!: correct PostgreSQL, DuckDB, Redshift, and ClickHouse string escapes (#8484)”; “fix(bigquery)!: decode string escapes and preserve byte literals (#8479)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/tokens.py`: 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: sqlglot/generators/starrocks.py sqlglot/generators/starrocks.py:323— sqlglot/generators/starrocks.py 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 6 (its worst body is StarRocksGenerator.create_sql at line 323), 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(starrocks): parse map{...} literals as maps [CLAUDE] (#8682)”; “fix(starrocks): generate PIVOT instead of dropping it [CLAUDE] (#8679)”; “fix(starrocks): keep DATEDIFF's date-part semantics [CLAUDE] (#8636)”; “fix(mysql): Misplaced table and index options. (#8553)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/starrocks.py`: 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: sqlglot/generators/hive.py sqlglot/generators/hive.py:525— sqlglot/generators/hive.py changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is HiveGenerator.datatype_sql at line 525), 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(hive): preserve sub-day DATEADD units in Hive and Spark [CODEX] (#9085)”; “fix(generator): concatenate CHR calls for multi-argument CHAR (#9119)”; “fix(generator): prevent SELECT_KINDS leaks in compiled builds (#9026)”; “fix(databricks): preserve timestamp precision during SQL generation”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/hive.py`: 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: sqlglot/parsers/tsql.py sqlglot/parsers/tsql.py:692— sqlglot/parsers/tsql.py changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is TSQLParser._parse_user_defined_function at line 692), 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(clickhouse)!: treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] (#9156)”; “fix(tsql): treat `output` as a valid identifier closes #8545”; “fix(tsql): parse bare table hints [CODEX: GPT-6.1 Sol] (#8493)”; “fix!: preserve pagination scope in set operations (#8385)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/tsql.py`: 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: sqlglot/generators/redshift.py sqlglot/generators/redshift.py:334— sqlglot/generators/redshift.py changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is RedshiftGenerator.unnest_sql at line 334), 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(postgres): generate CARDINALITY for ArraySize without a dimension [CLAUDE] (#9157)”; “fix(redshift): preserve date unit expressions”; “fix(redshift): drop DISTKEY/SORTKEY/DISTSTYLE when generating other dialects (#8938)”; “fix!: truncate integer division towards zero instead of rounding (#8532)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/redshift.py`: 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: sqlglot/dialects/oracle.py sqlglot/dialects/oracle.py:57— sqlglot/dialects/oracle.py changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is Oracle.can_quote at line 57), 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: preserve TRUNC calendar semantics across dialects (#9021)”; “fix(parser)!: respect dialect `INTERSECT` precedence in set operations (#8704)”; “fix(oracle): map ISO week-numbering year IYYY to %G [CLAUDE] (#8675)”; “fix(oracle): expand alternative quoting and support national literals (#8606)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/dialects/oracle.py`: 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: sqlglot/parsers/presto.py sqlglot/parsers/presto.py:62— sqlglot/parsers/presto.py changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is presto._build_format_datetime at line 62), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(clickhouse)!: treat SHA1/SHA256/SHA512 as binary digests [CLAUDE] (#9156)”; “fix(bigquery): cast zoneless Presto/Trino AT TIME ZONE operand to TIMESTAMP (#9097)”; “fix(presto): mark the third SLICE argument as a length [CLAUDE] (#9087)”; “fix(presto): preserve DATE_TRUNC input type when transpiling to DuckDB (#8945)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/presto.py`: 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: sqlglot/optimizer/optimize_joins.py sqlglot/optimizer/optimize_joins.py:10— sqlglot/optimizer/optimize_joins.py changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is optimize_joins.optimize_joins at line 10), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(optimizer): retain conditional CROSS JOIN predicates [CODEX] (#9149)”; “fix(parser): distinguish conditionless JOIN from comma joins (#9076)”; “fix(optimizer): preserve filters around special joins (#9040)”; “fix(optimizer): preserve positional joins during optimization (#9042)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/optimize_joins.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FileTooLong: sqlglot/parser.py sqlglot/parser.py— FileTooLong — 8008 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7508 over it, 16.02× 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: sqlglot/generator.py sqlglot/generator.py— FileTooLong — 5035 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4535 over it, 10.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: expressions/core.py sqlglot/expressions/core.py— FileTooLong — 1855 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1355 over it, 3.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: dialects/dialect.py sqlglot/dialects/dialect.py— FileTooLong — 1700 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1200 over it, 3.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: optimizer/simplify.py sqlglot/optimizer/simplify.py— FileTooLong — 1359 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 859 over it, 2.72× 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: expressions/query.py sqlglot/expressions/query.py— FileTooLong — 1328 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 828 over it, 2.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: sqlglot/tokenizer_core.py sqlglot/tokenizer_core.py— FileTooLong — 1219 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 719 over it, 2.44× 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: generators/duckdb.py sqlglot/generators/duckdb.py— FileTooLong — 1194 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 694 over it, 2.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: parsers/snowflake.py sqlglot/parsers/snowflake.py— FileTooLong — 1092 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 592 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: optimizer/qualify_columns.py sqlglot/optimizer/qualify_columns.py— FileTooLong — 1089 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 589 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: generators/snowflake.py sqlglot/generators/snowflake.py— FileTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 368 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: optimizer/annotate_types.py sqlglot/optimizer/annotate_types.py— FileTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 344 over it, 1.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: optimizer/scope.py sqlglot/optimizer/scope.py— FileTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 207 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sqlglot/transforms.py sqlglot/transforms.py— FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: parsers/clickhouse.py sqlglot/parsers/clickhouse.py— FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 159 over it, 1.32× 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: generators/bigquery.py sqlglot/generators/bigquery.py— FileTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 151 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: parsers/mysql.py sqlglot/parsers/mysql.py— FileTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 121 over it, 1.24× 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: parsers/tsql.py sqlglot/parsers/tsql.py— FileTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 121 over it, 1.24× 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: generators/clickhouse.py sqlglot/generators/clickhouse.py— FileTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 112 over it, 1.22× 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: generators/tsql.py sqlglot/generators/tsql.py— FileTooLong — 578 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 78 over it, 1.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: parsers/bigquery.py sqlglot/parsers/bigquery.py— FileTooLong — 568 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 68 over it, 1.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: expressions/builders.py sqlglot/expressions/builders.py— FileTooLong — 559 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 59 over it, 1.12× 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: sqlglot/tokens.py sqlglot/tokens.py— FileTooLong — 545 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 45 over it, 1.09× 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: optimizer/merge_subqueries.py sqlglot/optimizer/merge_subqueries.py— FileTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 43 over it, 1.09× 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: generators/postgres.py sqlglot/generators/postgres.py— FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 18 over it, 1.04× 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.
Hotspot: sqlglot/parser.py sqlglot/parser.py:6854— sqlglot/parser.py changed 102 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in Parser._parse_types at line 6854. 73 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parser.py`: 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: sqlglot/optimizer/unnest_subqueries.py sqlglot/optimizer/unnest_subqueries.py:225— sqlglot/optimizer/unnest_subqueries.py changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in unnest_subqueries.decorrelate at line 225. 22 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/unnest_subqueries.py`: 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: sqlglot/optimizer/qualify_columns.py sqlglot/optimizer/qualify_columns.py:1154— sqlglot/optimizer/qualify_columns.py changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in qualify_columns._expand_stars at line 1154. 25 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/qualify_columns.py`: 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: sqlglot/generator.py sqlglot/generator.py:3050— sqlglot/generator.py changed 84 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Generator.join_sql at line 3050. 55 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generator.py`: 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: sqlglot/optimizer/simplify.py sqlglot/optimizer/simplify.py:981— sqlglot/optimizer/simplify.py changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in Simplifier._simplify_comparison at line 981. 23 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/simplify.py`: 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: sqlglot/optimizer/pushdown_projections.py sqlglot/optimizer/pushdown_projections.py:86— sqlglot/optimizer/pushdown_projections.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in pushdown_projections.projection_reachability at line 86. 10 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/pushdown_projections.py`: 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: sqlglot/dialects/dialect.py sqlglot/dialects/dialect.py:306— sqlglot/dialects/dialect.py changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in _Dialect.__new__ at line 306. 34 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/dialects/dialect.py`: 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: sqlglot/tokenizer_core.py sqlglot/tokenizer_core.py:1307— sqlglot/tokenizer_core.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in TokenizerCore._extract_string at line 1307. 10 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/tokenizer_core.py`: 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: sqlglot/optimizer/annotate_types.py sqlglot/optimizer/annotate_types.py:447— sqlglot/optimizer/annotate_types.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in TypeAnnotator.annotate_expression at line 447. 10 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/annotate_types.py`: 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: sqlglot/optimizer/resolver.py sqlglot/optimizer/resolver.py:206— sqlglot/optimizer/resolver.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in Resolver.get_source_columns at line 206. 10 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/resolver.py`: 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: sqlglot/optimizer/merge_subqueries.py sqlglot/optimizer/merge_subqueries.py:244— sqlglot/optimizer/merge_subqueries.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in merge_subqueries._mergeable at line 244. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/merge_subqueries.py`: 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: sqlglot/optimizer/scope.py sqlglot/optimizer/scope.py:184— sqlglot/optimizer/scope.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in Scope._collect at line 184. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/scope.py`: 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: sqlglot/optimizer/qualify_tables.py sqlglot/optimizer/qualify_tables.py:16— sqlglot/optimizer/qualify_tables.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in qualify_tables.qualify_tables at line 16. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/qualify_tables.py`: 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: sqlglot/generators/bigquery.py sqlglot/generators/bigquery.py:209— sqlglot/generators/bigquery.py changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in bigquery._array_agg_fold_sql at line 209. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/generators/bigquery.py`: 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: sqlglot/optimizer/canonicalize_internal_names.py sqlglot/optimizer/canonicalize_internal_names.py:13— sqlglot/optimizer/canonicalize_internal_names.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in canonicalize_internal_names.canonicalize_internal_names at line 13. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/canonicalize_internal_names.py`: 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: sqlglot/parsers/teradata.py sqlglot/parsers/teradata.py:327— sqlglot/parsers/teradata.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in TeradataParser._parse_column_ops at line 327. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/parsers/teradata.py`: 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: sqlglot/optimizer/pushdown_predicates.py sqlglot/optimizer/pushdown_predicates.py:20— sqlglot/optimizer/pushdown_predicates.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in pushdown_predicates.pushdown_predicates at line 20. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/optimizer/pushdown_predicates.py`: 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: sqlglot/planner.py sqlglot/planner.py:49— sqlglot/planner.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in Step.from_expression at line 49. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/planner.py`: 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: sqlglot/typing/bigquery.py sqlglot/typing/bigquery.py:155— sqlglot/typing/bigquery.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in bigquery._annotate_array at line 155. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/typing/bigquery.py`: 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: sqlglot/lineage.py sqlglot/lineage.py:200— sqlglot/lineage.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in lineage.to_node at line 200. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/lineage.py`: 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: sqlglot/transforms.py sqlglot/transforms.py:201— sqlglot/transforms.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in transforms.eliminate_qualify at line 201. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 20:48:55 +02:00' --until='2026-11-17 20:48:55 +02:00' --full-history --no-merges -- sqlglot/transforms.py`: 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.
TodoComment tests/dialects/test_duckdb.py:2275— # TODO: This is incorrect AST, DATE_PART creates a STRUCT of values but it's stored in 'year' arg — 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 sqlglot/generator.py:622— # TODO: The normalization should be done by default once we've tested it across all dialects. — 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 sqlglot/parsers/clickhouse.py:596— # TODO: can we somehow convert the former into an equivalent `regexpExtract` call? — 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 sqlglot/parsers/prql.py:119— # TODO: TAKE for ranges a..b — 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 sqlglot/optimizer/annotate_types.py:23— # TODO (mypyc): should be -> exp.DType but some coercion lambdas return DataType — 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 sqlglot/optimizer/annotate_types.py:240— # TODO (mypyc): should be expression: E -> E but mypyc resolves the TypeVar — 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 sqlglot/optimizer/annotate_types.py:248— # TODO (mypyc): expression.type = ... should work but mypyc compiles the property — 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 sqlglot/optimizer/annotate_types.py:277— # TODO (mypyc): uses list() + _set_type instead of direct expr.type = ... because — 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 sqlglot/optimizer/annotate_types.py:842— # TODO (mypyc): should be isinstance(expression, (exp.Connector, exp.Predicate)) but — 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 sqlglot/optimizer/qualify_columns.py:574— # TODO (mypyc): rebind to exp.Expr to avoid Selectable trait vtable dispatch for .args — 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 sqlglot/optimizer/qualify_columns.py:676— # TODO (mypyc): use a separate variable to avoid reusing `select` (Alias) with a different type — 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 sqlglot/optimizer/qualify_columns.py:1353— # TODO (mypyc): use a separate variable to avoid reusing `tables` (list) with dict type — 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 sqlglot/optimizer/scope.py:994— # TODO (mypyc): rebind to exp.Expr to avoid DerivedTable/UDTF trait vtable dispatch — 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 sqlglot/optimizer/simplify.py:214— # TODO: create a helper that can be used to detect nested literal expressions such — 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 sqlglot/generators/tsql.py:409— # TODO: perhaps we can check if the parent is a Join and transpile it appropriately — 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.
TooManyMethods: Generator sqlglot/generator.py:92— TooManyMethods — 511 methods. The bar is 30 methods; this is 481 over it, 17.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Parser sqlglot/parser.py:363— TooManyMethods — 416 methods. The bar is 30 methods; this is 386 over it, 13.87× 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: DuckDBGenerator sqlglot/generators/duckdb.py:1596— TooManyMethods — 148 methods. The bar is 30 methods; this is 118 over it, 4.93× 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: Expression sqlglot/expressions/core.py:825— TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Expr sqlglot/expressions/core.py:53— TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TSQLGenerator sqlglot/generators/tsql.py:143— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: Gen sqlglot/optimizer/simplify.py:1710— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SnowflakeGenerator sqlglot/generators/snowflake.py:372— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× 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: ClickHouseParser sqlglot/parsers/clickhouse.py:271— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× 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: SnowflakeParser sqlglot/parsers/snowflake.py:351— 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: ClickHouseGenerator sqlglot/generators/clickhouse.py:181— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TypeAnnotator sqlglot/optimizer/annotate_types.py:160— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Low cohesion: DuckDBGenerator (LCOM4 119) sqlglot/generators/duckdb.py:1596— DuckDBGenerator's methods fall into 119 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 119 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: SnowflakeParser (LCOM4 24) sqlglot/parsers/snowflake.py:351— SnowflakeParser's methods fall into 24 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 24 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: ClickHouseGenerator (LCOM4 21) sqlglot/generators/clickhouse.py:181— ClickHouseGenerator's methods fall into 21 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 21 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: MySQLGenerator (LCOM4 20) sqlglot/generators/mysql.py:112— MySQLGenerator's methods fall into 20 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 20 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: Expression (LCOM4 19) sqlglot/expressions/core.py:825— Expression's methods fall into 19 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 19 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: HiveGenerator (LCOM4 18) sqlglot/generators/hive.py:227— HiveGenerator's methods fall into 18 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 18 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: TSQLParser (LCOM4 16) sqlglot/parsers/tsql.py:323— TSQLParser's methods fall into 16 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 16 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: BigQueryParser (LCOM4 14) sqlglot/parsers/bigquery.py:191— BigQueryParser's methods fall into 14 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 14 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: Dialect (LCOM4 4) sqlglot/dialects/dialect.py:435— Dialect'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.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×4
Edited copy of a member (8 corresponding lines) sqlglot/parser.py:145— sqlglot/parser.py:145-152 | sqlglot/parsers/spark2.py:22-31 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) sqlglot/parser.py:4670— sqlglot/parser.py:4670-4677 | sqlglot/parsers/prql.py:181-188 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) sqlglot/generators/snowflake.py:1145— sqlglot/generators/snowflake.py:1145-1156 | sqlglot/generators/databricks.py:196-203 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) sqlglot/generators/snowflake.py:55— sqlglot/generators/snowflake.py:55-62 | sqlglot/parsers/bigquery.py:44-54 — 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 copy of a member (4 corresponding lines) · ×4
Edited copy of a member (4 corresponding lines) sqlglot/generators/duckdb.py:1511— sqlglot/generators/duckdb.py:1511-1514 | sqlglot/generators/duckdb.py:1518-1521 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) sqlglot/generator.py:6409— sqlglot/generator.py:6409-6412 | sqlglot/generators/oracle.py:168-172 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) sqlglot/parser.py:10995— sqlglot/parser.py:10995-11001 | sqlglot/parsers/snowflake.py:1114-1117 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) sqlglot/dialects/dialect.py:2802— sqlglot/dialects/dialect.py:2802-2807 | sqlglot/parsers/oracle.py:30-33 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×3
Edited copy of a member (10 corresponding lines) sqlglot/generators/hive.py:600— sqlglot/generators/hive.py:600-611 | sqlglot/generators/snowflake.py:949-958 — 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) sqlglot/generators/presto.py:41— sqlglot/generators/presto.py:41-50 | sqlglot/generators/presto.py:582-591 — 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) sqlglot/parsers/presto.py:24— sqlglot/parsers/presto.py:24-35 | sqlglot/parsers/presto.py:46-55 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×3
Edited copy of a member (2 corresponding lines) sqlglot/parsers/exasol.py:20— sqlglot/parsers/exasol.py:20-21 | sqlglot/parsers/snowflake.py:184-185 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) sqlglot/parsers/exasol.py:26— sqlglot/parsers/exasol.py:26-27 | sqlglot/parsers/snowflake.py:199-200 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) sqlglot/generator.py:3030— sqlglot/generator.py:3030-3031 | sqlglot/generators/clickhouse.py:725-726 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (5 lines × 2) sqlglot/generator.py:2515— sqlglot/generator.py:2515-2519 | sqlglot/generators/tsql.py:632-636 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.Kill` in one and `exp.Transaction` 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) sqlglot/parser.py:3365— sqlglot/parser.py:3365-3369 | sqlglot/parsers/snowflake.py:1033-1037 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) sqlglot/generators/trino.py:137— sqlglot/generators/trino.py:137-141 | sqlglot/generators/trino.py:150-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.WhileBlock` in one and `exp.RepeatBlock` 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.
Change coupling: oracle.py ↔ oracle.py sqlglot/generators/oracle.py:1— `sqlglot/generators/oracle.py` and `sqlglot/parsers/oracle.py` change together 65% of the time (11 of the 17 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 11 shared commits counted here, the most recent 3 are `79716c77` fix(oracle): keep VARIANCE and VAR_SAMP apart (#9075); `8688c120` fix: preserve TRUNC calendar semantics across dialects (#9021); `49a6467d` fix(oracle): preserve nlsparam in TO_DATE and TO_TIMESTAMP [CLAUDE] (… — run `git show` on any of them.
Change coupling: trino.py ↔ trino.py sqlglot/generators/trino.py:1— `sqlglot/generators/trino.py` and `sqlglot/parsers/trino.py` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `862fd554` fix(trino): preserve precision for all temporal literals (#8564); `98157867` feat(trino): parse LOOP/REPEAT/ITERATE/LEAVE routine statements [CLAU…; `31f37511` feat(trino): parse WHILE/DO/END WHILE routine statements [CLAUDE] (#8… — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×2
Edited copy of a member (9 corresponding lines) sqlglot/parsers/snowflake.py:157— sqlglot/parsers/snowflake.py:157-165 | sqlglot/parsers/snowflake.py:170-179 — 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) sqlglot/parsers/doris.py:130— sqlglot/parsers/doris.py:130-140 | sqlglot/parsers/starrocks.py:243-251 — 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 (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) sqlglot/parsers/bigquery.py:665— sqlglot/parsers/bigquery.py:665-682 | sqlglot/parsers/bigquery.py:685-701 — 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) sqlglot/parsers/snowflake.py:1453— sqlglot/parsers/snowflake.py:1453-1469 | sqlglot/parsers/teradata.py:401-422 — 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 (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) sqlglot/expressions/dml.py:354— sqlglot/expressions/dml.py:354-381 | sqlglot/expressions/query.py:1414-1443 — 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) sqlglot/expressions/dml.py:429— sqlglot/expressions/dml.py:429-460 | sqlglot/expressions/query.py:1234-1261 — 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 (3 corresponding lines) · ×2
Edited copy of a member (3 corresponding lines) sqlglot/generator.py:3931— sqlglot/generator.py:3931-3933 | sqlglot/generators/mysql.py:871-873 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) sqlglot/generator.py:5183— sqlglot/generator.py:5183-5185 | sqlglot/generators/mysql.py:876-878 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 2) sqlglot/generators/presto.py:41— sqlglot/generators/presto.py:41-48 | sqlglot/generators/presto.py:582-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.SHA2Digest` in one and `exp.SHA2` 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) sqlglot/optimizer/merge_subqueries.py:191— sqlglot/optimizer/merge_subqueries.py:191-198 | sqlglot/optimizer/merge_subqueries.py:231-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sqlglot/optimizer/merge_subqueries.py:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) sqlglot/schema.py:457— sqlglot/schema.py:457-463 | sqlglot/schema.py:517-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) sqlglot/typing/duckdb.py:56— sqlglot/typing/duckdb.py:56-62 | sqlglot/typing/postgres.py:19-25 — 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.
Swallowed exception (empty catch) sqlglot/generators/duckdb.py:1435— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) sqlglot/expressions/core.py:1777— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
unnest_subqueries.decorrelate (cyclomatic 101) sqlglot/optimizer/unnest_subqueries.py:225— unnest_subqueries.decorrelate has cyclomatic complexity 101 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
canonicalize_internal_names.canonicalize_internal_names (cyclomatic 85) sqlglot/optimizer/canonicalize_internal_names.py:13— canonicalize_internal_names.canonicalize_internal_names has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser._parse_types (cyclomatic 78) sqlglot/parser.py:6854— Parser._parse_types has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lineage.to_node (cyclomatic 76) sqlglot/lineage.py:200— lineage.to_node has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pushdown_projections.projection_reachability (cyclomatic 74) sqlglot/optimizer/pushdown_projections.py:86— pushdown_projections.projection_reachability has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
qualify_columns._expand_stars (cyclomatic 71) sqlglot/optimizer/qualify_columns.py:1154— qualify_columns._expand_stars has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser._parse_create (cyclomatic 65) sqlglot/parser.py:2577— Parser._parse_create has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
qualify_tables.qualify_tables (cyclomatic 62) sqlglot/optimizer/qualify_tables.py:16— qualify_tables.qualify_tables has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Simplifier._simplify_comparison (cyclomatic 52) sqlglot/optimizer/simplify.py:981— Simplifier._simplify_comparison has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser._parse_table (cyclomatic 51) sqlglot/parser.py:5215— Parser._parse_table has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser._parse_select_query (cyclomatic 50) sqlglot/parser.py:4167— Parser._parse_select_query 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.
qualify_columns._expand_using (cyclomatic 45) sqlglot/optimizer/qualify_columns.py:225— qualify_columns._expand_using has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Step.from_expression (cyclomatic 45) sqlglot/planner.py:49— Step.from_expression has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Simplifier._simplify_binary (cyclomatic 44) sqlglot/optimizer/simplify.py:1306— Simplifier._simplify_binary 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.
unnest_subqueries.unnest (cyclomatic 43) sqlglot/optimizer/unnest_subqueries.py:83— unnest_subqueries.unnest 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.
TokenizerCore._extract_string (cyclomatic 40) sqlglot/tokenizer_core.py:1307— TokenizerCore._extract_string has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
qualify_columns._convert_columns_to_dots (cyclomatic 39) sqlglot/optimizer/qualify_columns.py:751— qualify_columns._convert_columns_to_dots 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.
Resolver.get_source_columns (cyclomatic 39) sqlglot/optimizer/resolver.py:206— Resolver.get_source_columns 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.
Parser._parse_join (cyclomatic 38) sqlglot/parser.py:4863— Parser._parse_join has cyclomatic complexity 38 (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.
TypeAnnotator.annotate_expression (cyclomatic 36) sqlglot/optimizer/annotate_types.py:447— TypeAnnotator.annotate_expression has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
qualify_columns._qualify_columns (cyclomatic 36) sqlglot/optimizer/qualify_columns.py:1004— qualify_columns._qualify_columns has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Generator.ordered_sql (cyclomatic 35) sqlglot/generator.py:3408— Generator.ordered_sql has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
qualify_columns._expand_alias_refs (cyclomatic 34) sqlglot/optimizer/qualify_columns.py:369— qualify_columns._expand_alias_refs has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypeAnnotator._annotate_by_args (cyclomatic 32) sqlglot/optimizer/annotate_types.py:882— TypeAnnotator._annotate_by_args has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser._parse_function_call (cyclomatic 32) sqlglot/parser.py:7603— Parser._parse_function_call has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TokenizerCore._scan_number (cyclomatic 32) sqlglot/tokenizer_core.py:976— TokenizerCore._scan_number has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Generator.create_sql (cyclomatic 30) sqlglot/generator.py:1401— Generator.create_sql has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
qualify_columns._expand_order_by_and_distinct_on (cyclomatic 28) sqlglot/optimizer/qualify_columns.py:564— qualify_columns._expand_order_by_and_distinct_on has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Scope._collect (cyclomatic 28) sqlglot/optimizer/scope.py:184— Scope._collect has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Generator.join_sql (cyclomatic 27) sqlglot/generator.py:3050— Generator.join_sql has cyclomatic complexity 27 (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.
TypeAnnotator._get_source_scope_selects (cyclomatic 27) sqlglot/optimizer/annotate_types.py:344— TypeAnnotator._get_source_scope_selects 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.
pushdown_projections.prune_projections (cyclomatic 27) sqlglot/optimizer/pushdown_projections.py:416— pushdown_projections.prune_projections 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.
merge_subqueries._mergeable (cyclomatic 26) sqlglot/optimizer/merge_subqueries.py:244— merge_subqueries._mergeable 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.
TokenizerCore._scan_numeric_escape (cyclomatic 26) sqlglot/tokenizer_core.py:1229— TokenizerCore._scan_numeric_escape 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.
Parser._parse_pivot (cyclomatic 25) sqlglot/parser.py:5651— Parser._parse_pivot 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.
Parser._parse_interval_span (cyclomatic 25) sqlglot/parser.py:6550— Parser._parse_interval_span 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.
Parser._parse_alter (cyclomatic 25) sqlglot/parser.py:9739— Parser._parse_alter 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.
bigquery._annotate_array (cyclomatic 25) sqlglot/typing/bigquery.py:155— bigquery._annotate_array 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.
Expression.__hash__ (cyclomatic 24) sqlglot/expressions/core.py:843— Expression.__hash__ 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.
Generator.alter_sql (cyclomatic 24) sqlglot/generator.py:4654— Generator.alter_sql has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
scope._traverse_tables (cyclomatic 24) sqlglot/optimizer/scope.py:946— scope._traverse_tables 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.
Parser.parse_set_operation (cyclomatic 24) sqlglot/parser.py:6152— Parser.parse_set_operation has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Parser._parse_window (cyclomatic 24) sqlglot/parser.py:9071— Parser._parse_window has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Generator.set_operations (cyclomatic 23) sqlglot/generator.py:1985— Generator.set_operations 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.
Generator.select_sql (cyclomatic 23) sqlglot/generator.py:3595— Generator.select_sql 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.
DuckDBGenerator._regexp_extract_sql (cyclomatic 23) sqlglot/generators/duckdb.py:4402— DuckDBGenerator._regexp_extract_sql has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
snowflake._qualify_unnested_columns (cyclomatic 23) sqlglot/generators/snowflake.py:242— snowflake._qualify_unnested_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.
Simplifier.absorb_and_eliminate (cyclomatic 23) sqlglot/optimizer/simplify.py:1120— Simplifier.absorb_and_eliminate 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.
Parser._parse_match_recognize (cyclomatic 23) sqlglot/parser.py:4687— Parser._parse_match_recognize 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.
MySQLParser._parse_show_mysql (cyclomatic 23) sqlglot/parsers/mysql.py:587— MySQLParser._parse_show_mysql has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
merge_subqueries._merge_expressions (cyclomatic 22) sqlglot/optimizer/merge_subqueries.py:657— merge_subqueries._merge_expressions 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.
qualify_columns._qualify_positional_column (cyclomatic 22) sqlglot/optimizer/qualify_columns.py:877— qualify_columns._qualify_positional_column 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.
Simplifier.simplify (cyclomatic 22) sqlglot/optimizer/simplify.py:672— Simplifier.simplify 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.
Parser._parse_column_ops (cyclomatic 22) sqlglot/parser.py:7397— Parser._parse_column_ops 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.
Parser._parse_column_def (cyclomatic 22) sqlglot/parser.py:7911— Parser._parse_column_def 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.
Parser._parse_alter_table_alter (cyclomatic 22) sqlglot/parser.py:9584— Parser._parse_alter_table_alter has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
pushdown_predicates.pushdown_predicates (cyclomatic 21) sqlglot/optimizer/pushdown_predicates.py:20— pushdown_predicates.pushdown_predicates has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser._parse_table_parts (cyclomatic 21) sqlglot/parser.py:5144— Parser._parse_table_parts 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.
transforms.eliminate_join_marks (cyclomatic 21) sqlglot/transforms.py:911— transforms.eliminate_join_marks has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_Dialect.__new__ (cyclomatic 20) sqlglot/dialects/dialect.py:306— _Dialect.__new__ 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.
Generator.table_sql (cyclomatic 20) sqlglot/generator.py:2594— Generator.table_sql 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.
Generator.expressions (cyclomatic 20) sqlglot/generator.py:5090— Generator.expressions 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.
Generator.when_sql (cyclomatic 20) sqlglot/generator.py:5190— Generator.when_sql 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.
duckdb.connect_by_to_recursive_cte (cyclomatic 20) sqlglot/generators/duckdb.py:734— duckdb.connect_by_to_recursive_cte 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.
TSQLGenerator.create_sql (cyclomatic 20) sqlglot/generators/tsql.py:508— TSQLGenerator.create_sql 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.
eliminate_subqueries.eliminate_subqueries (cyclomatic 20) sqlglot/optimizer/eliminate_subqueries.py:16— eliminate_subqueries.eliminate_subqueries 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.
pushdown_predicates.nodes_for_predicate (cyclomatic 20) sqlglot/optimizer/pushdown_predicates.py:251— pushdown_predicates.nodes_for_predicate 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.
Resolver.get_table (cyclomatic 20) sqlglot/optimizer/resolver.py:37— Resolver.get_table 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.
scope._traverse_scope (cyclomatic 20) sqlglot/optimizer/scope.py:725— scope._traverse_scope 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.
scope.walk_in_scope (cyclomatic 20) sqlglot/optimizer/scope.py:1082— scope.walk_in_scope has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
anonymize.anonymize (cyclomatic 19) sqlglot/anonymize.py:30— anonymize.anonymize 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.
Generator.datatype_sql (cyclomatic 19) sqlglot/generator.py:1836— Generator.datatype_sql 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.
Generator._pivot_in_value_aliases (cyclomatic 19) sqlglot/generator.py:2705— Generator._pivot_in_value_aliases 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.
qualify_columns.qualify_outputs (cyclomatic 19) sqlglot/optimizer/qualify_columns.py:1481— qualify_columns.qualify_outputs 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.
Parser._parse_range (cyclomatic 19) sqlglot/parser.py:6405— Parser._parse_range has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TokenizerCore._scan_comment (cyclomatic 19) sqlglot/tokenizer_core.py:904— TokenizerCore._scan_comment 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.
transforms.unnest_to_explode (cyclomatic 19) sqlglot/transforms.py:309— transforms.unnest_to_explode 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.
dialect.no_filter_sql (cyclomatic 18) sqlglot/dialects/dialect.py:1539— dialect.no_filter_sql 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.
core.convert (cyclomatic 18) sqlglot/expressions/core.py:2436— core.convert 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.
core._to_s (cyclomatic 18) sqlglot/expressions/core.py:2645— core._to_s 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.
Generator.insert_sql (cyclomatic 18) sqlglot/generator.py:2464— Generator.insert_sql 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.
bigquery._array_agg_fold_sql (cyclomatic 18) sqlglot/generators/bigquery.py:209— bigquery._array_agg_fold_sql 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.
exasol._qualify_unscoped_star (cyclomatic 18) sqlglot/generators/exasol.py:153— exasol._qualify_unscoped_star 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.
Simplifier.simplify_datetrunc (cyclomatic 18) sqlglot/optimizer/simplify.py:1558— Simplifier.simplify_datetrunc 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.
Parser._parse_drop (cyclomatic 18) sqlglot/parser.py:2498— Parser._parse_drop 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.
Parser._parse_query_modifiers (cyclomatic 18) sqlglot/parser.py:4546— Parser._parse_query_modifiers 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.
Parser._parse_table_parts_fast (cyclomatic 18) sqlglot/parser.py:5078— Parser._parse_table_parts_fast 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.
Parser._parse_set_operations (cyclomatic 18) sqlglot/parser.py:6237— Parser._parse_set_operations 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.
Parser._parse_column_parts_fast (cyclomatic 18) sqlglot/parser.py:7230— Parser._parse_column_parts_fast 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.
ChangeDistiller._generate_edit_script (cyclomatic 17) sqlglot/diff.py:202— ChangeDistiller._generate_edit_script 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.
env.cast (cyclomatic 17) sqlglot/executor/env.py:149— env.cast 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.
PythonExecutor.set_operation (cyclomatic 17) sqlglot/executor/python.py:518— PythonExecutor.set_operation 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.
Generator.values_sql (cyclomatic 17) sqlglot/generator.py:2893— Generator.values_sql 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.
Generator.window_sql (cyclomatic 17) sqlglot/generator.py:3769— Generator.window_sql 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.
Generator.interval_sql (cyclomatic 17) sqlglot/generator.py:4271— Generator.interval_sql 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.
MySQLGenerator.show_sql (cyclomatic 17) sqlglot/generators/mysql.py:725— MySQLGenerator.show_sql has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TSQLGenerator.set_operations (cyclomatic 17) sqlglot/generators/tsql.py:324— TSQLGenerator.set_operations 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.
Parser._parse_insert (cyclomatic 17) sqlglot/parser.py:3735— Parser._parse_insert 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.
Parser._parse_table_sample (cyclomatic 17) sqlglot/parser.py:5494— Parser._parse_table_sample has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Parser._parse_colon_as_variant_extract (cyclomatic 17) sqlglot/parser.py:7337— Parser._parse_colon_as_variant_extract 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.
Parser._parse_cast (cyclomatic 17) sqlglot/parser.py:8561— Parser._parse_cast 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.
Parser._parse_analyze (cyclomatic 17) sqlglot/parser.py:9825— Parser._parse_analyze has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BigQueryParser._parse_table_parts (cyclomatic 17) sqlglot/parsers/bigquery.py:457— BigQueryParser._parse_table_parts 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.
serde.dump (cyclomatic 17) sqlglot/serde.py:23— serde.dump 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.
TokenizerCore._scan_keywords (cyclomatic 17) sqlglot/tokenizer_core.py:843— TokenizerCore._scan_keywords 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.
transforms.eliminate_qualify (cyclomatic 17) sqlglot/transforms.py:201— transforms.eliminate_qualify 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.
dialect.build_trunc (cyclomatic 16) sqlglot/dialects/dialect.py:2201— dialect.build_trunc 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.
Pivot.output_columns (cyclomatic 16) sqlglot/expressions/query.py:1863— Pivot.output_columns 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.
Generator.drop_sql (cyclomatic 16) sqlglot/generator.py:1927— Generator.drop_sql has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DuckDBGenerator.regexpreplace_sql (cyclomatic 16) sqlglot/generators/duckdb.py:3549— DuckDBGenerator.regexpreplace_sql has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
simplify.simplify_parens (cyclomatic 16) sqlglot/optimizer/simplify.py:145— simplify.simplify_parens 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.
simplify.datetime_floor (cyclomatic 16) sqlglot/optimizer/simplify.py:515— simplify.datetime_floor has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Parser._parse_type (cyclomatic 16) sqlglot/parser.py:6771— Parser._parse_type 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: Parser._parse_alter_table_set (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
TeradataParser._parse_column_ops (cyclomatic 16) sqlglot/parsers/teradata.py:327— TeradataParser._parse_column_ops 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.
TokenizerCore._scan_string (cyclomatic 16) sqlglot/tokenizer_core.py:1104— TokenizerCore._scan_string 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.
canonicalize_internal_names.canonicalize_internal_names (cognitive 237) sqlglot/optimizer/canonicalize_internal_names.py:13— canonicalize_internal_names.canonicalize_internal_names has cognitive complexity 237 (threshold 15). Drivers by points: if/else 47 (162 pts), loops 17 (47 pts), boolean chains 16, ternaries 3 (12 pts) (nesting depth added 154). 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.
qualify_columns._expand_stars (cognitive 171) sqlglot/optimizer/qualify_columns.py:1154— qualify_columns._expand_stars has cognitive complexity 171 (threshold 15). Drivers by points: if/else 34 (107 pts), boolean chains 23, loops 7 (21 pts), ternaries 6 (20 pts) (nesting depth added 101). 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.
Simplifier._simplify_comparison (cognitive 164) sqlglot/optimizer/simplify.py:981— Simplifier._simplify_comparison has cognitive complexity 164 (threshold 15). Drivers by points: if/else 21 (84 pts), ternaries 10 (58 pts), boolean chains 16, error handling 1 (3 pts), loops 1 (3 pts) (nesting depth added 115). 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.
pushdown_projections.projection_reachability (cognitive 156) sqlglot/optimizer/pushdown_projections.py:86— pushdown_projections.projection_reachability has cognitive complexity 156 (threshold 15). Drivers by points: if/else 30 (72 pts), loops 19 (43 pts), ternaries 8 (24 pts), boolean chains 17 (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
unnest_subqueries.decorrelate (cognitive 149) sqlglot/optimizer/unnest_subqueries.py:225— unnest_subqueries.decorrelate has cognitive complexity 149 (threshold 15). Drivers by points: if/else 55 (91 pts), boolean chains 29, ternaries 10 (19 pts), loops 7 (10 pts) (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.
lineage.to_node (cognitive 140) sqlglot/lineage.py:200— lineage.to_node has cognitive complexity 140 (threshold 15). Drivers by points: if/else 42 (81 pts), ternaries 8 (23 pts), boolean chains 20, loops 8 (16 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.
Parser._parse_create (cognitive 131) sqlglot/parser.py:2577— Parser._parse_create has cognitive complexity 131 (threshold 15). Drivers by points: if/else 41 (89 pts), boolean chains 16, loops 3 (13 pts), ternaries 5 (13 pts) (nesting depth added 66). 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.
qualify_tables.qualify_tables (cognitive 128) sqlglot/optimizer/qualify_tables.py:16— qualify_tables.qualify_tables has cognitive complexity 128 (threshold 15). Drivers by points: if/else 25 (83 pts), boolean chains 21, loops 9 (19 pts), ternaries 1 (5 pts) (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_types (cognitive 125) sqlglot/parser.py:6854— Parser._parse_types has cognitive complexity 125 (threshold 15). Drivers by points: if/else 48 (92 pts), boolean chains 21, ternaries 2 (6 pts), error handling 1 (4 pts), loops 2 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Step.from_expression (cognitive 96) sqlglot/planner.py:49— Step.from_expression has cognitive complexity 96 (threshold 15). Drivers by points: if/else 29 (62 pts), loops 9 (23 pts), boolean chains 9, ternaries 1 (2 pts) (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.
qualify_columns._expand_using (cognitive 93) sqlglot/optimizer/qualify_columns.py:225— qualify_columns._expand_using has cognitive complexity 93 (threshold 15). Drivers by points: if/else 29 (76 pts), boolean chains 11, loops 4 (6 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_columns._convert_columns_to_dots (cognitive 92) sqlglot/optimizer/qualify_columns.py:751— qualify_columns._convert_columns_to_dots has cognitive complexity 92 (threshold 15). Drivers by points: if/else 17 (56 pts), ternaries 4 (15 pts), boolean chains 14, loops 3 (7 pts) (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Expression.__hash__ (cognitive 87) sqlglot/expressions/core.py:843— Expression.__hash__ has cognitive complexity 87 (threshold 15). Drivers by points: if/else 10 (38 pts), loops 7 (26 pts), ternaries 3 (20 pts), boolean chains 3 (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TokenizerCore._extract_string (cognitive 83) sqlglot/tokenizer_core.py:1307— TokenizerCore._extract_string has cognitive complexity 83 (threshold 15). Drivers by points: if/else 23 (55 pts), boolean chains 16, ternaries 4 (11 pts), loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Resolver.get_source_columns (cognitive 75) sqlglot/optimizer/resolver.py:206— Resolver.get_source_columns has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (57 pts), boolean chains 14, ternaries 1 (4 pts) (nesting depth added 41). 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.
Simplifier._simplify_binary (cognitive 74) sqlglot/optimizer/simplify.py:1306— Simplifier._simplify_binary has cognitive complexity 74 (threshold 15). Drivers by points: if/else 22 (46 pts), ternaries 5 (17 pts), boolean chains 11 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Parser._parse_select_query (cognitive 73) sqlglot/parser.py:4167— Parser._parse_select_query has cognitive complexity 73 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 16, ternaries 7 (13 pts), loops 3 (6 pts) (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.
TypeAnnotator.annotate_expression (cognitive 72) sqlglot/optimizer/annotate_types.py:447— TypeAnnotator.annotate_expression has cognitive complexity 72 (threshold 15). Drivers by points: if/else 16 (42 pts), boolean chains 13, loops 4 (13 pts), ternaries 1 (4 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pushdown_projections.prune_projections (cognitive 72) sqlglot/optimizer/pushdown_projections.py:416— pushdown_projections.prune_projections has cognitive complexity 72 (threshold 15). Drivers by points: if/else 16 (54 pts), loops 3 (7 pts), boolean chains 6, ternaries 1 (5 pts) (nesting depth added 46). 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.
qualify_columns._expand_order_by_and_distinct_on (cognitive 72) sqlglot/optimizer/qualify_columns.py:564— qualify_columns._expand_order_by_and_distinct_on has cognitive complexity 72 (threshold 15). Drivers by points: if/else 14 (50 pts), loops 5 (13 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 47). 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.
qualify_columns._qualify_columns (cognitive 70) sqlglot/optimizer/qualify_columns.py:1004— qualify_columns._qualify_columns has cognitive complexity 70 (threshold 15). Drivers by points: if/else 15 (43 pts), boolean chains 10, ternaries 4 (9 pts), loops 4 (8 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_table (cognitive 70) sqlglot/parser.py:5215— Parser._parse_table has cognitive complexity 70 (threshold 15). Drivers by points: if/else 30 (47 pts), boolean chains 13, loops 3 (7 pts), ternaries 3 (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.
pushdown_predicates.pushdown_predicates (cognitive 64) sqlglot/optimizer/pushdown_predicates.py:20— pushdown_predicates.pushdown_predicates has cognitive complexity 64 (threshold 15). Drivers by points: if/else 12 (45 pts), loops 3 (9 pts), ternaries 1 (6 pts), boolean chains 4 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
qualify_columns._expand_alias_refs (cognitive 60) sqlglot/optimizer/qualify_columns.py:369— qualify_columns._expand_alias_refs has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 7 (15 pts), boolean chains 10 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
snowflake._qualify_unnested_columns (cognitive 59) sqlglot/generators/snowflake.py:242— snowflake._qualify_unnested_columns has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (43 pts), loops 4 (11 pts), boolean chains 5 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Parser._parse_query_modifiers (cognitive 56) sqlglot/parser.py:4546— Parser._parse_query_modifiers has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (48 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Generator.ordered_sql (cognitive 54) sqlglot/generator.py:3408— Generator.ordered_sql has cognitive complexity 54 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 16, ternaries 5 (13 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TypeAnnotator._annotate_by_args (cognitive 53) sqlglot/optimizer/annotate_types.py:882— TypeAnnotator._annotate_by_args has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 10, ternaries 4 (10 pts), loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transforms.unnest_to_explode (cognitive 53) sqlglot/transforms.py:309— transforms.unnest_to_explode has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (26 pts), ternaries 5 (18 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Simplifier.absorb_and_eliminate (cognitive 52) sqlglot/optimizer/simplify.py:1120— Simplifier.absorb_and_eliminate has cognitive complexity 52 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 4 (14 pts), loops 4 (10 pts), boolean chains 6 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_function_call (cognitive 52) sqlglot/parser.py:7603— Parser._parse_function_call has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 8, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transforms.eliminate_join_marks (cognitive 52) sqlglot/transforms.py:911— transforms.eliminate_join_marks has cognitive complexity 52 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 7 (18 pts), ternaries 2 (7 pts), boolean chains 2 (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.
unnest_subqueries.unnest (cognitive 50) sqlglot/optimizer/unnest_subqueries.py:83— unnest_subqueries.unnest has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 18, ternaries 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenizerCore._scan_numeric_escape (cognitive 47) sqlglot/tokenizer_core.py:1229— TokenizerCore._scan_numeric_escape has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 9, ternaries 4 (9 pts), error handling 1 (3 pts), loops 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge_subqueries._merge_expressions (cognitive 46) sqlglot/optimizer/merge_subqueries.py:657— merge_subqueries._merge_expressions has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 5 (9 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simplifier.simplify (cognitive 46) sqlglot/optimizer/simplify.py:672— Simplifier.simplify has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 6 (14 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
eliminate_ctes.eliminate_ctes (cognitive 45) sqlglot/optimizer/eliminate_ctes.py:13— eliminate_ctes.eliminate_ctes has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (35 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Generator.set_operations (cognitive 44) sqlglot/generator.py:1985— Generator.set_operations has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 4 (13 pts), boolean chains 7 (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.
optimize_joins.optimize_joins (cognitive 42) sqlglot/optimizer/optimize_joins.py:10— optimize_joins.optimize_joins has cognitive complexity 42 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 6 (17 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bigquery._annotate_array (cognitive 42) sqlglot/typing/bigquery.py:155— bigquery._annotate_array has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 9, ternaries 2 (4 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.
TypeAnnotator._get_source_scope_selects (cognitive 41) sqlglot/optimizer/annotate_types.py:344— TypeAnnotator._get_source_scope_selects has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 3 (9 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge_subqueries._mergeable (cognitive 41) sqlglot/optimizer/merge_subqueries.py:244— merge_subqueries._mergeable has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 10, loops 3 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serde.dump (cognitive 41) sqlglot/serde.py:23— serde.dump has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator.expressions (cognitive 40) sqlglot/generator.py:5090— Generator.expressions has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 11 (17 pts), boolean chains 3, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scope._traverse_tables (cognitive 40) sqlglot/optimizer/scope.py:946— scope._traverse_tables has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scope.walk_in_scope (cognitive 40) sqlglot/optimizer/scope.py:1082— scope.walk_in_scope has cognitive complexity 40 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 5 (16 pts), boolean chains 7 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_pivot (cognitive 40) sqlglot/parser.py:5651— Parser._parse_pivot has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenizerCore._scan_number (cognitive 40) sqlglot/tokenizer_core.py:976— TokenizerCore._scan_number has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 12, loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transforms.eliminate_qualify (cognitive 40) sqlglot/transforms.py:201— transforms.eliminate_qualify has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (9 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Parser._parse_join (cognitive 39) sqlglot/parser.py:4863— Parser._parse_join has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 15, ternaries 3 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pushdown_predicates.nodes_for_predicate (cognitive 38) sqlglot/optimizer/pushdown_predicates.py:251— pushdown_predicates.nodes_for_predicate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 8, ternaries 1 (4 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeDistiller._compute_matching_set (cognitive 37) sqlglot/diff.py:276— ChangeDistiller._compute_matching_set has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (4 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_columns._expand_positional_references (cognitive 36) sqlglot/optimizer/qualify_columns.py:653— qualify_columns._expand_positional_references has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (29 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Parser._parse_colon_as_variant_extract (cognitive 36) sqlglot/parser.py:7337— Parser._parse_colon_as_variant_extract has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 2 (3 pts), boolean chains 2 (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.
Parser._parse_alter (cognitive 36) sqlglot/parser.py:9739— Parser._parse_alter has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 9, ternaries 4 (7 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dialect.merge_without_target_sql (cognitive 35) sqlglot/dialects/dialect.py:2594— dialect.merge_without_target_sql has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Generator.create_sql (cognitive 35) sqlglot/generator.py:1401— Generator.create_sql has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 11 (13 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
eliminate_joins.join_condition (cognitive 34) sqlglot/optimizer/eliminate_joins.py:160— eliminate_joins.join_condition has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 4 (10 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenizerCore._scan_keywords (cognitive 34) sqlglot/tokenizer_core.py:843— TokenizerCore._scan_keywords has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 3, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
eliminate_subqueries.eliminate_subqueries (cognitive 33) sqlglot/optimizer/eliminate_subqueries.py:16— eliminate_subqueries.eliminate_subqueries has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 7 (10 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_match_recognize (cognitive 33) sqlglot/parser.py:4687— Parser._parse_match_recognize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 3 (5 pts), boolean chains 2, loops 1 (2 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.
anonymize.anonymize (cognitive 32) sqlglot/anonymize.py:30— anonymize.anonymize has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 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.
Expression.__deepcopy__ (cognitive 32) sqlglot/expressions/core.py:1006— Expression.__deepcopy__ has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (10 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.
Generator.join_sql (cognitive 32) sqlglot/generator.py:3050— Generator.join_sql has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7 (9 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
qualify_columns.qualify_outputs (cognitive 32) sqlglot/optimizer/qualify_columns.py:1481— qualify_columns.qualify_outputs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 4, 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.
Simplifier.simplify_datetrunc (cognitive 32) sqlglot/optimizer/simplify.py:1558— Simplifier.simplify_datetrunc has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MySQLParser._parse_show_mysql (cognitive 32) sqlglot/parsers/mysql.py:587— MySQLParser._parse_show_mysql has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13 (17 pts), if/else 11 (14 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Generator.select_sql (cognitive 31) sqlglot/generator.py:3595— Generator.select_sql has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 5 (8 pts), boolean chains 6 (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.
Generator.alter_sql (cognitive 31) sqlglot/generator.py:4654— Generator.alter_sql has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 9, boolean chains 7, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
pushdown_predicates.pushdown_dnf (cognitive 31) sqlglot/optimizer/pushdown_predicates.py:181— pushdown_predicates.pushdown_dnf has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (4 pts), ternaries 1 (3 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.
Parser._parse_column_ops (cognitive 31) sqlglot/parser.py:7397— Parser._parse_column_ops has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 8, loops 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.
TokenizerCore._scan_comment (cognitive 31) sqlglot/tokenizer_core.py:904— TokenizerCore._scan_comment has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator.when_sql (cognitive 30) sqlglot/generator.py:5190— Generator.when_sql has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 6 (8 pts), boolean chains 4 (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.
snowflake._unnest_generate_date_array (cognitive 30) sqlglot/generators/snowflake.py:101— snowflake._unnest_generate_date_array has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (9 pts), loops 1 (4 pts), boolean chains 2 (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.
Resolver._get_column_type_from_scope (cognitive 30) sqlglot/optimizer/resolver.py:511— Resolver._get_column_type_from_scope has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (6 pts), boolean chains 3 (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.
scope._traverse_scope (cognitive 30) sqlglot/optimizer/scope.py:725— scope._traverse_scope has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_set_operations (cognitive 30) sqlglot/parser.py:6237— Parser._parse_set_operations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_interval_span (cognitive 30) sqlglot/parser.py:6550— Parser._parse_interval_span has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, if/else 9 (13 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lineage._pivot_column_mapping (cognitive 29) sqlglot/lineage.py:593— lineage._pivot_column_mapping has cognitive complexity 29 (threshold 15). Drivers by points: loops 7 (20 pts), if/else 4 (9 pts) (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
qualify_columns._qualify_positional_column (cognitive 29) sqlglot/optimizer/qualify_columns.py:877— qualify_columns._qualify_positional_column has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simplifier.simplify_not (cognitive 29) sqlglot/optimizer/simplify.py:860— Simplifier.simplify_not has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (28 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.
ChangeDistiller._generate_edit_script (cognitive 28) sqlglot/diff.py:202— ChangeDistiller._generate_edit_script has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 5, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pivot.output_columns (cognitive 28) sqlglot/expressions/query.py:1863— Pivot.output_columns has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (5 pts), ternaries 3 (5 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.
qualify_columns.validate_qualify_columns (cognitive 28) sqlglot/optimizer/qualify_columns.py:144— qualify_columns.validate_qualify_columns has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 5, ternaries 1 (4 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scope._collect (cognitive 28) sqlglot/optimizer/scope.py:184— Scope._collect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 9, loops 1, ternaries 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.
Parser._parse_range (cognitive 28) sqlglot/parser.py:6405— Parser._parse_range has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 8, 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.
helpers.projection_has_aggregate (cognitive 27) sqlglot/optimizer/helpers.py:24— helpers.projection_has_aggregate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simplifier.simplify_conditionals (cognitive 27) sqlglot/optimizer/simplify.py:1499— Simplifier.simplify_conditionals has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_window (cognitive 27) sqlglot/parser.py:9071— Parser._parse_window has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 4 (6 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BigQueryParser._parse_table_parts (cognitive 27) sqlglot/parsers/bigquery.py:457— BigQueryParser._parse_table_parts has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TeradataParser._parse_column_ops (cognitive 27) sqlglot/parsers/teradata.py:327— TeradataParser._parse_column_ops has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TeradataParser._parse_projections (cognitive 27) sqlglot/parsers/teradata.py:370— TeradataParser._parse_projections has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator.datatype_sql (cognitive 26) sqlglot/generator.py:1836— Generator.datatype_sql has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (9 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.
TSQLGenerator.create_sql (cognitive 26) sqlglot/generators/tsql.py:508— TSQLGenerator.create_sql has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (8 pts), boolean chains 4 (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.
TypeAnnotator._get_scope_source_selects (cognitive 26) sqlglot/optimizer/annotate_types.py:284— TypeAnnotator._get_scope_source_selects has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (7 pts), boolean chains 4, loops 1 (3 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.
Parser.parse_set_operation (cognitive 26) sqlglot/parser.py:6152— Parser.parse_set_operation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7, ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Parser._parse_cast (cognitive 26) sqlglot/parser.py:8561— Parser._parse_cast has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (6 pts), boolean chains 4 (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.
_Dialect._try_load (cognitive 25) sqlglot/dialects/dialect.py:239— _Dialect._try_load has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), boolean chains 2, error handling 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
env.cast (cognitive 25) sqlglot/executor/env.py:149— env.cast has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (25 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator.table_sql (cognitive 25) sqlglot/generator.py:2594— Generator.table_sql has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 8 (10 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Generator.interval_sql (cognitive 25) sqlglot/generator.py:4271— Generator.interval_sql has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 5 (8 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuckDBGenerator._regexp_extract_sql (cognitive 25) sqlglot/generators/duckdb.py:4402— DuckDBGenerator._regexp_extract_sql has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (10 pts), ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
merge_subqueries._rename_inner_sources (cognitive 25) sqlglot/optimizer/merge_subqueries.py:546— merge_subqueries._rename_inner_sources has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (10 pts), boolean chains 2, ternaries 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.
Gen.gen (cognitive 25) sqlglot/optimizer/simplify.py:1715— Gen.gen has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
simplify.propagate_constants (cognitive 25) sqlglot/optimizer/simplify.py:194— simplify.propagate_constants has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_table_parts (cognitive 25) sqlglot/parser.py:5144— Parser._parse_table_parts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Parser._parse_column_parts_fast (cognitive 25) sqlglot/parser.py:7230— Parser._parse_column_parts_fast has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (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.
Parser._parse_when_matched (cognitive 25) sqlglot/parser.py:10025— Parser._parse_when_matched has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (11 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dialect.no_filter_sql (cognitive 24) sqlglot/dialects/dialect.py:1539— dialect.no_filter_sql has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PythonExecutor.aggregate (cognitive 24) sqlglot/executor/python.py:422— PythonExecutor.aggregate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts), boolean chains 3, ternaries 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.
Generator._pivot_in_value_aliases (cognitive 24) sqlglot/generator.py:2705— Generator._pivot_in_value_aliases has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (7 pts), boolean chains 6, 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.
duckdb.connect_by_to_recursive_cte (cognitive 24) sqlglot/generators/duckdb.py:734— duckdb.connect_by_to_recursive_cte has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (5 pts), boolean chains 4, loops 3 (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.
exasol._add_local_prefix_for_aliases (cognitive 24) sqlglot/generators/exasol.py:42— exasol._add_local_prefix_for_aliases has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TSQLGenerator.set_operations (cognitive 24) sqlglot/generators/tsql.py:324— TSQLGenerator.set_operations has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 9, 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.
pushdown_predicates.pushdown_cnf (cognitive 24) sqlglot/optimizer/pushdown_predicates.py:148— pushdown_predicates.pushdown_cnf has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Resolver.get_table (cognitive 24) sqlglot/optimizer/resolver.py:37— Resolver.get_table has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 3 (5 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
scope._traverse_set_operation (cognitive 24) sqlglot/optimizer/scope.py:806— scope._traverse_set_operation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (4 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.
Parser._parse_drop (cognitive 24) sqlglot/parser.py:2498— Parser._parse_drop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 3 (6 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Parser._parse_limit (cognitive 24) sqlglot/parser.py:5998— Parser._parse_limit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonExecutor.set_operation (cognitive 23) sqlglot/executor/python.py:518— PythonExecutor.set_operation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
core._to_s (cognitive 23) sqlglot/expressions/core.py:2645— core._to_s has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator.window_sql (cognitive 23) sqlglot/generator.py:3769— Generator.window_sql has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqlite._transform_create (cognitive 23) sqlglot/generators/sqlite.py:23— sqlite._transform_create has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
canonicalize._coerce_date (cognitive 23) sqlglot/optimizer/canonicalize.py:174— canonicalize._coerce_date has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 1 (3 pts), boolean chains 1, 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.
Simplifier._simplify (cognitive 23) sqlglot/optimizer/simplify.py:748— Simplifier._simplify has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simplifier.uniq_sort (cognitive 23) sqlglot/optimizer/simplify.py:1083— Simplifier.uniq_sort has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_table_parts_fast (cognitive 23) sqlglot/parser.py:5078— Parser._parse_table_parts_fast has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_type (cognitive 23) sqlglot/parser.py:6771— Parser._parse_type has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_column_def (cognitive 23) sqlglot/parser.py:7911— Parser._parse_column_def has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._replace_lambda (cognitive 23) sqlglot/parser.py:10294— Parser._replace_lambda has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenizerCore._scan_string (cognitive 23) sqlglot/tokenizer_core.py:1104— TokenizerCore._scan_string has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, error handling 1 (2 pts), ternaries 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.
transforms.inherit_struct_field_names (cognitive 23) sqlglot/transforms.py:1090— transforms.inherit_struct_field_names has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (10 pts), boolean chains 3 (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.
_Dialect.__new__ (cognitive 22) sqlglot/dialects/dialect.py:306— _Dialect.__new__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 2 (4 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Generator.pivot_sql (cognitive 22) sqlglot/generator.py:2784— Generator.pivot_sql has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 8 (10 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.
Generator.values_sql (cognitive 22) sqlglot/generator.py:2893— Generator.values_sql has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), ternaries 3 (5 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
snowflake._eliminate_dot_variant_lookup (cognitive 22) sqlglot/generators/snowflake.py:338— snowflake._eliminate_dot_variant_lookup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TypeAnnotator._fixup_order_by_aliases (cognitive 22) sqlglot/optimizer/annotate_types.py:625— TypeAnnotator._fixup_order_by_aliases has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (7 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.
optimize_joins.normalize (cognitive 22) sqlglot/optimizer/optimize_joins.py:91— optimize_joins.normalize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenizerCore._scan (cognitive 22) sqlglot/tokenizer_core.py:705— TokenizerCore._scan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expression.add_comments (cognitive 21) sqlglot/expressions/core.py:1047— Expression.add_comments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (6 pts), ternaries 1 (5 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.
Generator.insert_sql (cognitive 21) sqlglot/generator.py:2464— Generator.insert_sql has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 14 (16 pts), if/else 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
bigquery._array_agg_fold_sql (cognitive 21) sqlglot/generators/bigquery.py:209— bigquery._array_agg_fold_sql has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, ternaries 2, 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.
DuckDBGenerator.concatws_sql (cognitive 21) sqlglot/generators/duckdb.py:4362— DuckDBGenerator.concatws_sql has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrinoGenerator.concatws_sql (cognitive 21) sqlglot/generators/trino.py:57— TrinoGenerator.concatws_sql has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeAnnotator._get_pivot_column_types (cognitive 21) sqlglot/optimizer/annotate_types.py:781— TypeAnnotator._get_pivot_column_types has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_columns._qualify_comprehensions (cognitive 21) sqlglot/optimizer/qualify_columns.py:718— qualify_columns._qualify_comprehensions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_columns._get_outer_column_table (cognitive 21) sqlglot/optimizer/qualify_columns.py:967— qualify_columns._get_outer_column_table has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_insert (cognitive 21) sqlglot/parser.py:3735— Parser._parse_insert has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_with (cognitive 21) sqlglot/parser.py:4361— Parser._parse_with has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_alter_table_alter (cognitive 21) sqlglot/parser.py:9584— Parser._parse_alter_table_alter has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 9, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
core._apply_child_list_builder (cognitive 20) sqlglot/expressions/core.py:2714— core._apply_child_list_builder has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 2, ternaries 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.
DatabricksGenerator.unnest_sql (cognitive 20) sqlglot/generators/databricks.py:96— DatabricksGenerator.unnest_sql has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (7 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.
exasol._qualify_unscoped_star (cognitive 20) sqlglot/generators/exasol.py:153— exasol._qualify_unscoped_star has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, ternaries 2 (4 pts), loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SingleStoreGenerator.datatype_sql (cognitive 20) sqlglot/generators/singlestore.py:1489— SingleStoreGenerator.datatype_sql has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 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.
normalize_identifiers.normalize_identifiers (cognitive 20) sqlglot/optimizer/normalize_identifiers.py:24— normalize_identifiers.normalize_identifiers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (5 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.
Simplifier.simplify_equality (cognitive 20) sqlglot/optimizer/simplify.py:1202— Simplifier.simplify_equality has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_analyze_histogram (cognitive 20) sqlglot/parser.py:9965— Parser._parse_analyze_histogram has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transforms.unnest_generate_date_array_using_recursive_cte (cognitive 20) sqlglot/transforms.py:72— transforms.unnest_generate_date_array_using_recursive_cte has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
anonymize._number_alias (cognitive 19) sqlglot/anonymize.py:193— anonymize._number_alias has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (7 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expression.error_messages (cognitive 19) sqlglot/expressions/core.py:1314— Expression.error_messages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
core.convert (cognitive 19) sqlglot/expressions/core.py:2436— core.convert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Generator.altercolumn_sql (cognitive 19) sqlglot/generator.py:4540— Generator.altercolumn_sql has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (8 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MySQLGenerator.show_sql (cognitive 19) sqlglot/generators/mysql.py:725— MySQLGenerator.show_sql has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 7, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
normalize.normalize (cognitive 19) sqlglot/optimizer/normalize.py:15— normalize.normalize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
normalize.distributive_law (cognitive 19) sqlglot/optimizer/normalize.py:157— normalize.distributive_law has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scope.columns (cognitive 19) sqlglot/optimizer/scope.py:376— Scope.columns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
unnest_subqueries.unnest_subqueries (cognitive 19) sqlglot/optimizer/unnest_subqueries.py:9— unnest_subqueries.unnest_subqueries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_generated_as_identity (cognitive 19) sqlglot/parser.py:8054— Parser._parse_generated_as_identity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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.
dialect.strposition_sql (cognitive 18) sqlglot/dialects/dialect.py:1608— dialect.strposition_sql has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dialect.sequence_sql (cognitive 18) sqlglot/dialects/dialect.py:2818— dialect.sequence_sql has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonExecutor._execute (cognitive 18) sqlglot/executor/python.py:40— PythonExecutor._execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator.generatedasidentitycolumnconstraint_sql (cognitive 18) sqlglot/generator.py:1310— Generator.generatedasidentitycolumnconstraint_sql has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bigquery._alias_ordered_group (cognitive 18) sqlglot/generators/bigquery.py:99— bigquery._alias_ordered_group has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (3 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.
PostgresGenerator.unnest_sql (cognitive 18) sqlglot/generators/postgres.py:523— PostgresGenerator.unnest_sql has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lineage._pivot_chain_mapping (cognitive 18) sqlglot/lineage.py:534— lineage._pivot_chain_mapping has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeAnnotator._restore_dot_parts (cognitive 18) sqlglot/optimizer/annotate_types.py:593— TypeAnnotator._restore_dot_parts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeAnnotator._get_unpivot_column_types (cognitive 18) sqlglot/optimizer/annotate_types.py:748— TypeAnnotator._get_unpivot_column_types has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simplifier.remove_complements (cognitive 18) sqlglot/optimizer/simplify.py:1066— Simplifier.remove_complements has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 1 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Parser._kv_to_prop_eq (cognitive 18) sqlglot/parser.py:7723— Parser._kv_to_prop_eq has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transforms.eliminate_distinct_on (cognitive 18) sqlglot/transforms.py:144— transforms.eliminate_distinct_on has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
anonymize._fit (cognitive 17) sqlglot/anonymize.py:231— anonymize._fit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Dialect.normalize_identifier (cognitive 17) sqlglot/dialects/dialect.py:1200— Dialect.normalize_identifier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Generator.datatype_param_bound_limiter (cognitive 17) sqlglot/generator.py:1796— Generator.datatype_param_bound_limiter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (6 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.
Generator._like_sql (cognitive 17) sqlglot/generator.py:4869— Generator._like_sql has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
duckdb._struct_sql (cognitive 17) sqlglot/generators/duckdb.py:634— duckdb._struct_sql has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
presto.amend_exploded_column_table (cognitive 17) sqlglot/generators/presto.py:239— presto.amend_exploded_column_table has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 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.
TypeAnnotator._annotate_set_operation (cognitive 17) sqlglot/optimizer/annotate_types.py:702— TypeAnnotator._annotate_set_operation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Resolver._get_available_source_columns (cognitive 17) sqlglot/optimizer/resolver.py:360— Resolver._get_available_source_columns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simplifier._flat_simplify (cognitive 17) sqlglot/optimizer/simplify.py:1656— Simplifier._flat_simplify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._build_predicate (cognitive 17) sqlglot/parser.py:6332— Parser._build_predicate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClickHouseParser._parse_function (cognitive 17) sqlglot/parsers/clickhouse.py:767— ClickHouseParser._parse_function has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FabricParser._parse_create (cognitive 17) sqlglot/parsers/fabric.py:8— FabricParser._parse_create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HiveParser.build_cast (cognitive 17) sqlglot/parsers/hive.py:161— HiveParser.build_cast has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 1 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dialect.groupconcat_sql (cognitive 16) sqlglot/dialects/dialect.py:2980— dialect.groupconcat_sql has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PythonExecutor._append_unmatched_join_rows (cognitive 16) sqlglot/executor/python.py:405— PythonExecutor._append_unmatched_join_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), ternaries 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.
builders.replace_children (cognitive 16) sqlglot/expressions/builders.py:671— builders.replace_children has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (7 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
builders.func (cognitive 16) sqlglot/expressions/builders.py:990— builders.func has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Select.join (cognitive 16) sqlglot/expressions/query.py:1445— Select.join has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Generator.group_sql (cognitive 16) sqlglot/generator.py:2986— Generator.group_sql has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4, boolean chains 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.
Generator.lock_sql (cognitive 16) sqlglot/generator.py:3234— Generator.lock_sql has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 6 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bigquery._widen_decimal (cognitive 16) sqlglot/generators/bigquery.py:186— bigquery._widen_decimal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuckDBGenerator.regexpreplace_sql (cognitive 16) sqlglot/generators/duckdb.py:3549— DuckDBGenerator.regexpreplace_sql has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
merge_subqueries.merge_ctes (cognitive 16) sqlglot/optimizer/merge_subqueries.py:158— merge_subqueries.merge_ctes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_columns.qualify_columns (cognitive 16) sqlglot/optimizer/qualify_columns.py:32— qualify_columns.qualify_columns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, 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.
qualify_columns._expand_struct_stars (cognitive 16) sqlglot/optimizer/qualify_columns.py:1117— qualify_columns._expand_struct_stars has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
simplify.simplify_parens (cognitive 16) sqlglot/optimizer/simplify.py:145— simplify.simplify_parens has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Parser._parse_table_sample (cognitive 16) sqlglot/parser.py:5494— Parser._parse_table_sample has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Parser._parse_is (cognitive 16) sqlglot/parser.py:6454— Parser._parse_is has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser._parse_analyze (cognitive 16) sqlglot/parser.py:9825— Parser._parse_analyze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 1, ternaries 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.
ClickHouseParser._parse_auto_refresh_property (cognitive 16) sqlglot/parsers/clickhouse.py:882— ClickHouseParser._parse_auto_refresh_property has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SnowflakeParser._parse_show_snowflake (cognitive 16) sqlglot/parsers/snowflake.py:1247— SnowflakeParser._parse_show_snowflake has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenizerCore._add (cognitive 16) sqlglot/tokenizer_core.py:790— TokenizerCore._add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) sqlglot/parser.py:5079— sqlglot/parser.py:5079-5142 | sqlglot/parser.py:7231-7301 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) sqlglot/parsers/trino.py:169— sqlglot/parsers/trino.py:169-190 | sqlglot/parsers/trino.py:194-214 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) sqlglot/generators/snowflake.py:1159— sqlglot/generators/snowflake.py:1159-1181 | sqlglot/generators/teradata.py:160-175 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) sqlglot/generators/bigquery.py:282— sqlglot/generators/bigquery.py:282-295 | sqlglot/generators/spark2.py:83-96 — 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 (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) sqlglot/generators/fabric.py:29— sqlglot/generators/fabric.py:29-46 | sqlglot/parsers/fabric.py:9-27 — 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 (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) sqlglot/typing/duckdb.py:56— sqlglot/typing/duckdb.py:56-68 | sqlglot/typing/postgres.py:19-31 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) sqlglot/parser.py:10601— sqlglot/parser.py:10601-10623 | sqlglot/parser.py:10626-10653 — 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 copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) sqlglot/typing/bigquery.py:54— sqlglot/typing/bigquery.py:54-66 | sqlglot/typing/duckdb.py:23-32 | sqlglot/typing/redshift.py:13-20 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) sqlglot/dialects/dialect.py:2891— sqlglot/dialects/dialect.py:2891-2909 | sqlglot/parsers/bigquery.py:126-146 — 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 copies of one member (3 members, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) sqlglot/generator.py:4054— sqlglot/generator.py:4054-4060 | sqlglot/generator.py:4307-4312 | sqlglot/generators/redshift.py:375-382 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) sqlglot/generator.py:5166— sqlglot/generator.py:5166-5171 | sqlglot/generators/tsql.py:733-738 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×1
Edited copy of a member (12 corresponding lines) sqlglot/executor/env.py:17— sqlglot/executor/env.py:17-28 | sqlglot/executor/env.py:32-43 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) sqlglot/generators/exasol.py:886— sqlglot/generators/exasol.py:886-891 | sqlglot/generators/mysql.py:829-833 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) sqlglot/generator.py:4642— sqlglot/generator.py:4642-4645 | sqlglot/generators/exasol.py:894-897 | sqlglot/generators/tableau.py:32-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) sqlglot/expressions/dml.py:229— sqlglot/expressions/dml.py:229-263 | sqlglot/expressions/query.py:318-353 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (22 lines × 2) sqlglot/parsers/doris.py:106— sqlglot/parsers/doris.py:106-127 | sqlglot/parsers/starrocks.py:219-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–19 lines × 2) sqlglot/typing/snowflake.py:150— sqlglot/typing/snowflake.py:150-168 | sqlglot/typing/snowflake.py:190-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.Expr` in one and `exp.Kurtosis` 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–14 lines × 2) sqlglot/generators/duckdb.py:437— sqlglot/generators/duckdb.py:437-450 | sqlglot/generators/duckdb.py:531-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sqlglot/generators/duckdb.py:437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.ArrayInsert` in one and `exp.ArrayRemoveAt` 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) sqlglot/generators/mysql.py:68— sqlglot/generators/mysql.py:68-78 | sqlglot/generators/postgres.py:226-236 — 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 `self` to `MySQLGenerator` in one and `PostgresGenerator` 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–9 lines × 2) sqlglot/generators/fabric.py:34— sqlglot/generators/fabric.py:34-42 | sqlglot/parsers/fabric.py:14-21 — 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 `sqlglot/generators/fabric.py:34` 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–7 lines × 2) sqlglot/generator.py:4176— sqlglot/generator.py:4176-4181 | sqlglot/generator.py:4188-4194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sqlglot/generator.py:4176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.JSONArray` in one and `exp.JSONArrayAgg` 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 × 10) sqlglot/generator.py:1524— sqlglot/generator.py:1524-1528 | sqlglot/generator.py:1602-1606 | sqlglot/generator.py:2501-2506 | sqlglot/generator.py:2555-2559 | sqlglot/generator.py:3340-3344 | sqlglot/generator.py:4044-4048 | sqlglot/generator.py:4452-4456 | sqlglot/generator.py:6525-6529 | sqlglot/generator.py:6578-6582 | sqlglot/generators/clickhouse.py:730-734 — there are 10 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 10 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.SequenceProperties` in one and `exp.Describe` 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 × 7) sqlglot/generator.py:2561— sqlglot/generator.py:2561-2565 | sqlglot/generator.py:3313-3317 | sqlglot/generator.py:4505-4509 | sqlglot/generator.py:5355-5359 | sqlglot/generator.py:6527-6531 | sqlglot/generators/clickhouse.py:732-736 | sqlglot/generators/trino.py:176-182 — there are 7 copies across 3 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 7 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `expression` to `exp.RowFormatDelimitedProperty` in one and `exp.LoadData` 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 (30 lines × 3) sqlglot/expressions/dml.py:126— sqlglot/expressions/dml.py:126-155 | sqlglot/expressions/dml.py:391-420 | sqlglot/expressions/query.py:1554-1583 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap sqlglot/expressions/core.py:2498— `convert` is public and takes `value: t.Any` from its caller, and it calls itself at line 2498 (`convert`) with a piece of `value` (and at line 2502, line 2508, line 2509, line 2516) — and nowhere in `convert` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `convert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Duplicated predicate sqlglot/generator.py:6743— `delimiters.is_string and delimiters.this == self.dialect.INITCAP_DEFAULT_DELIMITER_CHARS` appears character-identically in 2 files — sqlglot/generator.py, sqlglot/generators/presto.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/mysql.py:231— `e.args.get("decimals") or exp.Literal.number(0)` appears character-identically in 2 files — sqlglot/generators/mysql.py, sqlglot/generators/tsql.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/redshift.py:121— `e.args.get("length") or exp.Literal.number(256)` appears character-identically in 3 files — sqlglot/generators/redshift.py, sqlglot/generators/snowflake.py, sqlglot/generators/spark2.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/postgres.py:418— `e.args.get("replacement") or exp.Literal.string("")` appears character-identically in 2 files — sqlglot/generators/postgres.py, sqlglot/generators/spark2.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/doris.py:21— `expression.args.get("default") or exp.null()` appears character-identically in 2 files — sqlglot/generators/doris.py, sqlglot/optimizer/simplify.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/dialects/dialect.py:2164— `expression.args.get("replacement") or exp.Literal.string("")` appears character-identically in 2 files — sqlglot/dialects/dialect.py, sqlglot/generators/duckdb.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/optimizer/qualify_tables.py:70— `expression.args.get("with_") or exp.With()` appears character-identically in 2 files — sqlglot/optimizer/qualify_tables.py, sqlglot/transforms.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/materialize.py:50— `expression.is_type(exp.DType.MAP) and len(expression.expressions) == 2` appears character-identically in 2 files — sqlglot/generators/materialize.py, sqlglot/generators/risingwave.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/exasol.py:32— `expression.text("unit").upper() or "DAY"` appears character-identically in 2 files — sqlglot/generators/exasol.py, sqlglot/generators/postgres.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/optimizer/annotate_types.py:95— `is_iso_date_ or is_iso_datetime(date_text)` appears character-identically in 2 files — sqlglot/optimizer/annotate_types.py, sqlglot/optimizer/canonicalize.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/duckdb.py:4376— `isinstance(arg, exp.Array) or arg.is_type(exp.DType.ARRAY)` appears character-identically in 2 files — sqlglot/generators/duckdb.py, sqlglot/generators/trino.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/fabric.py:39— `isinstance(column_type, exp.DataType) and column_type.this in (exp.DType.VARCHAR, exp.DType.CHAR) and not column_type.expressions` appears character-identically in 2 files — sqlglot/generators/fabric.py, sqlglot/parsers/fabric.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/typing/duckdb.py:59— `isinstance(expression, exp.Add) and left.is_type(exp.DType.INTERVAL)` appears character-identically in 2 files — sqlglot/typing/duckdb.py, sqlglot/typing/postgres.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generators/snowflake.py:1024— `isinstance(limit, exp.Limit) and limit.is_limit_all` appears character-identically in 2 files — sqlglot/generators/snowflake.py, sqlglot/generators/sqlite.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generator.py:3384— `isinstance(this, exp.Column) and not this.table` appears character-identically in 2 files — sqlglot/generator.py, sqlglot/parser.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/dialects/dialect.py:2996— `isinstance(this, exp.Limit) and this.this` appears character-identically in 2 files — sqlglot/dialects/dialect.py, sqlglot/generators/clickhouse.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/parser.py:6435— `isinstance(this, exp.Not) and isinstance(this.this, exp.Is)` appears character-identically in 2 files — sqlglot/parser.py, sqlglot/parsers/sqlite.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generator.py:5578— `isinstance(this, exp.TsOrDsToTime) or this.is_type(exp.DType.TIME)` appears character-identically in 2 files — sqlglot/generator.py, sqlglot/generators/duckdb.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/expressions/core.py:2084— `isinstance(unit, Column) and len(unit.parts) != 1` appears character-identically in 2 files — sqlglot/expressions/core.py, sqlglot/expressions/temporal.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generator.py:3546— `join in expression.args.get("joins") or []` appears character-identically in 3 files — sqlglot/generator.py, sqlglot/optimizer/qualify_columns.py, sqlglot/optimizer/scope.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/optimizer/merge_subqueries.py:447— `join.method in ("ASOF", "POSITIONAL") or join.kind in ("ASOF", "ANY", "PASTE") or join.args.get("nearest")` appears character-identically in 2 files — sqlglot/optimizer/merge_subqueries.py, sqlglot/optimizer/pushdown_predicates.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/generator.py:3548— `lateral in expression.args.get("laterals") or []` appears character-identically in 2 files — sqlglot/generator.py, sqlglot/generators/presto.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/optimizer/annotate_types.py:853— `left.meta_get("nonnull") is True and right.meta_get("nonnull") is True` appears character-identically in 2 files — sqlglot/optimizer/annotate_types.py, sqlglot/optimizer/simplify.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/parser.py:170— `len(args) == 1 and isinstance(args[0], exp.Query)` appears character-identically in 2 files — sqlglot/parser.py, sqlglot/parsers/duckdb.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sqlglot/optimizer/pushdown_projections.py:578— `node.is_int and isinstance(node, exp.Literal)` appears character-identically in 2 files — sqlglot/optimizer/pushdown_projections.py, sqlglot/optimizer/qualify_columns.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Interpolated log message defeats structured logging sqlglot/lineage.py:342— `warning` at line 342 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging sqlglot/parser.py:2368— `warning` at line 2368 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging sqlglot/optimizer/annotate_types.py:835— `warning` at line 835 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging sqlglot/optimizer/normalize.py:45— `info` at line 45 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging sqlglot/dialects/dialect.py:1342— `warning` at line 1342 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Silent fallback default on parse failure sqlglot/helper.py:386— `dict_depth` returns `1` when `StopIteration` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure sqlglot/time.py:84— `subsecond_precision` returns `0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 1 significant file(s) lose their only recent owner: REDACTED. Pair on, review, or document these before any departure.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion pyproject.toml:1— `(repository root)` (73137 LoC, 1401 module-visible types across 11 directories) overshoots its size bounds. 1 of 2 build unit(s) (Python) overshoot their size bounds, lowering Project Cohesion to 0.0/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Scattered collaborators — 88 % of calls cross a namespace and only 34 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
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.
No SAST REDACTED:6— No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 4 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation sqlglotc/pyproject.toml:9— `sqlglotc/pyproject.toml` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
No release approval gate REDACTED:82— The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet).
0
—
Run 01a1eb3d-c257-7c2e-967f-e36d128323d7 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 31 · Warnings: 535 · Recommendations: 60 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 20:40 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.