Python SQL Parser and Transpiler
This report presents the forensic synthetic code analysis of tobymao/sqlglot, a Python project with 9,423 GitHub stars. SynthScan v2.0 examined 135,588 lines of code across 265 source files, recording 1059 pattern matches distributed across 14 syntactic categories. The overall adjusted score of 10.1 places this repository in the Low AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 1059 distinct pattern matches across 14 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlglotc/setup.py | 100 | def copy_extensions_to_source(self): | CODE |
| LOW | sqlglot/transforms.py | 72 | def unnest_generate_date_array_using_recursive_cte(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 265 | def remove_precision_parameterized_types(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 402 | def explode_projection_to_unnest( | CODE |
| LOW | sqlglot/transforms.py | 407 | def _explode_projection_to_unnest(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 555 | def add_within_group_for_percentiles(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 570 | def remove_within_group_for_percentiles(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 584 | def add_recursive_cte_column_names(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 615 | def eliminate_semi_and_anti_joins(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 632 | def eliminate_full_outer_join(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 741 | def remove_unique_constraints(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 750 | def ctas_with_tmp_tables_to_create_tmp_view( | CODE |
| LOW | sqlglot/transforms.py | 774 | def move_schema_columns_to_partitioned_by(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 797 | def move_partitioned_by_to_schema_columns(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW | sqlglot/transforms.py | 1015 | def inherit_struct_field_names(expression: exp.Expr) -> exp.Expr: | CODE |
| LOW⚡ | sqlglot/parser.py | 7146 | def _parse_user_defined_function_expression(self) -> exp.Expr | None: | CODE |
| LOW⚡ | sqlglot/parser.py | 7149 | def _parse_function_parameter(self) -> exp.Expr | None: | CODE |
| LOW⚡ | sqlglot/parser.py | 7152 | def _parse_user_defined_function(self, kind: TokenType | None = None) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 108 | def build_extract_json_with_path( | CODE |
| LOW | sqlglot/parser.py | 1429 | def _parse_partitioned_by_bucket_or_truncate(self) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 2670 | def _parse_sequence_properties(self) -> exp.SequenceProperties | None: | CODE |
| LOW | sqlglot/parser.py | 2727 | def _parse_trigger_deferrable( | CODE |
| LOW | sqlglot/parser.py | 2743 | def _parse_trigger_referencing_clause(self, keyword: str) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 2751 | def _parse_trigger_referencing(self) -> exp.TriggerReferencing | None: | CODE |
| LOW | sqlglot/parser.py | 2816 | def _parse_wrapped_properties(self) -> list[exp.Expr | list[exp.Expr]]: | CODE |
| LOW | sqlglot/parser.py | 2841 | def _parse_key_value_property( | CODE |
| LOW | sqlglot/parser.py | 2897 | def _parse_property_assignment(self, exp_class: type[E], **kwargs: t.Any) -> E: | CODE |
| LOW | sqlglot/parser.py | 2937 | def _parse_called_on_null_input_property(self) -> exp.CalledOnNullInputProperty | None: | CODE |
| LOW | sqlglot/parser.py | 2962 | def _parse_system_versioning_property( | CODE |
| LOW | sqlglot/parser.py | 2986 | def _parse_data_deletion_property(self) -> exp.DataDeletionProperty: | CODE |
| LOW | sqlglot/parser.py | 3002 | def _parse_distributed_property(self) -> exp.DistributedByProperty: | CODE |
| LOW | sqlglot/parser.py | 3021 | def _parse_composite_key_property(self, expr_type: type[E]) -> E: | CODE |
| LOW | sqlglot/parser.py | 3215 | def _parse_withisolatedloading(self) -> exp.IsolatedLoadingProperty | None: | CODE |
| LOW | sqlglot/parser.py | 3281 | def _parse_partition_bound_spec(self) -> exp.PartitionBoundSpec: | CODE |
| LOW | sqlglot/parser.py | 3282 | def _parse_partition_bound_expr() -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 3412 | def _parse_remote_with_connection(self) -> exp.RemoteWithConnectionModelProperty: | CODE |
| LOW | sqlglot/parser.py | 3471 | def _parse_multitable_inserts(self, comments: list[str] | None) -> exp.MultitableInserts: | CODE |
| LOW | sqlglot/parser.py | 4029 | def _parse_recursive_with_search(self) -> exp.RecursiveWithSearch | None: | CODE |
| LOW | sqlglot/parser.py | 4171 | def _implicit_unnests_to_explicit(self, this: E) -> E: | CODE |
| LOW | sqlglot/parser.py | 4244 | def _parse_hint_fallback_to_string(self) -> exp.Hint | None: | CODE |
| LOW | sqlglot/parser.py | 4252 | def _parse_hint_function_call(self) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 4310 | def _parse_match_recognize_measure(self) -> exp.MatchRecognizeMeasure: | CODE |
| LOW | sqlglot/parser.py | 4482 | def _parse_column_as_identifier() -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 5063 | def _parse_derived_table_values(self) -> exp.Values | None: | CODE |
| LOW | sqlglot/parser.py | 5202 | def _parse_aliased_expression() -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 5456 | def _parse_connect_with_prior(self) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 5481 | def _parse_name_as_expression(self) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 5655 | def _can_parse_limit_or_offset(self) -> bool: | CODE |
| LOW | sqlglot/parser.py | 6550 | def _parse_vector_expressions(self, expressions: list[exp.Expr]) -> list[exp.Expr]: | CODE |
| LOW | sqlglot/parser.py | 6738 | def _parse_colon_as_variant_extract(self, this: exp.Expr | None) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 7129 | def _parse_function_properties(self) -> exp.Properties | None: | CODE |
| LOW | sqlglot/parser.py | 7412 | def _parse_generated_as_identity( | CODE |
| LOW | sqlglot/parser.py | 7508 | def _parse_unnamed_constraints(self) -> list[exp.Expr]: | CODE |
| LOW | sqlglot/parser.py | 7518 | def _parse_unnamed_constraint(self, constraints: TEXTS_TYPE | None = None) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 7557 | def _parse_key_constraint_options(self) -> list[str]: | CODE |
| LOW | sqlglot/parser.py | 7638 | def _parse_period_for_system_time(self) -> exp.PeriodForSystemTimeConstraint | None: | CODE |
| LOW | sqlglot/parser.py | 7694 | def _parse_odbc_datetime_literal(self) -> exp.Expr: | CODE |
| LOW | sqlglot/parser.py | 8252 | def _parse_open_json_column_def() -> exp.OpenJSONColumnDef: | CODE |
| LOW | sqlglot/parser.py | 8350 | def _parse_respect_or_ignore_nulls(self, this: exp.Expr | None) -> exp.Expr | None: | CODE |
| LOW | sqlglot/parser.py | 8481 | def _parse_partition_and_order( | CODE |
| 397 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | sqlglot/parser.py | 7222 | # Fast path: simple atom (column, literal, null, bool) followed by , or ) | COMMENT |
| HIGH | sqlglot/parser.py | 3438 | return self.expression(exp.ReturnsProperty(this=value, is_table=is_table, null=null)) | CODE |
| HIGH | sqlglot/parser.py | 8110 | return self.expression(exp.OnCondition(empty=empty, error=error, null=null)) | CODE |
| HIGH | sqlglot/generator.py | 2360 | null = f" NULL DEFINED AS {null}" if null else "" | CODE |
| HIGH | sqlglot/generator.py | 2361 | return f"ROW FORMAT DELIMITED{fields}{escaped}{items}{keys}{lines}{null}" | CODE |
| HIGH | sqlglot/generator.py | 5632 | return f"{empty}{error}{null}" | CODE |
| HIGH | sqlglot/generators/duckdb.py | 3441 | For BINARY: Lower to: input || REPEAT(pad, GREATEST(0, target_len - OCTET_LENGTH(input))) | CODE |
| HIGH | sqlglot/generators/duckdb.py | 574 | DuckDB's native && operator is not NULL-safe: [1,NULL,3] && [NULL,4,5] returns FALSE. | STRING |
| HIGH | sqlglot/generators/duckdb.py | 577 | Generated SQL: (arr1 && arr2) OR (ARRAY_LENGTH(arr1) <> LIST_COUNT(arr1) AND ARRAY_LENGTH(arr2) <> LIST_COUNT(arr2)) | STRING |
| HIGH | sqlglot/generators/duckdb.py | 2088 | WHEN LENGTH(l) < 5 THEN UNHEX(PRINTF('%04X', LENGTH(l)) || h || REPEAT('00', GREATEST(0, 4 - LENGTH(l)) * 2) | STRING |
| HIGH | sqlglot/generators/duckdb.py | 2094 | (__a, __b) -> __a || __b, '' | STRING |
| HIGH | sqlglot/generators/duckdb.py | 4093 | this=exp.Coalesce(this=x, expressions=[null]), | STRING |
| HIGH⚡ | tests/test_optimizer.py | 104 | INSERT INTO x VALUES (null, null); | STRING |
| HIGH⚡ | tests/test_optimizer.py | 110 | INSERT INTO y VALUES (null, null); | STRING |
| HIGH⚡ | tests/test_optimizer.py | 116 | INSERT INTO y VALUES (null, null); | STRING |
| HIGH | tests/test_optimizer.py | 1945 | "SELECT x.cola || TRIM(x.colb) AS col, DATE(x.colb), DATEFROMPARTS(y, m, d) FROM x AS x" | STRING |
| HIGH⚡ | tests/test_executor.py | 745 | ("ARRAY_JOIN(['hello', null ,'world'], ' ', ',')", "hello , world"), | CODE |
| HIGH⚡ | tests/test_executor.py | 746 | ("ARRAY_JOIN(['', null ,'world'], ' ', ',')", " , world"), | CODE |
| HIGH⚡ | tests/test_executor.py | 747 | ("STRUCT('foo', 'bar', null, null)", {"foo": "bar"}), | CODE |
| HIGH | tests/test_transforms.py | 130 | "SELECT x, t, x || t AS z FROM y QUALIFY ROW_NUMBER() OVER (PARTITION BY x ORDER BY z DESC)", | CODE |
| HIGH | tests/test_transforms.py | 131 | "SELECT x, t, z FROM (SELECT x, t, x || t AS z, ROW_NUMBER() OVER (PARTITION BY x ORDER BY x || t DESC) AS _ | CODE |
| HIGH | tests/dialects/test_snowflake.py | 111 | "duckdb": "SELECT (SELECT CASE WHEN l IS NULL OR LENGTH(l) = 0 THEN NULL WHEN LENGTH(l) <> LENGTH(LIST_F | CODE |
| HIGH | tests/dialects/test_snowflake.py | 1240 | "duckdb": "SELECT (col1 && col2) OR (ARRAY_LENGTH(col1) <> LIST_COUNT(col1) AND ARRAY_LENGTH(col2) <> LI | CODE |
| HIGH | tests/dialects/test_snowflake.py | 1266 | "ARRAY_CONSTRUCT_COMPACT(1, null, 2)", | CODE |
| HIGH⚡ | tests/dialects/test_bigquery.py | 2076 | self.validate_identity("""JSON_STRIP_NULLS(PARSE_JSON('[1, null, 2, null, [null]]'))""") | CODE |
| HIGH⚡ | tests/dialects/test_bigquery.py | 2078 | """JSON_STRIP_NULLS(PARSE_JSON('[1, null, 2, null]'), include_arrays => FALSE)""" | STRING |
| HIGH⚡ | tests/dialects/test_bigquery.py | 2081 | """JSON_STRIP_NULLS(PARSE_JSON('{"a": {"b": {"c": null}}, "d": [null], "e": [], "f": 1}'), include_arrays => | STRING |
| HIGH | tests/dialects/test_redshift.py | 201 | 'create table if not exists city_slash_id("city/id" integer not null, state char(2) not null)', | CODE |
| HIGH | tests/dialects/test_duckdb.py | 340 | """SELECT CASE WHEN JSON_TYPE(JSON('{"a": null}') -> '$.a') = 'NULL' THEN NULL ELSE JSON('{"a": null}') -> ' | STRING |
| HIGH | tests/dialects/test_duckdb.py | 342 | "snowflake": """SELECT STRIP_NULL_VALUE(GET_PATH(PARSE_JSON('{"a": null}'), 'a'))""", | CODE |
| HIGH | tests/dialects/test_duckdb.py | 546 | """SELECT '{ "family": "anatidae", "species": [ "duck", "goose", "swan", null ] }' ->> ['$.family', '$.speci | STRING |
| HIGH | tests/dialects/test_duckdb.py | 557 | """SELECT JSON_EXTRACT_STRING('{ "family": "anatidae", "species": [ "duck", "goose", "swan", null ] }', ['$. | STRING |
| HIGH | tests/dialects/test_duckdb.py | 558 | """SELECT '{ "family": "anatidae", "species": [ "duck", "goose", "swan", null ] }' ->> ['$.family', '$.speci | STRING |
| HIGH | tests/dialects/test_duckdb.py | 1355 | self.validate_identity("a && b").assert_is(exp.ArrayOverlaps) | CODE |
| HIGH⚡ | tests/dialects/test_dialect.py | 4965 | "": """JSON_STRIP_NULLS(PARSE_JSON('[{"f1":1,"f2":null},2,null,3]'))""", | CODE |
| HIGH⚡ | tests/dialects/test_dialect.py | 4966 | "bigquery": """JSON_STRIP_NULLS(PARSE_JSON('[{"f1":1,"f2":null},2,null,3]'))""", | CODE |
| HIGH⚡ | tests/dialects/test_dialect.py | 4969 | "bigquery": """JSON_STRIP_NULLS(PARSE_JSON('[{"f1":1,"f2":null},2,null,3]'))""", | CODE |
| HIGH⚡ | tests/dialects/test_dialect.py | 4970 | "postgres": """JSON_STRIP_NULLS(CAST('[{"f1":1,"f2":null},2,null,3]' AS JSON))""", | CODE |
| HIGH | tests/dialects/test_dialect.py | 2218 | "redshift": "a || b || c", | CODE |
| HIGH | tests/dialects/test_dialect.py | 2219 | "sqlite": "a || b || c", | CODE |
| HIGH⚡ | tests/dialects/test_dialect.py | 4963 | """JSON_STRIP_NULLS(PARSE_JSON('[{"f1":1,"f2":null},2,null,3]'))""", | STRING |
| HIGH | tests/dialects/test_mysql.py | 294 | self.validate_identity("SELECT 1 && 0", "SELECT 1 AND 0") | CODE |
| HIGH | tests/dialects/test_mysql.py | 315 | self.validate_identity("SELECT a || b", "SELECT a OR b") | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1145 | "sqlite": "GROUP_CONCAT(a || b || c, ',')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1147 | "postgres": "STRING_AGG(a || b || c, ',')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1156 | "sqlite": "GROUP_CONCAT(a || b || c, '')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1159 | "postgres": "STRING_AGG(a || b || c, '')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1166 | "sqlite": "GROUP_CONCAT(DISTINCT a || b || c, '')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1169 | "postgres": "STRING_AGG(DISTINCT a || b || c, '')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1176 | "sqlite": "GROUP_CONCAT(a || b || c, '')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1179 | "postgres": "STRING_AGG(a || b || c, '' ORDER BY d NULLS FIRST)", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1186 | "sqlite": "GROUP_CONCAT(DISTINCT a || b || c, '')", | CODE |
| HIGH⚡ | tests/dialects/test_mysql.py | 1189 | "postgres": "STRING_AGG(DISTINCT a || b || c, '' ORDER BY d NULLS FIRST)", | CODE |
| HIGH | tests/dialects/test_solr.py | 12 | self.validate_identity("a || b", "a OR b").assert_is(exp.Or) | CODE |
| HIGH⚡ | tests/dialects/test_prql.py | 81 | "from x filter (age > 25 && age < 27)", | CODE |
| HIGH⚡ | tests/dialects/test_prql.py | 85 | "from x filter (age > 25 || age < 27)", | CODE |
| HIGH⚡ | tests/dialects/test_prql.py | 89 | "from x filter (age > 25 || age < 22) filter age > 26 filter age < 27", | CODE |
| HIGH | tests/dialects/test_prql.py | 141 | "from x filter (a > 1 || null != b || c != null)", | CODE |
| HIGH | tests/dialects/test_prql.py | 141 | "from x filter (a > 1 || null != b || c != null)", | CODE |
| HIGH | tests/dialects/test_clickhouse.py | 489 | "postgres": "a || b", | CODE |
| 5 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pdoc/cli.py | 11 | CODE | |
| LOW | sqlglot/time.py | 1 | CODE | |
| LOW | sqlglot/planner.py | 1 | CODE | |
| LOW | sqlglot/transforms.py | 1 | CODE | |
| LOW | sqlglot/_typing.py | 1 | CODE | |
| LOW | sqlglot/_typing.py | 7 | CODE | |
| LOW | sqlglot/serde.py | 1 | CODE | |
| LOW | sqlglot/__init__.py | 8 | CODE | |
| LOW | sqlglot/__init__.py | 10 | CODE | |
| LOW | sqlglot/__init__.py | 17 | CODE | |
| LOW | sqlglot/__init__.py | 18 | CODE | |
| LOW | sqlglot/__init__.py | 19 | CODE | |
| LOW | sqlglot/__init__.py | 19 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 25 | CODE | |
| LOW | sqlglot/__init__.py | 52 | CODE | |
| LOW | sqlglot/__init__.py | 53 | CODE | |
| LOW | sqlglot/__init__.py | 54 | CODE | |
| LOW | sqlglot/__init__.py | 54 | CODE | |
| LOW | sqlglot/__init__.py | 55 | CODE | |
| LOW | sqlglot/__init__.py | 55 | CODE | |
| LOW | sqlglot/__init__.py | 66 | CODE | |
| LOW | sqlglot/__init__.py | 66 | CODE | |
| LOW | sqlglot/tokens.py | 1 | CODE | |
| LOW | sqlglot/tokens.py | 16 | CODE | |
| LOW | sqlglot/tokenizer_core.py | 1 | CODE | |
| LOW | sqlglot/parser.py | 1 | CODE | |
| LOW | sqlglot/generator.py | 1 | CODE | |
| LOW | sqlglot/helper.py | 1 | CODE | |
| LOW | sqlglot/helper.py | 17 | CODE | |
| LOW | sqlglot/helper.py | 17 | CODE | |
| LOW | sqlglot/diff.py | 7 | CODE | |
| LOW | sqlglot/errors.py | 1 | CODE | |
| LOW | sqlglot/lineage.py | 1 | CODE | |
| LOW | sqlglot/__main__.py | 1 | CODE | |
| LOW | sqlglot/jsonpath.py | 1 | CODE | |
| LOW | sqlglot/schema.py | 1 | CODE | |
| LOW | sqlglot/parsers/redshift.py | 1 | CODE | |
| 194 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlglot/planner.py | 46 | CODE | |
| LOW | sqlglot/transforms.py | 201 | CODE | |
| LOW | sqlglot/transforms.py | 278 | CODE | |
| LOW | sqlglot/transforms.py | 297 | CODE | |
| LOW | sqlglot/transforms.py | 402 | CODE | |
| LOW | sqlglot/transforms.py | 584 | CODE | |
| LOW | sqlglot/transforms.py | 615 | CODE | |
| LOW | sqlglot/transforms.py | 836 | CODE | |
| LOW | sqlglot/transforms.py | 1015 | CODE | |
| LOW | sqlglot/transforms.py | 407 | CODE | |
| LOW | sqlglot/serde.py | 23 | CODE | |
| LOW | sqlglot/tokenizer_core.py | 681 | CODE | |
| LOW | sqlglot/tokenizer_core.py | 804 | CODE | |
| LOW | sqlglot/tokenizer_core.py | 864 | CODE | |
| LOW | sqlglot/tokenizer_core.py | 922 | CODE | |
| LOW | sqlglot/tokenizer_core.py | 1036 | CODE | |
| LOW | sqlglot/tokenizer_core.py | 1124 | CODE | |
| LOW | sqlglot/parser.py | 2384 | CODE | |
| LOW | sqlglot/parser.py | 2670 | CODE | |
| LOW | sqlglot/parser.py | 2751 | CODE | |
| LOW | sqlglot/parser.py | 2962 | CODE | |
| LOW | sqlglot/parser.py | 2986 | CODE | |
| LOW | sqlglot/parser.py | 3229 | CODE | |
| LOW | sqlglot/parser.py | 3730 | CODE | |
| LOW | sqlglot/parser.py | 3829 | CODE | |
| LOW | sqlglot/parser.py | 3887 | CODE | |
| LOW | sqlglot/parser.py | 4171 | CODE | |
| LOW | sqlglot/parser.py | 4204 | CODE | |
| LOW | sqlglot/parser.py | 4318 | CODE | |
| LOW | sqlglot/parser.py | 4490 | CODE | |
| LOW | sqlglot/parser.py | 4696 | CODE | |
| LOW | sqlglot/parser.py | 4830 | CODE | |
| LOW | sqlglot/parser.py | 5238 | CODE | |
| LOW | sqlglot/parser.py | 5372 | CODE | |
| LOW | sqlglot/parser.py | 5573 | CODE | |
| LOW | sqlglot/parser.py | 5692 | CODE | |
| LOW | sqlglot/parser.py | 5793 | CODE | |
| LOW | sqlglot/parser.py | 5882 | CODE | |
| LOW | sqlglot/parser.py | 5959 | CODE | |
| LOW | sqlglot/parser.py | 6094 | CODE | |
| LOW | sqlglot/parser.py | 6127 | CODE | |
| LOW | sqlglot/parser.py | 6269 | CODE | |
| LOW | sqlglot/parser.py | 6631 | CODE | |
| LOW | sqlglot/parser.py | 6738 | CODE | |
| LOW | sqlglot/parser.py | 6798 | CODE | |
| LOW | sqlglot/parser.py | 6866 | CODE | |
| LOW | sqlglot/parser.py | 6904 | CODE | |
| LOW | sqlglot/parser.py | 6982 | CODE | |
| LOW | sqlglot/parser.py | 7360 | CODE | |
| LOW | sqlglot/parser.py | 7557 | CODE | |
| LOW | sqlglot/parser.py | 7889 | CODE | |
| LOW | sqlglot/parser.py | 8292 | CODE | |
| LOW | sqlglot/parser.py | 8911 | CODE | |
| LOW | sqlglot/parser.py | 9011 | CODE | |
| LOW | sqlglot/parser.py | 9110 | CODE | |
| LOW | sqlglot/parser.py | 9149 | CODE | |
| LOW | sqlglot/parser.py | 9209 | CODE | |
| LOW | sqlglot/parser.py | 9474 | CODE | |
| LOW | sqlglot/parser.py | 9589 | CODE | |
| LOW | sqlglot/generator.py | 2172 | CODE | |
| 128 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | sqlglot/time.py | 20 | Converts a time string given a mapping. Examples: >>> format_time("%Y", {"%Y": "YYYY"}) 'YYYY' | STRING |
| HIGH | sqlglot/helper.py | 277 | Perform a split on a value and return N words as a result with `None` used for words that don't exist. Args: | STRING |
| HIGH | sqlglot/helper.py | 304 | Checks if the value is an iterable, excluding the types `str` and `bytes`. Examples: >>> is_iterable([ | STRING |
| HIGH | sqlglot/helper.py | 325 | Flattens an iterable that can contain both iterable and non-iterable elements. Objects of type `str` and `bytes | STRING |
| HIGH | sqlglot/diff.py | 74 | Returns the list of changes between the source and the target expressions. Examples: >>> from sqlglot | STRING |
| HIGH | sqlglot/trie.py | 45 | Checks whether a key is in a trie. Examples: >>> in_trie(new_trie(["cat"]), "bob") (<TrieResul | STRING |
| HIGH | sqlglot/optimizer/qualify_columns.py | 31 | Rewrite sqlglot AST to have fully qualified columns. Example: >>> import sqlglot >>> schema = | STRING |
| HIGH | sqlglot/optimizer/qualify_tables.py | 24 | Rewrite sqlglot AST to have fully qualified tables. Join constructs such as (t1 JOIN t2) AS t will be expanded | STRING |
| HIGH | sqlglot/optimizer/scope.py | 632 | Traverse an expression by its "scopes". "Scope" represents the current context of a Select statement. Thi | STRING |
| HIGH | sqlglot/expressions/builders.py | 752 | Get the full name of a table as a string. Args: table: Table expression node or string. dialect: Th | STRING |
| HIGH | sqlglot/expressions/builders.py | 810 | Replace all tables in expression according to the mapping. Args: expression: expression node to be transfor | STRING |
| HIGH | sqlglot/expressions/builders.py | 848 | Replace placeholders in an expression. Args: expression: expression node to be transformed and replaced. | STRING |
| HIGH | sqlglot/expressions/builders.py | 889 | Transforms an expression by expanding all referenced sources into subqueries. Examples: >>> from sqlglot im | STRING |
| HIGH | sqlglot/expressions/builders.py | 932 | Returns a Func expression. Examples: >>> func("abs", 5).sql() 'ABS(5)' >>> func("cast | STRING |
| HIGH | sqlglot/expressions/builders.py | 1025 | Returns an array. Examples: >>> array(1, 'x').sql() 'ARRAY(1, x)' Args: expressio | STRING |
| HIGH | sqlglot/expressions/builders.py | 1055 | Returns an tuple. Examples: >>> tuple_(1, 'x').sql() '(1, x)' Args: expressions: | STRING |
| HIGH | sqlglot/expressions/query.py | 273 | Append to or set the WHERE expressions. Examples: >>> Select().select("x").from_("tbl").wh | STRING |
| HIGH | sqlglot/expressions/query.py | 1601 | Set the locking read mode for this expression. Examples: >>> Select().select("x").from_("t | STRING |
| HIGH | sqlglot/expressions/query.py | 1624 | Set hints for this expression. Examples: >>> Select().select("x").from_("tbl").hint("BROAD | STRING |
| HIGH | sqlglot/generators/duckdb.py | 909 | Compute the Monday-based day shift to align DATE_DIFF('WEEK', ...) coming from other dialects, e.g BigQuery's W | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | sqlglot/generator.py | 5275 | converted_style = sqlglot.dialects.tsql.TSQL.CONVERT_FORMAT_MAPPING.get(style_value) | CODE |
| CRITICAL⚡ | tests/test_parser.py | 1157 | sql = "a.b.c.d.e.f.g.foo()" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlglotc/setup.py | 82 | # Set MYPYPATH to the parent of the sqlglot source so mypy resolves | COMMENT |
| LOW | sqlglot/parsers/bigquery.py | 665 | # Check if this is ML.TRANSLATE by looking at previous tokens | COMMENT |
| LOW | sqlglot/parsers/bigquery.py | 673 | # Check if this is ML.FORECAST by looking at previous tokens. | COMMENT |
| LOW | sqlglot/optimizer/qualify_columns.py | 740 | # Check if current rhs identifier is in struct | COMMENT |
| LOW | sqlglot/dialects/dialect.py | 1511 | # Check if ANY argument is NULL and return NULL explicitly | COMMENT |
| LOW | sqlglot/dialects/dialect.py | 1591 | # Check if both are last day of month | COMMENT |
| LOW | sqlglot/generators/fabric.py | 79 | # Check if this is a temporal type that needs precision handling. Fabric limits temporal | COMMENT |
| LOW | sqlglot/generators/snowflake.py | 694 | # Check if this is a FLOAT type nested inside a VECTOR type | COMMENT |
| LOW | sqlglot/generators/snowflake.py | 1131 | # Set part_index to 1 if missing | COMMENT |
| LOW | sqlglot/generators/duckdb.py | 858 | # Check if we need NTZ (naive timestamp in UTC) | COMMENT |
| LOW | sqlglot/generators/duckdb.py | 2340 | # Check if we need the end of the slice (default is start) | STRING |
| LOW | sqlglot/generators/duckdb.py | 2746 | # Check if target_type requires TIMESTAMPTZ (for LTZ/TZ variants) | STRING |
| LOW | sqlglot/generators/duckdb.py | 2962 | # Check if values are within normal ranges - use MAKE_TIME for efficiency | STRING |
| LOW | sqlglot/generators/duckdb.py | 3062 | # Check if this is the date/time expression form: TIMESTAMP_FROM_PARTS(date_expr, time_expr) | STRING |
| LOW | sqlglot/generators/duckdb.py | 3731 | # Check if it's a text type (handles both literals and annotated expressions) | STRING |
| LOW | sqlglot/generators/duckdb.py | 3744 | # Check if input is a string type - ENCODE only accepts VARCHAR | STRING |
| LOW | sqlglot/generators/starrocks.py | 303 | # Verify if the first one is an engine property. Is true then insert it after the engine, | COMMENT |
| LOW | .github/scripts/integration_tests_sync.sh | 108 | # Check if there are local commits to push | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | sqlglot/lineage.py | 319 | # Create the node for this step in the lineage chain, and attach it to the previous one. | COMMENT |
| MEDIUM | sqlglot/expressions/builders.py | 916 | # Create a subquery with the same alias (or table name if no alias) | COMMENT |
| MEDIUM | sqlglot/generators/fabric.py | 82 | # Create a new expression with the capped precision | COMMENT |
| MEDIUM | sqlglot/generators/fabric.py | 141 | # Create the base datetime as '1970-01-01' cast to DATETIME2(6) | COMMENT |
| MEDIUM | sqlglot/generators/duckdb.py | 3895 | # Create a single-entry map for the new key-value pair | STRING |
| MEDIUM | .github/scripts/integration_tests_sync.sh | 127 | # Create a PR if one doesn't exist (requires gh CLI) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 11 | # for py3.10+; on py3.9 just use upstream mypy for type checking. | COMMENT |
| MEDIUM | sqlglot/parser.py | 6234 | # DECIMAL(38, 0)) in order to facilitate the data type's transpilation. | COMMENT |
| MEDIUM | sqlglot/generator.py | 408 | # Whether JOIN sides (LEFT, RIGHT) are supported in conjunction with SEMI/ANTI join kinds | COMMENT |
| MEDIUM | sqlglot/generators/snowflake.py | 343 | # This transformation is used to facilitate transpilation of BigQuery `UNNEST` operations | COMMENT |
| LOW | sqlglot/generators/duckdb.py | 3145 | # DuckDB doesn't, but we can just add a dummy ON clause that is always true | STRING |
| LOW | sqlglot/generators/duckdb.py | 3725 | # Default DuckDB behavior - just return RANDOM() as float | STRING |
| MEDIUM | tests/leakcheck.py | 337 | # harness that runs the suite multiple times. ``setdefault`` lets the | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlglotc/setup.py | 158 | except Exception as e: | CODE |
| LOW | pdoc/cli.py | 21 | except Exception: | CODE |
| LOW | sqlglot/tokenizer_core.py | 673 | except Exception as e: | CODE |
| LOW | sqlglot/tokenizer_core.py | 1091 | except Exception: | CODE |
| LOW | sqlglot/expressions/core.py | 1750 | except Exception: | CODE |
| LOW | sqlglot/executor/python.py | 58 | except Exception as e: | CODE |
| LOW | sqlglot/generators/python.py | 32 | except Exception as ex: | CODE |
| MEDIUM | sqlglot/generators/python.py | 17 | def _rename(self, e): | CODE |
| LOW | sqlglot/generators/duckdb.py | 1416 | except Exception: | STRING |
| LOW | tests/gen_fixtures.py | 572 | except Exception as e: | CODE |
| LOW | tests/test_docs.py | 20 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/dialects/test_spark.py | 717 | "SELECT RLIKE('John Doe', 'John.*')", | CODE |
| LOW⚡ | tests/dialects/test_spark.py | 719 | "bigquery": "SELECT REGEXP_CONTAINS('John Doe', 'John.*')", | CODE |
| LOW⚡ | tests/dialects/test_spark.py | 720 | "hive": "SELECT 'John Doe' RLIKE 'John.*'", | CODE |
| LOW⚡ | tests/dialects/test_spark.py | 721 | "postgres": "SELECT 'John Doe' ~ 'John.*'", | CODE |
| LOW⚡ | tests/dialects/test_spark.py | 722 | "snowflake": "SELECT REGEXP_LIKE('John Doe', 'John.*')", | CODE |
| LOW⚡ | tests/dialects/test_spark.py | 723 | "spark": "SELECT 'John Doe' RLIKE 'John.*'", | CODE |
| LOW | tests/dialects/test_postgres.py | 1034 | "SELECT PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY a) FILTER(WHERE CAST(b AS BOOLEAN)) AS mean_value FROM ( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | posts/ast_primer.md | 21 | # expressions=[ | COMMENT |
| LOW | posts/ast_primer.md | 261 | # x.a AS a, | COMMENT |
| LOW | sqlglot/parser.py | 1841 | COMMENT | |
| LOW | sqlglot/parser.py | 6221 | data_type = exp.DType.TIMESTAMPTZ.into_expr() | COMMENT |
| LOW | sqlglot/parser.py | 8381 | exp.Filter(this=this, expression=self._parse_where(skip_where_token=True)) | COMMENT |
| LOW | sqlglot/expressions/properties.py | 621 | # CREATE property locations | COMMENT |
| LOW | sqlglot/generators/clickhouse.py | 521 | # String is the standard ClickHouse type, every other variant is just an alias. | COMMENT |
| LOW | sqlglot/generators/duckdb.py | 2041 | # | COMMENT |
| LOW | sqlglot/generators/duckdb.py | 2061 | # | COMMENT |
| LOW | sqlglot/generators/duckdb.py | 2261 | # | COMMENT |
| LOW | sqlglot/generators/duckdb.py | 2281 | # | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlglot/planner.py | 146 | def set_ops_and_aggs(step) -> None: | CODE |
| LOW | sqlglot/optimizer/qualify_columns.py | 202 | def _update_source_columns(source_name: str) -> None: | CODE |
| LOW | sqlglot/expressions/core.py | 290 | def _set_parent(self, arg_key: str, value: object, index: int | None = None) -> None: | CODE |
| LOW | sqlglot/expressions/core.py | 1116 | def _set_parent(self, arg_key: str, value: object, index: int | None = None) -> None: | CODE |
| LOW⚡ | sqlglot/executor/context.py | 85 | def set_row(self, row: tuple) -> None: | CODE |
| LOW⚡ | sqlglot/executor/context.py | 90 | def set_index(self, index: int) -> None: | CODE |
| LOW⚡ | sqlglot/executor/context.py | 95 | def set_range(self, start: int, end: int) -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlglot/generator.py | 867 | CODE | |
| LOW | sqlglot/generator.py | 4669 | CODE | |
| LOW | sqlglot/generator.py | 5604 | CODE | |
| LOW | sqlglot/lineage.py | 196 | CODE | |
| LOW | sqlglot/optimizer/qualify.py | 19 | CODE | |
| LOW | sqlglot/generators/athena.py | 133 | CODE |