A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use.
This report presents the forensic synthetic code analysis of knex/knex, a JavaScript project with 20,322 GitHub stars. SynthScan v2.0 examined 122,779 lines of code across 477 source files, recording 412 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 3.8 places this repository in the Likely human-written 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 412 distinct pattern matches across 7 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 | test/integration2/schema/misc.spec.js | 882 | table.text('paragraph').defaultTo('Lorem ipsum Qui quis qui in.'); | CODE |
| LOW⚡ | test/integration2/schema/misc.spec.js | 895 | 'create table "test_table_three" ("main" integer not null, "paragraph" text default \'Lorem ipsum Qui | CODE |
| LOW⚡ | test/integration2/schema/misc.spec.js | 899 | 'create table "test_table_three" ("main" integer not null, "paragraph" varchar(max) default \'Lorem ipsu | CODE |
| LOW⚡ | test/integration2/schema/misc.spec.js | 903 | "create table `test_table_three` (`main` integer not null, `paragraph` text default 'Lorem ipsum Qui qui | CODE |
| LOW⚡ | test/integration2/schema/misc.spec.js | 906 | 'create table "test_table_three" ("main" integer not null, "paragraph" clob default \'Lorem ipsum Qui qu | CODE |
| LOW⚡ | test/integration2/schema/misc.spec.js | 910 | "CREATE TABLE [test_table_three] ([main] int not null, [paragraph] nvarchar(max) CONSTRAINT [test_table_ | CODE |
| LOW | test/integration2/schema/misc.spec.js | 925 | expect(result.paragraph).to.eql('Lorem ipsum Qui quis qui in.'); | CODE |
| LOW | test/integration2/query/misc/additional.spec.js | 363 | .insert({ balance_foo: 123, email_foo: 'foo@bar.com' }) | CODE |
| LOW | test/integration2/query/misc/additional.spec.js | 366 | expect(res).to.eql([{ balance_foo: 123, email_foo: 'foo@bar.com' }]); | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1044 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1054 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1061 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1070 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1080 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1087 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1096 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1109 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1118 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1125 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1162 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1170 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1180 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1191 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1201 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW⚡ | test/integration2/query/insert/inserts.spec.js | 1209 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 72 | about: 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 83 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 97 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 111 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 125 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 139 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 156 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 222 | about: 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 230 | about: 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 243 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 250 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 264 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 271 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 285 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 292 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 306 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 313 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 327 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 337 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 354 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 361 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 381 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum su | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 387 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum su | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 404 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 410 | 'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 439 | about: 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 446 | about: 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 461 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 468 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 482 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 489 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 503 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 510 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 524 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| LOW | test/integration2/query/insert/inserts.spec.js | 531 | 'Lorem ipsum Dolore labore incididunt enim.', | CODE |
| 297 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | test/integration2/dialects/sqlite.spec.js | 50 | ).to.eventually.be.fulfilled.and.deep.equal([{ 1: 1 }]); | CODE |
| CRITICAL | test/integration2/dialects/sqlite.spec.js | 65 | ).to.eventually.be.fulfilled.and.deep.equal([ | CODE |
| CRITICAL | test/integration2/dialects/sqlite.spec.js | 259 | ).to.eventually.be.fulfilled.and.deep.equal([{ 1: 1 }]); | CODE |
| CRITICAL | test/integration2/query/misc/additional.spec.js | 1240 | await expect(promise).to.eventually.be.rejected.and.to.deep.include( | CODE |
| CRITICAL | test/integration2/query/misc/additional.spec.js | 1329 | ).to.be.eventually.rejected.and.deep.include({ | CODE |
| CRITICAL | test/integration2/query/misc/additional.spec.js | 1351 | ).to.be.eventually.rejected.and.deep.include({ | CODE |
| CRITICAL | test/integration2/query/select/selects.spec.js | 268 | ).to.eventually.be.fulfilled.and.to.have.lengthOf(2); | CODE |
| CRITICAL | test/integration2/query/select/selects.spec.js | 271 | ).to.eventually.be.rejected.and.to.deep.include( | CODE |
| CRITICAL | test/cli/migrate-disable-transactions.spec.js | 57 | ).to.eventually.be.fulfilled.and.deep.equal([{ id: 1 }]); | CODE |
| CRITICAL | test/cli/migrate-disable-transactions.spec.js | 106 | ).to.eventually.be.fulfilled.and.deep.equal([{ id: 1 }]); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | test/integration2/pool/connection-pool.spec.js | 18 | // ── PostgreSQL with native pg.Pool ────────────────────────────── | COMMENT |
| MEDIUM | test/integration2/pool/connection-pool.spec.js | 117 | // ── PostgreSQL with shared KnexPool ───────────────────────────── | COMMENT |
| MEDIUM | test/integration2/pool/connection-pool.spec.js | 191 | // ── MySQL with native pool ────────────────────────────────────── | COMMENT |
| MEDIUM | test/integration2/pool/connection-pool.spec.js | 263 | // ── MySQL2 with native pool ───────────────────────────────────── | COMMENT |
| MEDIUM | test/unit/client/connection-pool.js | 26 | // ── Config validation ────────────────────────────────────────────── | COMMENT |
| MEDIUM | test/unit/client/connection-pool.js | 63 | // ── KnexPool class ──────────────────────────────────────────────── | COMMENT |
| MEDIUM | test/unit/client/connection-pool.js | 75 | // ── isTarnPool detection ────────────────────────────────────────── | COMMENT |
| MEDIUM | test/unit/client/connection-pool.js | 121 | // ── Base Client ─────────────────────────────────────────────────── | COMMENT |
| MEDIUM | test/unit/client/connection-pool.js | 170 | // ── Destroy behavior ────────────────────────────────────────────── | COMMENT |
| MEDIUM | test/unit/client/connection-pool.js | 209 | // ── PostgreSQL adapter ──────────────────────────────────────────── | COMMENT |
| MEDIUM | test/unit/client/connection-pool.js | 283 | // ── MySQL adapter ───────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | types/result.d.ts | 1 | // This empty interface serves as a placeholder which userland code can augment to | COMMENT |
| LOW | types/result.d.ts | 21 | // But the effective defaults are documented below: | COMMENT |
| LOW | types/tables.d.ts | 1 | // Placeholder interface for Table -> Record mapping | COMMENT |
| LOW | types/index.d.ts | 101 | // The base of selection. In intermediate stages this may be unknown. | COMMENT |
| LOW | types/index.d.ts | 2141 | } | COMMENT |
| LOW | test/integration2/migrate/migration-integration.spec.js | 341 | } | COMMENT |
| LOW | test/tape/pool.js | 141 | Array.from(Array(30)).map(() => { | COMMENT |
| LOW | test-tsd/types.test-d.ts | 41 | const knexInstance = knexDefault(clientConfig); | COMMENT |
| LOW | docs/src/guide/index.md | 741 | // So, this is like specifying | COMMENT |
| LOW | docs/src/guide/index.md | 761 | // when specifying separate update interface, user will be | COMMENT |
| LOW | scripts/build-for-release.sh | 1 | #!/bin/bash -e | COMMENT |
| LOW | scripts/revert-release-to-draft.sh | 1 | #!/bin/bash | COMMENT |
| LOW | .github/workflows/release.yml | 261 | # bytes attested are exactly the bytes uploaded. provenance binds | COMMENT |
| LOW | .github/workflows/release-drafter.yml | 81 | fi | COMMENT |
| LOW | lib/knex-builder/make-knex.js | 241 | // Allow chaining methods from the root object, before | COMMENT |
| LOW | lib/query/querycompiler.js | 81 | // For example, if a "having" clause is defined but we're executing a "delete" query, that | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/unit/knex.js | 411 | before(function skipSuiteIfSqliteConfigAbsent() { | CODE |
| LOW | test/unit/knex.js | 685 | before(function skipSuiteIfSqliteConfigAbsent() { | CODE |
| LOW | test/util/tableCreatorHelper.js | 88 | async function createParentAndChildTables(knex) { | CODE |
| LOW | test/integration/connection-config-provider.js | 87 | async function runTwoConcurrentTransactions(expectedInvocationCount) { | CODE |
| LOW | test/integration/execution/transaction.js | 478 | function expectQueryEventToHaveBeenTriggered() { | CODE |
| LOW | test/integration/execution/transaction.js | 598 | function captureAndRethrowOriginalError(err) { | CODE |
| LOW | bin/utils/cli-config-utils.js | 107 | function checkConfigurationOptions(env, opts) { | CODE |
| LOW | docs/.vitepress/knexDialects.ts | 342 | function renderMissingSnippetGroup( | CODE |
| LOW | docs/scripts/snippet-utils.d.ts | 11 | export function instrumentMarkedStatements( | CODE |
| LOW | lib/builder-interface-augmenter.js | 7 | function augmentWithBuilderInterface(Target) { | CODE |
| LOW | lib/util/helpers.js | 78 | function resolveClientNameWithAliases(clientName) { | CODE |
| LOW | lib/execution/internal/ensure-connection-callback.js | 16 | function ensureConnectionStreamCallback(runner, params) { | CODE |
| LOW | lib/dialects/oracle/schema/internal/incrementUtils.js | 4 | function createAutoIncrementTriggerAndSequence(columnCompiler) { | CODE |
| LOW | lib/dialects/sqlite3/schema/internal/compiler.js | 120 | function referencesColumnConstraint(ast, wrap) { | CODE |
| LOW | lib/dialects/sqlite3/schema/internal/parser.js | 244 | function referencesColumnConstraint(ctx) { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/.vitepress/theme/AlgoliaSearchBox.vue | 129 | // behavior to leverage the Router loading feature | COMMENT |
| MEDIUM | lib/knex-builder/make-knex.js | 14 | // into it. In other words: you can't leverage Prototype Inheritance | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/src/guide/migrations.md | 187 | // TODO: implement me | COMMENT |