B
Overall Health

knex/knex


https://github.com/knex/knex
2026-04-19 00:07:26
C
Dead code
20% orphan symbols (79/387)
A
Circular deps
0 cycles detected
C
Coupling
max fan-in: 25 (lib/util/is.js)
C
Security
3 concerns found

Overview

  • 465 files indexed
  • 1614 code symbols extracted
  • 21730 symbol references tracked
  • 0 active memories (0 core, 0 stale)
  • Languages: javascript (424), typescript (41)

God Nodes (most-referenced symbols)

These are the symbols your codebase depends on most. Changes here have the largest blast radius.

  • knex — 904 references
  • table — 578 references
  • User — 534 references
  • where — 340 references
  • createTable — 205 references
  • raw — 200 references
  • wrap — 179 references
  • pushQuery — 146 references
  • unique — 59 references
  • isPostgreSQL — 57 references

Hub Files (highest PageRank)

Core architectural files — imported by many others.

  • lib/util/is.js (1.00)
  • lib/constants.js (0.73)
  • lib/index.js (0.64)
  • lib/knex-builder/Knex.js (0.56)
  • lib/util/helpers.js (0.51)
  • test/integration2/util/knex-instance-provider.js (0.42)
  • test/util/db-helpers.js (0.40)
  • lib/query/querybuilder.js (0.30)
  • lib/formatter/wrappingFormatter.js (0.27)
  • lib/schema/internal/helpers.js (0.25)

Orphans (potential dead code)

Named classs with zero detected references. Could be dead code, public API exports, or referenced dynamically.

  • TableCompiler_Oraclelib/dialects/oracle/schema/oracle-tablecompiler.js:12
  • SchemaCompiler_PGlib/dialects/postgres/schema/pg-compiler.js:6
  • QueryCompiler_PGlib/dialects/postgres/query/pg-querycompiler.js:14
  • Client_Oraclelib/dialects/oracle/index.js:14
  • Client_CockroachDBlib/dialects/cockroachdb/index.js:14
  • Client_Oracledblib/dialects/oracledb/index.js:25
  • jsFileTemplatelib/migrations/util/template.js:25
  • ColumnCompiler_Oraclelib/dialects/oracle/schema/oracle-columncompiler.js:12
  • Client_MSSQLlib/dialects/mssql/index.js:24
  • slib/dialects/sqlite3/schema/internal/parser-combinator.js:2

Coupling (high-PageRank files)

  • lib/util/is.js (1.00)
  • lib/constants.js (0.73)
  • lib/index.js (0.64)
  • lib/knex-builder/Knex.js (0.56)
  • lib/util/helpers.js (0.51)

Security Issues (3 found)

High (3)

  • SQL injection (template literal)lib/query/querycompiler.js:1384
  • data[column] = this.client.raw(?? ${symbol} ?, [column, value]);
  • SQL injection (template literal)lib/dialects/postgres/index.js:182
  • connection.query(set search_path to ${path}, function (err) {
  • SQL injection (template literal)lib/knex-builder/FunctionHelper.js:12
  • return this.client.raw(CURRENT_TIMESTAMP(${precision}));

Suggested Next Steps

  • Before refactoring knex, run sverklo_impact to see the 904 call sites
  • lib/util/is.js is your most-imported file — changes here cascade widely
  • 15+ potential orphans detected — audit for dead code