loadwise 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PERFORMANCE.md +17 -0
- package/README.md +238 -705
- package/agent/hooks/check-edited-file.mjs +682 -0
- package/dist/bin/github-action.js +143 -18
- package/dist/bin/loadwise.js +27 -52
- package/dist/lib/accessibility/analyze.js +5 -3
- package/dist/lib/accessibility/angular-inline.js +9 -11
- package/dist/lib/accessibility/angular-literal.js +39 -0
- package/dist/lib/accessibility/astro-template.js +111 -0
- package/dist/lib/accessibility/autofocus.js +94 -0
- package/dist/lib/accessibility/document-reference-rules.js +133 -0
- package/dist/lib/accessibility/form-context.js +41 -0
- package/dist/lib/accessibility/frame-head.js +92 -0
- package/dist/lib/accessibility/frame-viewport.js +149 -0
- package/dist/lib/accessibility/frontend-detect.js +18 -8
- package/dist/lib/accessibility/heading-order.js +59 -0
- package/dist/lib/accessibility/interaction-semantics.js +90 -0
- package/dist/lib/accessibility/jinja-template.js +150 -0
- package/dist/lib/accessibility/jsx-elements.js +147 -12
- package/dist/lib/accessibility/language-tags.js +18 -0
- package/dist/lib/accessibility/markup-files.js +49 -17
- package/dist/lib/accessibility/markup.js +4 -1
- package/dist/lib/accessibility/media-rules.js +81 -0
- package/dist/lib/accessibility/native-interactive.js +107 -0
- package/dist/lib/accessibility/rule-ids.js +33 -0
- package/dist/lib/accessibility/rule-utilities.js +92 -0
- package/dist/lib/accessibility/rules.js +176 -154
- package/dist/lib/accessibility/site-fixes/buttons.js +9 -12
- package/dist/lib/accessibility/site-fixes/email-autocomplete.js +103 -0
- package/dist/lib/accessibility/site-fixes/html-language.js +48 -0
- package/dist/lib/accessibility/site-fixes/media-autoplay.js +87 -0
- package/dist/lib/accessibility/site-fixes/positive-tabindex.js +102 -0
- package/dist/lib/accessibility/site-fixes/source-position.js +11 -0
- package/dist/lib/accessibility/site-fixes/viewport.js +107 -0
- package/dist/lib/accessibility/table-headers.js +70 -0
- package/dist/lib/accessibility/template-attributes.js +18 -5
- package/dist/lib/accessibility/template-binding-scope.js +122 -0
- package/dist/lib/accessibility/template-elements.js +278 -111
- package/dist/lib/accessibility/template-file.js +145 -41
- package/dist/lib/accessibility/template-tag-tables.js +86 -0
- package/dist/lib/accessibility/usage.js +1 -1
- package/dist/lib/editor/accessibility-examples.js +11 -1
- package/dist/lib/editor/actions.js +57 -12
- package/dist/lib/editor/apply-fix.js +99 -6
- package/dist/lib/editor/configured-setup.js +14 -17
- package/dist/lib/editor/diagnostics.js +215 -43
- package/dist/lib/editor/dismissals.js +104 -34
- package/dist/lib/editor/doctor.js +167 -0
- package/dist/lib/editor/editor-document.js +22 -3
- package/dist/lib/editor/editor-launcher.js +67 -28
- package/dist/lib/editor/fix-edits.js +87 -8
- package/dist/lib/editor/jetbrains-setup.js +2 -1
- package/dist/lib/editor/language-server.js +279 -67
- package/dist/lib/editor/native-setup.js +10 -4
- package/dist/lib/editor/perf-watch.js +12 -8
- package/dist/lib/editor/performance-examples.js +31 -0
- package/dist/lib/editor/polyglot-selection.js +193 -0
- package/dist/lib/editor/project-policy.js +146 -0
- package/dist/lib/editor/project-watches.js +86 -0
- package/dist/lib/editor/release-vsix.js +23 -1
- package/dist/lib/editor/reliability-examples.js +51 -0
- package/dist/lib/editor/scan-session.js +237 -67
- package/dist/lib/editor/security-examples.js +24 -14
- package/dist/lib/editor/server-commands.js +60 -20
- package/dist/lib/editor/setup-server.js +1 -1
- package/dist/lib/editor/setup-vim.js +6 -4
- package/dist/lib/editor/setup.js +7 -12
- package/dist/lib/editor/standalone-performance-examples.js +3 -0
- package/dist/lib/editor/workspace-files.js +93 -15
- package/dist/lib/editor/workspace-paths.js +69 -7
- package/dist/lib/editor/zed-settings.js +118 -0
- package/dist/lib/editor/zed-setup.js +88 -0
- package/dist/lib/maintainability/analysis/analyze-source.js +7 -4
- package/dist/lib/maintainability/analysis/source-exclusions.js +2 -1
- package/dist/lib/maintainability/analysis/source-facts.js +2 -2
- package/dist/lib/maintainability/architecture/architecture.js +4 -4
- package/dist/lib/maintainability/architecture/graph.js +2 -1
- package/dist/lib/maintainability/architecture/layout.js +2 -1
- package/dist/lib/maintainability/cli/apply-fix.js +32 -7
- package/dist/lib/maintainability/cli/changed-lines.js +14 -102
- package/dist/lib/maintainability/cli/finding-ids.js +3 -6
- package/dist/lib/maintainability/cli/fix-cli.js +1 -9
- package/dist/lib/maintainability/cli/git-inventory.js +5 -6
- package/dist/lib/maintainability/cli/inputs.js +21 -12
- package/dist/lib/maintainability/cli/scan-arguments.js +33 -0
- package/dist/lib/maintainability/cli/site-fix.js +28 -13
- package/dist/lib/maintainability/cli.js +29 -35
- package/dist/lib/maintainability/entry-points/entry-points.js +52 -64
- package/dist/lib/maintainability/entry-points/html-entry-points.js +5 -1
- package/dist/lib/maintainability/examples.js +12 -0
- package/dist/lib/maintainability/polyglot-duplicates.js +1 -0
- package/dist/lib/maintainability/polyglot.js +337 -12
- package/dist/lib/maintainability/project.js +4 -4
- package/dist/lib/maintainability/quality/console-tooling.js +114 -0
- package/dist/lib/maintainability/quality/declarative-imports.js +18 -0
- package/dist/lib/maintainability/quality/deprecated-apis.js +227 -40
- package/dist/lib/maintainability/quality/duplicates.js +5 -11
- package/dist/lib/maintainability/quality/functions.js +9 -6
- package/dist/lib/maintainability/quality/generic-assertion-target.js +75 -0
- package/dist/lib/maintainability/quality/limits.js +23 -0
- package/dist/lib/maintainability/quality/size-limits.js +10 -3
- package/dist/lib/maintainability/quality/stray-console.js +93 -8
- package/dist/lib/maintainability/quality/tsconfig-strict.js +127 -6
- package/dist/lib/maintainability/quality/type-escape-hatches.js +411 -0
- package/dist/lib/maintainability/quality/type-safety-hygiene.js +132 -42
- package/dist/lib/maintainability/quality/unowned-source.js +15 -0
- package/dist/lib/maintainability/rule-ids.js +9 -0
- package/dist/lib/maintainability/scan-changed.js +10 -2
- package/dist/lib/maintainability/scan-worker.js +9 -7
- package/dist/lib/maintainability/scan.js +36 -10
- package/dist/lib/maintainability/site-fixes/duplicate-edits.js +3 -2
- package/dist/lib/maintainability/site-fixes/duplicate-methods.js +7 -2
- package/dist/lib/maintainability/site-fixes/duplicates.js +3 -2
- package/dist/lib/maintainability/site-fixes/focused-test.js +230 -0
- package/dist/lib/maintainability/site-fixes/helpers.js +2 -6
- package/dist/lib/maintainability/site-fixes/if-rewrites.js +1 -7
- package/dist/lib/maintainability/site-fixes/large-module.js +2 -1
- package/dist/lib/maintainability/unused/ancestor-aliases.js +2 -2
- package/dist/lib/maintainability/unused/module-usage-dynamic.js +2 -1
- package/dist/lib/maintainability/unused/module-usage-named-exports.js +125 -0
- package/dist/lib/maintainability/unused/module-usage.js +51 -24
- package/dist/lib/maintainability/unused/unused-modules.js +40 -11
- package/dist/lib/performance/analysis/call-syntax.js +2 -1
- package/dist/lib/performance/analysis/function-kinds.js +1 -5
- package/dist/lib/performance/analysis/missing-packages.js +10 -7
- package/dist/lib/performance/analysis/package-types.js +10 -2
- package/dist/lib/performance/analysis/schema-tooling.js +157 -8
- package/dist/lib/performance/analysis/source-inputs.js +23 -13
- package/dist/lib/performance/analysis/source-options.js +7 -6
- package/dist/lib/performance/analysis/unscanned-javascript.js +6 -5
- package/dist/lib/performance/analyze.js +35 -6
- package/dist/lib/performance/async/async-errors.js +162 -14
- package/dist/lib/performance/async/await-before-early-exit.js +1 -6
- package/dist/lib/performance/async/floating-promises.js +2 -2
- package/dist/lib/performance/async/promise-return-escapes-catch.js +35 -2
- package/dist/lib/performance/async/stream-errors.js +1 -3
- package/dist/lib/performance/cli/changed-lines.js +14 -111
- package/dist/lib/performance/cli/cli-arguments.js +11 -9
- package/dist/lib/performance/cli/cli-markup.js +42 -0
- package/dist/lib/performance/cli/cli-output.js +1 -0
- package/dist/lib/performance/cli/cli-policy.js +150 -16
- package/dist/lib/performance/cli/cli-scan.js +155 -106
- package/dist/lib/performance/cli/finding-ids.js +7 -7
- package/dist/lib/performance/cli/fix-cli.js +83 -34
- package/dist/lib/performance/cli/prisma-schema-findings.js +23 -0
- package/dist/lib/performance/cli/watch-security.js +33 -0
- package/dist/lib/performance/cli/watch.js +17 -9
- package/dist/lib/performance/cli.js +15 -9
- package/dist/lib/performance/collections/array-drains.js +354 -0
- package/dist/lib/performance/collections/collection-bindings.js +1 -2
- package/dist/lib/performance/collections/collection-bounds.js +3 -2
- package/dist/lib/performance/collections/collection-copy.js +51 -1
- package/dist/lib/performance/collections/collection-lookups.js +47 -3
- package/dist/lib/performance/collections/collection-reduce.js +0 -4
- package/dist/lib/performance/collections/collections.js +6 -2
- package/dist/lib/performance/collections/json-clone.js +137 -17
- package/dist/lib/performance/collections/memory-growth.js +55 -12
- package/dist/lib/performance/collections/regex-allocation.js +156 -0
- package/dist/lib/performance/collections/repeated.js +2 -8
- package/dist/lib/performance/collections/sort-extreme.js +18 -1
- package/dist/lib/performance/collections/workbook-decodes.js +3 -2
- package/dist/lib/performance/contracts/cli.js +329 -21
- package/dist/lib/performance/contracts/git-files.js +57 -5
- package/dist/lib/performance/contracts/openapi-schema.js +187 -0
- package/dist/lib/performance/contracts/openapi-sources.js +260 -0
- package/dist/lib/performance/contracts/openapi.js +175 -227
- package/dist/lib/performance/contracts/protobuf.js +301 -0
- package/dist/lib/performance/contracts/trpc-moves.js +46 -0
- package/dist/lib/performance/contracts/trpc.js +477 -0
- package/dist/lib/performance/datastores/pg-integrity.js +63 -23
- package/dist/lib/performance/datastores/pg-session-release.js +114 -0
- package/dist/lib/performance/datastores/pg-session-sql.js +144 -0
- package/dist/lib/performance/datastores/pooling.js +58 -3
- package/dist/lib/performance/datastores/redis-keys.js +4 -3
- package/dist/lib/performance/datastores/redis.js +102 -19
- package/dist/lib/performance/datastores/repeated-reads.js +104 -0
- package/dist/lib/performance/datastores/search-clients.js +9 -0
- package/dist/lib/performance/datastores/session-store.js +166 -6
- package/dist/lib/performance/datastores/supabase.js +73 -0
- package/dist/lib/performance/db/checks.js +19 -8
- package/dist/lib/performance/db/cli-mysql.js +12 -2
- package/dist/lib/performance/db/cli.js +38 -5
- package/dist/lib/performance/db/drivers.js +20 -4
- package/dist/lib/performance/db/gateway.js +3 -1
- package/dist/lib/performance/db/measure.js +1 -1
- package/dist/lib/performance/db/mysql-catalog.js +1 -1
- package/dist/lib/performance/db/plan-estimates.js +50 -11
- package/dist/lib/performance/db/redact.js +1 -3
- package/dist/lib/performance/db/snapshot.js +1 -1
- package/dist/lib/performance/db/sqlite-plan.js +95 -0
- package/dist/lib/performance/engine/compiler.js +3 -2
- package/dist/lib/performance/engine/native-checker.js +85 -10
- package/dist/lib/performance/engine/native-syntax.js +17 -0
- package/dist/lib/performance/engine/native-workspaces.js +36 -8
- package/dist/lib/performance/engine/native.js +47 -21
- package/dist/lib/performance/engine/review-config-inputs.js +57 -0
- package/dist/lib/performance/evidence/plans.js +21 -21
- package/dist/lib/performance/evidence/trace-formats.js +182 -0
- package/dist/lib/performance/evidence/traces.js +27 -7
- package/dist/lib/performance/frontend/angular-bootstrap.js +309 -0
- package/dist/lib/performance/frontend/angular-teardown.js +96 -0
- package/dist/lib/performance/frontend/barrel-subpaths.js +204 -0
- package/dist/lib/performance/frontend/effect-cleanup.js +174 -0
- package/dist/lib/performance/frontend/frontend-dom-perf.js +25 -9
- package/dist/lib/performance/frontend/frontend-helpers.js +1 -9
- package/dist/lib/performance/frontend/frontend-perf.js +76 -62
- package/dist/lib/performance/frontend/frontend-render-perf.js +10 -10
- package/dist/lib/performance/frontend/layout-binary-probe.js +186 -0
- package/dist/lib/performance/frontend/next-fetch-waterfall.js +88 -0
- package/dist/lib/performance/frontend/template-tracking.js +131 -0
- package/dist/lib/performance/index-rules/index-rules-table.js +3 -3
- package/dist/lib/performance/index-rules/redundant-indexes.js +6 -13
- package/dist/lib/performance/migrations/cli.js +65 -14
- package/dist/lib/performance/migrations/discover.js +63 -32
- package/dist/lib/performance/migrations/enforce.js +5 -12
- package/dist/lib/performance/migrations/extract-code-sql.js +19 -4
- package/dist/lib/performance/migrations/extract-code.js +14 -5
- package/dist/lib/performance/migrations/extract-sql.js +126 -41
- package/dist/lib/performance/migrations/extract-sqlite.js +302 -0
- package/dist/lib/performance/migrations/operations.js +175 -18
- package/dist/lib/performance/migrations/postgres-lock-timeout.js +52 -0
- package/dist/lib/performance/migrations/postgres-registry.js +127 -26
- package/dist/lib/performance/migrations/postgres-settings.js +78 -0
- package/dist/lib/performance/migrations/postgres-table-history.js +147 -0
- package/dist/lib/performance/migrations/rules-postgres-add-column.js +3 -3
- package/dist/lib/performance/migrations/rules-postgres-shared.js +12 -5
- package/dist/lib/performance/migrations/rules-postgres.js +155 -52
- package/dist/lib/performance/migrations/rules-sqlite.js +118 -0
- package/dist/lib/performance/migrations/sqlserver-creation.js +131 -0
- package/dist/lib/performance/migrations/sqlserver.js +81 -0
- package/dist/lib/performance/models/client-imports.js +286 -0
- package/dist/lib/performance/models/index.js +46 -8
- package/dist/lib/performance/orm/cartesian-includes.js +49 -22
- package/dist/lib/performance/orm/drizzle.js +86 -27
- package/dist/lib/performance/orm/knex-loop-operations.js +96 -0
- package/dist/lib/performance/orm/offset-pagination.js +6 -4
- package/dist/lib/performance/orm/orm-owners.js +3 -5
- package/dist/lib/performance/orm/orm-queries.js +50 -152
- package/dist/lib/performance/orm/orm-result-uses.js +116 -0
- package/dist/lib/performance/orm/prisma-aggregates.js +69 -18
- package/dist/lib/performance/orm/prisma-integrity.js +24 -3
- package/dist/lib/performance/orm/prisma.js +31 -8
- package/dist/lib/performance/orm/typeorm-batch-filter.js +43 -0
- package/dist/lib/performance/orm/typeorm-projection.js +2 -2
- package/dist/lib/performance/orm/typeorm-transaction-loops.js +3 -4
- package/dist/lib/performance/orm/typeorm-updates.js +1 -3
- package/dist/lib/performance/orm/unbounded-list-chain.js +29 -0
- package/dist/lib/performance/orm/unbounded-list-page-size.js +179 -0
- package/dist/lib/performance/orm/unbounded-list-queries.js +81 -159
- package/dist/lib/performance/polyglot.js +261 -52
- package/dist/lib/performance/probe-caches.js +42 -0
- package/dist/lib/performance/program-batches.js +138 -0
- package/dist/lib/performance/projects.js +86 -90
- package/dist/lib/performance/query-loops/guard-queries.js +2 -1
- package/dist/lib/performance/query-loops/parallel-reads-policy.js +1 -3
- package/dist/lib/performance/query-loops/query-loop-batch.js +81 -7
- package/dist/lib/performance/query-loops/query-loop-bounds.js +1 -13
- package/dist/lib/performance/query-loops/query-policy.js +19 -20
- package/dist/lib/performance/query-loops/query-results.js +1 -6
- package/dist/lib/performance/query-loops/query-write-context.js +89 -0
- package/dist/lib/performance/query-loops/sequential-loops.js +7 -24
- package/dist/lib/performance/query-loops/service-call-resolution.js +17 -2
- package/dist/lib/performance/query-loops/service-loop-source.js +124 -0
- package/dist/lib/performance/query-loops/service-loops.js +48 -17
- package/dist/lib/performance/query-loops/throw-on-miss-loops.js +141 -0
- package/dist/lib/performance/request/backend-mastery.js +160 -63
- package/dist/lib/performance/request/fixed-emitter-loop.js +98 -0
- package/dist/lib/performance/request/fresh-mapped-elements.js +137 -0
- package/dist/lib/performance/request/graphql-list-lookups.js +258 -0
- package/dist/lib/performance/request/http-options-writes.js +2 -8
- package/dist/lib/performance/request/http-timeouts.js +3 -2
- package/dist/lib/performance/request/json-stringify-output.js +139 -0
- package/dist/lib/performance/request/llm-max-tokens.js +27 -8
- package/dist/lib/performance/request/mongoose-lean.js +190 -20
- package/dist/lib/performance/request/node-event-listener-leak.js +190 -35
- package/dist/lib/performance/request/node-fs-context.js +6 -8
- package/dist/lib/performance/request/node-fs.js +4 -6
- package/dist/lib/performance/request/password-hashing.js +4 -3
- package/dist/lib/performance/request/phase5-ast.js +3 -9
- package/dist/lib/performance/request/phase5-rules.js +124 -115
- package/dist/lib/performance/request/pure-js-hashing.js +2 -1
- package/dist/lib/performance/request/request-handlers.js +1 -3
- package/dist/lib/performance/request/request-inputs.js +121 -26
- package/dist/lib/performance/request/sql-select-star.js +150 -0
- package/dist/lib/performance/request/unbounded-promise-all.js +186 -32
- package/dist/lib/performance/request/upload-limits.js +5 -1
- package/dist/lib/performance/rule-ids.js +47 -4
- package/dist/lib/performance/schema/context.js +7 -16
- package/dist/lib/performance/schema/model.js +1 -9
- package/dist/lib/performance/schema/prisma-owners.js +15 -1
- package/dist/lib/performance/schema/prisma-schema.js +5 -6
- package/dist/lib/performance/schema/project-indexes-events.js +8 -2
- package/dist/lib/performance/schema/project-indexes.js +4 -2
- package/dist/lib/performance/schema/query-site-support.js +1 -1
- package/dist/lib/performance/schema/sequelize-schema.js +1 -3
- package/dist/lib/performance/schema/ts-helpers.js +3 -7
- package/dist/lib/performance/shared-libs.js +48 -0
- package/dist/lib/performance/site-fix.js +36 -11
- package/dist/lib/performance/site-fixes/backend-mastery-fixes.js +298 -16
- package/dist/lib/performance/site-fixes/collection-copy.js +2 -1
- package/dist/lib/performance/site-fixes/collection-existence.js +2 -1
- package/dist/lib/performance/site-fixes/collection-find.js +2 -1
- package/dist/lib/performance/site-fixes/collection-helpers.js +0 -6
- package/dist/lib/performance/site-fixes/collection-lookups.js +2 -1
- package/dist/lib/performance/site-fixes/database.js +7 -16
- package/dist/lib/performance/site-fixes/drizzle-index.js +2 -9
- package/dist/lib/performance/site-fixes/frontend-fixes.js +397 -25
- package/dist/lib/performance/site-fixes/helpers.js +19 -18
- package/dist/lib/performance/site-fixes/last-insert-id.js +2 -1
- package/dist/lib/performance/site-fixes/llm-max-tokens.js +56 -0
- package/dist/lib/performance/site-fixes/migration-column-rules.js +11 -7
- package/dist/lib/performance/site-fixes/migration-context.js +8 -1
- package/dist/lib/performance/site-fixes/migration-lock-rules.js +72 -33
- package/dist/lib/performance/site-fixes/migrations.js +4 -0
- package/dist/lib/performance/site-fixes/prisma-aggregates.js +29 -9
- package/dist/lib/performance/site-fixes/pure-js-hashing.js +2 -2
- package/dist/lib/performance/site-fixes/query-shapes.js +1 -4
- package/dist/lib/performance/site-fixes/service-loop-ast.js +1 -9
- package/dist/lib/performance/site-fixes/small-rewrites.js +194 -10
- package/dist/lib/performance/site-fixes/sync-calls.js +14 -12
- package/dist/lib/performance/site-fixes/template-tracking-fixes.js +82 -0
- package/dist/lib/performance/site-fixes/upload-limits.js +13 -7
- package/dist/lib/performance/site-fixes/writes.js +1 -6
- package/dist/lib/performance/sql/local-statements.js +108 -0
- package/dist/lib/performance/sql/mysql-tokens.js +39 -16
- package/dist/lib/performance/sql/pg-parser.js +3 -5
- package/dist/lib/performance/sql/sqlserver-control.js +43 -0
- package/dist/lib/reliability/analyze.js +48 -5
- package/dist/lib/reliability/boundary-access.js +146 -82
- package/dist/lib/reliability/callback-completion.js +10 -2
- package/dist/lib/reliability/child-process.js +2 -2
- package/dist/lib/reliability/crlf-line-split.js +124 -73
- package/dist/lib/reliability/crlf-references.js +78 -0
- package/dist/lib/reliability/default-numeric-sort.js +25 -0
- package/dist/lib/reliability/error-cause-plan.js +29 -0
- package/dist/lib/reliability/error-values.js +68 -27
- package/dist/lib/reliability/json-cast.js +368 -0
- package/dist/lib/reliability/key-test-callee.js +50 -0
- package/dist/lib/reliability/lossy-text-rewrite.js +94 -0
- package/dist/lib/reliability/manifest-boundary.js +466 -0
- package/dist/lib/reliability/manifest-snapshot.js +40 -0
- package/dist/lib/reliability/parse-failure-flow.js +5 -2
- package/dist/lib/reliability/parse-failure-paths.js +39 -8
- package/dist/lib/reliability/parse-failure-reset.js +5 -17
- package/dist/lib/reliability/pool-timeout.js +31 -7
- package/dist/lib/reliability/promise-usage.js +281 -0
- package/dist/lib/reliability/react-bugs.js +19 -4
- package/dist/lib/reliability/react-state-order.js +2 -2
- package/dist/lib/reliability/react-state-paths.js +2 -2
- package/dist/lib/reliability/react-state-setter.js +5 -11
- package/dist/lib/reliability/react-state-walker.js +3 -3
- package/dist/lib/reliability/required-member.js +19 -0
- package/dist/lib/reliability/resource-leak-intervals.js +255 -0
- package/dist/lib/reliability/resource-leaks.js +211 -200
- package/dist/lib/reliability/rule-ids.js +80 -2
- package/dist/lib/reliability/same-file-io.js +135 -0
- package/dist/lib/reliability/short-write.js +220 -0
- package/dist/lib/reliability/site-fixes/crlf-line-split.js +71 -0
- package/dist/lib/reliability/site-fixes/error-values.js +40 -0
- package/dist/lib/reliability/site-fixes/pool-timeout.js +51 -0
- package/dist/lib/reliability/site-fixes/resource-leaks.js +16 -1
- package/dist/lib/reliability/source-helpers.js +18 -8
- package/dist/lib/reliability/standalone-sources.js +8 -6
- package/dist/lib/reliability/suspicious-logic.js +6 -8
- package/dist/lib/reliability/swallowed-errors.js +110 -28
- package/dist/lib/reliability/switch-exhaustive.js +195 -5
- package/dist/lib/reliability/test-cleanup-after-await.js +94 -20
- package/dist/lib/reliability/throw-string-plan.js +121 -0
- package/dist/lib/reliability/uncaught-exception.js +2 -7
- package/dist/lib/reliability/usage.js +1 -1
- package/dist/lib/reliability/walk.js +3 -2
- package/dist/lib/reliability/working-directory.js +101 -0
- package/dist/lib/security/analyze.js +2 -0
- package/dist/lib/security/auth-crypto/hashing.js +45 -12
- package/dist/lib/security/auth-crypto/index.js +6 -1
- package/dist/lib/security/auth-crypto/jwt-decode-helpers.js +163 -0
- package/dist/lib/security/auth-crypto/jwt.js +58 -27
- package/dist/lib/security/auth-crypto/plaintext-password.js +2 -1
- package/dist/lib/security/auth-crypto/random.js +2 -1
- package/dist/lib/security/auth-crypto/rate-limits.js +79 -8
- package/dist/lib/security/auth-crypto/rule-ids.js +2 -0
- package/dist/lib/security/auth-crypto/secrets.js +54 -3
- package/dist/lib/security/auth-crypto/shared.js +4 -5
- package/dist/lib/security/auth-crypto/signature-verification.js +29 -0
- package/dist/lib/security/auth-crypto/signing-algorithm.js +79 -0
- package/dist/lib/security/auth-crypto/transport-and-ciphers.js +128 -4
- package/dist/lib/security/auth-crypto/weak-hash.js +183 -0
- package/dist/lib/security/bindings.js +41 -9
- package/dist/lib/security/cli.js +87 -26
- package/dist/lib/security/cookie-credentials.js +115 -0
- package/dist/lib/security/cookie-csrf.js +550 -0
- package/dist/lib/security/deps/advisory.js +50 -109
- package/dist/lib/security/deps/cargo-lock.js +78 -0
- package/dist/lib/security/deps/cli.js +4 -4
- package/dist/lib/security/deps/cvss-score.js +14 -0
- package/dist/lib/security/deps/fixed-version.js +97 -0
- package/dist/lib/security/deps/lockfiles.js +335 -86
- package/dist/lib/security/deps/osv.js +200 -61
- package/dist/lib/security/deps/scan.js +121 -26
- package/dist/lib/security/deps/yarn-lock.js +158 -0
- package/dist/lib/security/examples/{auth-crypto.cjs → auth-crypto.js} +11 -5
- package/dist/lib/security/examples/{deps.cjs → deps.js} +1 -3
- package/dist/lib/security/examples/{exposure.cjs → exposure.js} +17 -3
- package/dist/lib/security/examples/{files.cjs → files.js} +9 -3
- package/dist/lib/security/examples/{injection.cjs → injection.js} +17 -3
- package/dist/lib/security/examples/{moved.cjs → moved.js} +1 -3
- package/dist/lib/security/examples/{request-forgery.cjs → request-forgery.js} +1 -3
- package/dist/lib/security/exposure/backend-security-mastery.js +2 -1
- package/dist/lib/security/exposure/client-env.js +2 -1
- package/dist/lib/security/exposure/content-disposition.js +71 -0
- package/dist/lib/security/exposure/cookies.js +217 -3
- package/dist/lib/security/exposure/cors-origin-regex.js +2 -3
- package/dist/lib/security/exposure/cors.js +63 -4
- package/dist/lib/security/exposure/frontend-security.js +28 -74
- package/dist/lib/security/exposure/index.js +9 -0
- package/dist/lib/security/exposure/js-yaml.js +203 -0
- package/dist/lib/security/exposure/jsx-url.js +18 -33
- package/dist/lib/security/exposure/logging.js +49 -10
- package/dist/lib/security/exposure/message-effects.js +266 -0
- package/dist/lib/security/exposure/package-manifest.js +2 -2
- package/dist/lib/security/exposure/prototype-pollution.js +152 -57
- package/dist/lib/security/exposure/react-html.js +26 -0
- package/dist/lib/security/exposure/reflected-xss.js +81 -17
- package/dist/lib/security/exposure/response-content-type.js +181 -0
- package/dist/lib/security/exposure/rule-ids.js +4 -0
- package/dist/lib/security/exposure/trust-boundary.js +142 -0
- package/dist/lib/security/exposure/url-secrets.js +38 -2
- package/dist/lib/security/exposure/webhook-verification.js +231 -0
- package/dist/lib/security/express-registration.js +45 -0
- package/dist/lib/security/express-router-factories.js +118 -0
- package/dist/lib/security/files/component-markup.js +66 -0
- package/dist/lib/security/files/compose.js +128 -2
- package/dist/lib/security/files/dockerfile.js +62 -4
- package/dist/lib/security/files/index.js +122 -28
- package/dist/lib/security/files/kubernetes.js +136 -0
- package/dist/lib/security/files/project-files.js +98 -31
- package/dist/lib/security/files/rule-ids.js +2 -0
- package/dist/lib/security/files/secrets.js +9 -5
- package/dist/lib/security/injection/code.js +33 -5
- package/dist/lib/security/injection/command.js +97 -22
- package/dist/lib/security/injection/escape-preserving.js +219 -0
- package/dist/lib/security/injection/escape-replace.js +174 -2
- package/dist/lib/security/injection/index.js +7 -1
- package/dist/lib/security/injection/ldap.js +86 -0
- package/dist/lib/security/injection/nosql.js +29 -5
- package/dist/lib/security/injection/redos.js +26 -5
- package/dist/lib/security/injection/rule-ids.js +4 -0
- package/dist/lib/security/injection/shared.js +5 -1
- package/dist/lib/security/injection/shell-output-guard.js +97 -0
- package/dist/lib/security/injection/sql.js +79 -13
- package/dist/lib/security/injection/xpath.js +35 -0
- package/dist/lib/security/lexical-declaration.js +113 -0
- package/dist/lib/security/pg-dynamic-query.js +28 -1
- package/dist/lib/security/pg-identifier-guards.js +164 -8
- package/dist/lib/security/phase5-rules.js +27 -135
- package/dist/lib/security/polyglot.js +35 -3
- package/dist/lib/security/provider-credentials.js +29 -0
- package/dist/lib/security/redirect-settings.js +223 -0
- package/dist/lib/security/request-forgery/contained-helper.js +75 -0
- package/dist/lib/security/request-forgery/open-redirect-query.js +2 -1
- package/dist/lib/security/request-forgery/open-redirect.js +43 -7
- package/dist/lib/security/request-forgery/parsed-host-guard.js +213 -0
- package/dist/lib/security/request-forgery/path-traversal.js +120 -7
- package/dist/lib/security/request-forgery/shared.js +187 -33
- package/dist/lib/security/request-forgery/ssrf.js +319 -13
- package/dist/lib/security/rule-descriptions.js +21 -1
- package/dist/lib/security/rule-ids.js +28 -0
- package/dist/lib/security/scope/drizzle-policy.js +2 -1
- package/dist/lib/security/scope/kysely-policy.js +173 -0
- package/dist/lib/security/site-fixes/auth-crypto.js +8 -79
- package/dist/lib/security/site-fixes/exposure.js +21 -3
- package/dist/lib/security/site-fixes/files.js +11 -13
- package/dist/lib/security/site-fixes/frontend-security-fixes.js +2 -2
- package/dist/lib/security/site-fixes/injection.js +17 -4
- package/dist/lib/security/site-fixes/jwt.js +1 -20
- package/dist/lib/security/site-fixes/request-forgery.js +37 -29
- package/dist/lib/security/taint/accessors.js +364 -0
- package/dist/lib/security/taint/array-writes.js +139 -0
- package/dist/lib/security/taint/binding-inputs.js +237 -0
- package/dist/lib/security/taint/field-access.js +80 -0
- package/dist/lib/security/taint/filename-guard.js +125 -50
- package/dist/lib/security/taint/guards.js +163 -24
- package/dist/lib/security/taint/index.js +156 -259
- package/dist/lib/security/taint/propagate.js +47 -14
- package/dist/lib/security/taint/record-writes.js +161 -0
- package/dist/lib/security/taint/resolution-cache.js +22 -7
- package/dist/lib/security/taint/sanitizers.js +94 -10
- package/dist/lib/security/taint/shape-flows.js +128 -0
- package/dist/lib/security/taint/sink-alphabets.js +237 -0
- package/dist/lib/security/taint/sources.js +151 -8
- package/dist/lib/security/taint/trace-nodes.js +94 -0
- package/dist/lib/security/taint/validators.js +142 -23
- package/dist/lib/security/trusted-bindings.js +44 -0
- package/dist/lib/shared/agent/agent-init.js +84 -8
- package/dist/lib/shared/agent/agent-integrations.js +626 -0
- package/dist/lib/shared/agent/agent-prompt.js +2 -1
- package/dist/lib/shared/agent/agent-session.js +1 -1
- package/dist/lib/shared/agent/agent-toml.js +98 -0
- package/dist/lib/shared/agent/agent-verify.js +25 -4
- package/dist/lib/shared/agent/git-hook.js +48 -10
- package/dist/lib/shared/agent/notify-editor.js +2 -1
- package/dist/lib/shared/agent/review-mcp.js +75 -15
- package/dist/lib/shared/agent/review-request.js +4 -0
- package/dist/lib/shared/analysis/ast-helpers.js +50 -0
- package/dist/lib/shared/analysis/ast-semantics.js +8 -2
- package/dist/lib/shared/analysis/binding-names.js +13 -0
- package/dist/lib/shared/analysis/execution-context.js +49 -9
- package/dist/lib/shared/analysis/polyglot-compatibility.js +102 -23
- package/dist/lib/shared/analysis/scan-cache-storage.js +180 -0
- package/dist/lib/shared/analysis/scan-cache.js +427 -120
- package/dist/lib/shared/analysis/valid-javascript.js +118 -0
- package/dist/lib/shared/changed-lines.js +129 -0
- package/dist/lib/shared/check-options.js +63 -0
- package/dist/lib/shared/check-watch-inputs.js +152 -0
- package/dist/lib/shared/check-watch-process.js +57 -0
- package/dist/lib/shared/check-watch.js +136 -0
- package/dist/lib/shared/check.js +73 -37
- package/dist/lib/shared/cli-dispatch.js +17 -0
- package/dist/lib/shared/completion-shells.js +127 -0
- package/dist/lib/shared/completion.js +124 -0
- package/dist/lib/shared/config-rule-validation.js +135 -0
- package/dist/lib/shared/config.js +332 -148
- package/dist/lib/shared/declarative-rule-packs.js +173 -0
- package/dist/lib/shared/explain.js +48 -10
- package/dist/lib/shared/fix/fix-convergence.js +49 -130
- package/dist/lib/shared/fix/fix-history.js +130 -26
- package/dist/lib/shared/fix/fix-imports.js +4 -171
- package/dist/lib/shared/fix/fix-interactive.js +78 -0
- package/dist/lib/shared/fix/fix-patch.js +89 -0
- package/dist/lib/shared/fix/fix-polyglot-preview.js +166 -0
- package/dist/lib/shared/fix/fix-presentation-biome.js +120 -0
- package/dist/lib/shared/fix/fix-presentation-comments.js +23 -9
- package/dist/lib/shared/fix/fix-presentation-prettier.js +27 -10
- package/dist/lib/shared/fix/fix-presentation-rows.js +5 -1
- package/dist/lib/shared/fix/fix-presentation.js +25 -16
- package/dist/lib/shared/fix/fix-project-membership.js +79 -0
- package/dist/lib/shared/fix/fix-reversal-proof.js +107 -0
- package/dist/lib/shared/fix/fix-reverse.js +37 -0
- package/dist/lib/shared/fix/fix-safety.js +10 -4
- package/dist/lib/shared/fix/fix-scope.js +13 -9
- package/dist/lib/shared/fix/fix-source-snapshot.js +92 -0
- package/dist/lib/shared/fix/fix-staging.js +129 -0
- package/dist/lib/shared/fix/fix-terminal.js +34 -9
- package/dist/lib/shared/fix/fix-typecheck.js +29 -12
- package/dist/lib/shared/fix/import-text-edits.js +148 -0
- package/dist/lib/shared/fix/project-file-access.js +44 -11
- package/dist/lib/shared/fix/read-fix-text.js +23 -0
- package/dist/lib/shared/fix/reversal-lock.js +37 -0
- package/dist/lib/shared/fix/review-fix-mode.js +9 -0
- package/dist/lib/shared/fix.js +192 -32
- package/dist/lib/shared/formats/ci-consumers.js +84 -0
- package/dist/lib/shared/formats/finding-location.js +55 -3
- package/dist/lib/shared/formats/github.js +24 -9
- package/dist/lib/shared/formats/index.js +21 -5
- package/dist/lib/shared/formats/readable.js +63 -0
- package/dist/lib/shared/formats/report-rows.js +38 -0
- package/dist/lib/shared/formats/sarif-fixes.js +261 -0
- package/dist/lib/shared/formats/sarif.js +181 -33
- package/dist/lib/shared/formats/security-cwe.js +113 -0
- package/dist/lib/shared/node-scan.js +64 -0
- package/dist/lib/shared/package-root.js +2 -0
- package/dist/lib/shared/project-root.js +27 -1
- package/dist/lib/shared/report-fp.js +6 -2
- package/dist/lib/shared/reporting/action-summary.js +31 -0
- package/dist/lib/shared/reporting/baseline.js +19 -17
- package/dist/lib/shared/reporting/finding-id-hash.js +7 -0
- package/dist/lib/shared/reporting/impact-levels.js +1 -1
- package/dist/lib/shared/reporting/pillar-rules.js +13 -1
- package/dist/lib/shared/reporting/pillars.js +44 -20
- package/dist/lib/shared/reporting/rule-docs.js +2 -2
- package/dist/lib/shared/reporting/rule-pack-fingerprint.js +21 -0
- package/dist/lib/shared/reporting/source-report.js +17 -2
- package/dist/lib/shared/reporting/stray-console-methods.js +1 -0
- package/dist/lib/shared/rule-registry.js +6 -1
- package/dist/lib/shared/system/atomic-write.js +12 -6
- package/dist/lib/shared/system/component-source.js +28 -0
- package/dist/lib/shared/system/environment.js +12 -0
- package/dist/lib/shared/system/file-key.js +8 -0
- package/dist/lib/shared/system/git.js +47 -0
- package/dist/lib/shared/system/glob.js +123 -19
- package/dist/lib/shared/system/jsonc-config.js +63 -0
- package/dist/lib/shared/system/path-inside.js +19 -0
- package/dist/lib/shared/system/posix-path.js +22 -0
- package/dist/lib/shared/system/read-json.js +10 -0
- package/dist/lib/shared/system/sentry.js +31 -9
- package/dist/lib/shared/system/text-helpers.js +40 -0
- package/dist/lib/shared/system/windows-orphans-script.js +75 -0
- package/dist/lib/shared/system/windows-orphans.js +28 -0
- package/dist/lib/shared/types/changed-lines.js +1 -0
- package/dist/lib/shared/types/completion.js +1 -0
- package/dist/lib/shared/workspace-selection.js +67 -0
- package/dist/lib/shared/workspaces.js +217 -63
- package/dist/polyglot/maintainability/rules.js +119 -3
- package/examples/README.md +45 -0
- package/examples/clean/avatar.html +1 -0
- package/examples/clean/source.ts +10 -0
- package/examples/clean/tsconfig.json +4 -0
- package/examples/findings/avatar.html +1 -0
- package/examples/findings/source.ts +11 -0
- package/examples/findings/tsconfig.json +4 -0
- package/examples/labels-clean.py +5 -0
- package/integrations/zed/Cargo.lock +1 -1
- package/integrations/zed/Cargo.toml +1 -1
- package/integrations/zed/LICENSE +201 -0
- package/integrations/zed/extension.toml +3 -3
- package/integrations/zed/extension.wasm +0 -0
- package/integrations/zed/src/lib.rs +108 -8
- package/package.json +29 -14
- package/polyglot/performance/rules/csharp.yml +200 -8
- package/polyglot/performance/rules/go.yml +15 -7
- package/polyglot/performance/rules/input.yml +5 -30
- package/polyglot/performance/rules/java.yml +76 -2
- package/polyglot/performance/rules/php.yml +146 -0
- package/polyglot/performance/rules/python.yml +80 -4
- package/polyglot/performance/rules/ruby.yml +81 -0
- package/polyglot/performance/sgconfig.yml +3 -0
- package/polyglot/reliability/rules/csharp.yml +117 -6
- package/polyglot/reliability/rules/go.yml +425 -6
- package/polyglot/reliability/rules/input.yml +6 -0
- package/polyglot/reliability/rules/java.yml +240 -1
- package/polyglot/reliability/rules/kotlin.yml +49 -0
- package/polyglot/reliability/rules/python.yml +288 -0
- package/polyglot/reliability/rules/rust.yml +83 -0
- package/polyglot/reliability/sgconfig.yml +2 -0
- package/polyglot/security/rules/csharp.yml +143 -3
- package/polyglot/security/rules/go.yml +159 -26
- package/polyglot/security/rules/java.yml +103 -0
- package/polyglot/security/rules/python.yml +465 -5
- package/polyglot/security/rules/rust.yml +241 -3
- package/polyglot/security/sgconfig.yml +3 -0
- package/polyglot/security/utils/java-imported-jca-cipher.yml +32 -0
- package/polyglot/security/utils/java-unshadowed-javax.yml +29 -0
- package/polyglot/shared-rules/input.yml +37 -0
- package/schema/loadwise.config.schema.json +1571 -642
- package/schema/loadwise.outcomes.schema.json +43 -0
- package/types/scan.d.ts +53 -0
- package/dist/lib/maintainability/site-fixes/exports.js +0 -25
- package/docs/assets/cli-workflow.gif +0 -0
- package/plugin/.claude-plugin/plugin.json +0 -9
- package/plugin/commands/loadwise.md +0 -29
- package/plugin/hooks/check-edited-file.mjs +0 -151
- package/plugin/hooks/hooks.json +0 -17
- /package/dist/lib/{maintainability/types/changed-lines.js → editor/types/workspace-fix.js} +0 -0
package/README.md
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
# Loadwise
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/loadwise) [](https://github.com/IbrahimHafez1/loadwise/actions/workflows/check.yml) [](https://scorecard.dev/viewer/?uri=github.com/IbrahimHafez1/loadwise) [](LICENSE)
|
|
3
|
+
[](https://www.npmjs.com/package/loadwise) [](https://github.com/IbrahimHafez1/loadwise/actions/workflows/check.yml) [](https://scorecard.dev/viewer/?uri=github.com/IbrahimHafez1/loadwise) [](https://www.bestpractices.dev/projects/17450) [](https://github.com/IbrahimHafez1/loadwise/blob/main/LICENSE)
|
|
4
4
|
|
|
5
5
|
**[npm package](https://www.npmjs.com/package/loadwise)** · **[Documentation](https://loadwise.mintlify.app/)** · **[Accuracy Scorecard](https://github.com/IbrahimHafez1/loadwise/blob/main/bench/corpus/scorecard.md)** · **[Sponsor](https://github.com/sponsors/IbrahimHafez1)**
|
|
6
6
|
|
|
7
|
-
[Quick Start](#
|
|
7
|
+
[Quick Start](#quick-start) · [Checkers](#what-it-checks) · [Fixes](#how-fixes-work) · [Editors](#editors) · [AI Agents](#ai-coding-agents) · [GitHub Action](#github-action) · [Commands](#command-reference) · [Rule Reference](#full-rule--checker-reference)
|
|
8
8
|
|
|
9
|
-

|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Loadwise is a command-line checker for TypeScript and JavaScript projects. It reports performance, reliability, maintainability, security and accessibility problems, explains each one, and previews an edit when it can generate one. It runs locally with no config file, no API key and no network upload by default.
|
|
12
|
+
|
|
13
|
+
> **Pre-1.0.** Rule IDs, CLI flags, the JSON report and the config schema can change in a minor release (see [CHANGELOG.md](https://github.com/IbrahimHafez1/loadwise/blob/main/CHANGELOG.md)). False-positive reports are the most useful feedback: [open one](https://github.com/IbrahimHafez1/loadwise/issues/new?template=false-positive.yml).
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
You need **Node.js 22.13.0 or later**. From a project folder:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npx loadwise check # scan the project; source files stay untouched
|
|
21
|
+
npx loadwise explain array-repeated-membership # read about a rule
|
|
22
|
+
npx loadwise explain --list --checker perf # browse rule IDs
|
|
23
|
+
npx loadwise fix # preview automatic edits
|
|
24
|
+
npx loadwise fix --apply # apply them
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
To pin Loadwise to the project, run `npm install --save-dev loadwise`. Use `npx loadwise check --uncommitted` to scan only your local changes. Opt-in crash reporting stays off unless you run `npx loadwise --report-crashes check`, set `LOADWISE_CRASH_REPORTS=1` or configure a valid `LOADWISE_SENTRY_DSN`.
|
|
28
|
+
|
|
29
|
+
### Example
|
|
30
|
+
|
|
31
|
+
This file passes `tsc` and ESLint. Each `pool.query()` can run on a different connection, so `BEGIN`, `UPDATE` and `COMMIT` may not share one transaction:
|
|
12
32
|
|
|
13
33
|
```ts
|
|
14
|
-
// transfer.ts
|
|
34
|
+
// transfer.ts
|
|
15
35
|
import type { Pool } from 'pg';
|
|
16
36
|
|
|
17
37
|
export async function transfer(pool: Pool, fromId: string, toId: string, amount: number) {
|
|
@@ -22,8 +42,6 @@ export async function transfer(pool: Pool, fromId: string, toId: string, amount:
|
|
|
22
42
|
}
|
|
23
43
|
```
|
|
24
44
|
|
|
25
|
-
With **Node.js 22.13.0 or later**, run `npx loadwise check` locally—no config file, no API key, no network upload by default (opt-in crash reporting stays off unless you run `npx loadwise --report-crashes check`, set `LOADWISE_CRASH_REPORTS=1`, or configure a valid `LOADWISE_SENTRY_DSN`), and your source files stay untouched. This excerpt focuses on the reliability checker.
|
|
26
|
-
|
|
27
45
|
```text
|
|
28
46
|
$ npx loadwise check --only rel
|
|
29
47
|
Scope: . (all files)
|
|
@@ -37,237 +55,93 @@ Checkers: rel
|
|
|
37
55
|
transfer.ts:5:14 #245ca194d514
|
|
38
56
|
```
|
|
39
57
|
|
|
40
|
-
Both findings point to the same review-marked fix. Preview the edit for the first finding
|
|
58
|
+
Both findings point to the same review-marked fix. Preview the edit for the first finding, read the diff, then apply it:
|
|
41
59
|
|
|
42
60
|
```sh
|
|
43
61
|
npx loadwise fix --only rel --id 245ca194d514 --dry-run
|
|
44
62
|
npx loadwise fix --only rel --id 245ca194d514
|
|
45
63
|
```
|
|
46
64
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```text
|
|
50
|
-
$ npx loadwise check
|
|
51
|
-
Scope: . (all files)
|
|
52
|
-
Checkers: perf, rel, maint, sec, a11y
|
|
53
|
-
|
|
54
|
-
== Performance ==
|
|
55
|
-
1 file checked, 0 findings.
|
|
56
|
-
|
|
57
|
-
== Reliability ==
|
|
58
|
-
1 file checked, 0 findings.
|
|
59
|
-
|
|
60
|
-
== Maintainability ==
|
|
61
|
-
1 source file, 0 findings, 0 contract findings.
|
|
62
|
-
|
|
63
|
-
== Security ==
|
|
64
|
-
1 file checked, 0 findings.
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
_Loadwise skips accessibility on projects without frontend sources._
|
|
65
|
+
A full `npx loadwise check` then reports zero findings. Loadwise skips accessibility on projects without frontend sources.
|
|
68
66
|
|
|
69
|
-
|
|
67
|
+
### Try it on a bundled example
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- **Performance** (`loadwise perf`): N+1 queries, ORM/SQL query integrity, blocking sync calls, quadratic collection loops, React/Vue/Angular render & cleanup issues, schema-aware indexes, OpenTelemetry traces, and optional read-only DB inspection.
|
|
74
|
-
- **Reliability** (`loadwise rel`): transaction-client escapes (`pg`, Prisma, TypeORM), unreleased checkouts, unhandled rejections and swallowed errors, missing HTTP/pool timeouts, idempotency keys, migration lock risks, and breaking OpenAPI changes.
|
|
75
|
-
- **Maintainability** (`loadwise maint`): deep nesting, branch complexity, duplicate implementations, dependency cycles, and declared architecture boundaries.
|
|
76
|
-
- **Security** (`loadwise sec`): request-to-sink injection, auth/crypto flaws, exposed secrets (including client bundles), unsafe HTML/URLs, Docker/Compose checks, row-scope verification, and optional `--online` advisories.
|
|
77
|
-
- **Accessibility** (`loadwise a11y`): missing alt text, unlabelled controls, non-interactive click handlers, invalid ARIA, and missing page language in JSX, HTML, Vue, Svelte, and Angular templates.
|
|
78
|
-
|
|
79
|
-
See the **[corpus rule scorecard](https://github.com/IbrahimHafez1/loadwise/blob/main/bench/corpus/scorecard.md)** for measured precision and recall across 17 pinned open-source repositories, and **[docs/rules](https://github.com/IbrahimHafez1/loadwise/tree/main/docs/rules)** for per-rule documentation.
|
|
80
|
-
|
|
81
|
-
> **Pre-1.0.** Loadwise is under active development. Rule IDs, CLI flags, the JSON report, and config schema can change in a minor release (see [CHANGELOG.md](https://github.com/IbrahimHafez1/loadwise/blob/main/CHANGELOG.md)). False-positive reports are the most useful feedback: [open one](https://github.com/IbrahimHafez1/loadwise/issues/new?template=false-positive.yml).
|
|
82
|
-
|
|
83
|
-
## Install & Quick Start
|
|
84
|
-
|
|
85
|
-
Use Node.js 22.13.0 or later. Install Loadwise in the project with `npm install --save-dev loadwise`, or use `npx` for a one-off run.
|
|
69
|
+
From a project with `loadwise` installed, copy an example to a disposable file and scan it:
|
|
86
70
|
|
|
87
71
|
```sh
|
|
88
|
-
|
|
89
|
-
npx loadwise explain array-repeated-membership # understand a rule
|
|
90
|
-
npx loadwise fix # preview automatic edits
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Run `npx loadwise fix --apply` to apply the automatic edits. To work on local changes only, use `npx loadwise check --uncommitted` and `npx loadwise fix --uncommitted`. Use `npx loadwise --version` to see the installed version.
|
|
94
|
-
|
|
95
|
-
After your first scan, [share a useful finding or a false positive](https://github.com/IbrahimHafez1/loadwise/issues/203). One rule ID and a sentence about what you fixed or why the code was safe are enough. If Loadwise helped, [give it a star on GitHub](https://github.com/IbrahimHafez1/loadwise). To contribute code or docs, [pick a good first issue](https://github.com/IbrahimHafez1/loadwise/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22).
|
|
96
|
-
|
|
97
|
-
**With an AI coding agent**, say **“Run Loadwise”** in your project chat. The agent runs the installed CLI directly, verifies findings against callers and tests, and asks before making edits. [Active-agent workflow and optional MCP setup](#using-loadwise-with-an-active-coding-agent)
|
|
98
|
-
|
|
99
|
-
### Try a finding and a fix
|
|
100
|
-
|
|
101
|
-
From a project with `loadwise` installed, copy the bundled example to a disposable file and scan it:
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
node -e "require('node:fs').copyFileSync('node_modules/loadwise/examples/slow.ts', 'loadwise-demo.ts', require('node:fs').constants.COPYFILE_EXCL)"
|
|
72
|
+
node -e "require('node:fs').copyFileSync(require.resolve('loadwise/examples/slow.ts'), 'loadwise-demo.ts', require('node:fs').constants.COPYFILE_EXCL)"
|
|
105
73
|
npx loadwise perf loadwise-demo.ts
|
|
106
|
-
npx loadwise explain array-repeated-membership
|
|
107
74
|
npx loadwise perf loadwise-demo.ts --fix --only FINDING_ID
|
|
108
|
-
npx loadwise perf loadwise-demo.ts
|
|
109
75
|
```
|
|
110
76
|
|
|
111
|
-
Replace `FINDING_ID` with the
|
|
112
|
-
|
|
113
|
-
## Commands
|
|
114
|
-
|
|
115
|
-
| Task | Commands |
|
|
116
|
-
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
117
|
-
| Scan a project or branch | `loadwise check [directory]`, `loadwise check --uncommitted`, `loadwise check --changed-since origin/main`, `loadwise check --staged` |
|
|
118
|
-
| Understand a finding | `loadwise explain <rule-id>` |
|
|
119
|
-
| Preview or apply edits | `loadwise fix` previews automatic fixes. `loadwise fix --apply` writes them. `loadwise fix --id <finding-id>` writes one selected fix. |
|
|
120
|
-
| Focus on one checker | `loadwise check --only perf`. Choose from `perf`, `rel`, `maint`, `sec`, and `a11y`. Each also has a direct command for specialized options. |
|
|
121
|
-
| Review migrations or API changes | `loadwise rel migrations`, `loadwise rel contracts` |
|
|
122
|
-
| Investigate slow database operations | `loadwise perf db` for database inspection, `loadwise perf plan <file>` for an execution plan, `loadwise perf traces <file>` for an OTLP trace |
|
|
123
|
-
| Check dependencies or other languages | `loadwise sec deps --online`, or `polyglot` under `loadwise perf`, `loadwise rel`, or `loadwise sec` |
|
|
124
|
-
| Inspect module dependencies | `loadwise maint --graph <file>` |
|
|
125
|
-
| Install editor diagnostics | `loadwise editor setup` detects the editor or lets you select one. Use `--editor stdio` for a custom language client. |
|
|
126
|
-
| Connect a coding agent | `loadwise agent mcp --print-config`, `loadwise agent init`. Use `agent init --mode ask` or `--mode auto` to configure edit permissions. See `loadwise agent --help` for review prompts, pending reports, history, and verification. |
|
|
127
|
-
| Report a false positive | `loadwise report-fp --rule <rule-id>` |
|
|
77
|
+
Replace `FINDING_ID` with the id printed after `#` by the first scan, without the `#`, then delete `loadwise-demo.ts`. The [examples guide](https://github.com/IbrahimHafez1/loadwise/blob/main/examples/README.md) has an offline exercise and a clean control for each checker, plus a Python scan. In your own application, install dependencies and generate any ORM client (`npx prisma generate`) first, and read the stderr coverage notes for skipped inputs. Start with `--min-impact high` to triage large reports.
|
|
128
78
|
|
|
129
|
-
|
|
79
|
+
## What it checks
|
|
130
80
|
|
|
131
|
-
|
|
81
|
+
Loadwise is deepest on backend and database code, and also covers React, Next.js, Vue and Angular frontends. Each checker has its own command and a docs page.
|
|
132
82
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
- `--min-impact <low|medium|high|critical>` reports only findings at that level or above (see [Impact levels](#impact-levels)).
|
|
139
|
-
- `--config <file>`, `--ignore <rule-id>` and `--workspace <name|path>` are described under [Configuration](#configuration); `--online` adds the [dependency checks](#dependency-checks).
|
|
140
|
-
- `--write-baseline [file]` records the current findings and `--baseline [file]` reports only findings not recorded. The default file is `loadwise-baseline.json` in the checked directory, with one section per checker; the checker commands take the same flags and read or write only their own section. Entries match on rule, file and flagged code, with a count per entry so N recorded copies allow N findings. Refreshed JavaScript and TypeScript baselines also match after spacing changes and removal of optional statement-ending semicolons. Text output ends with `N baseline findings hidden.` and `--json` adds `baselineHidden`. A full comparison reports unmatched entries in `baselineStale`; a partial one, such as a changed-line or single-file scan, reports `null`. Refresh the baseline using its original scope and settings. Not combinable with `--fix`, and `--write-baseline` not with `--staged` or `--changed-since`. `loadwise rel migrations` keeps its own baseline.
|
|
83
|
+
- **[Performance](https://loadwise.mintlify.app/checkers/performance)** (`loadwise perf`): N+1 queries, ORM and SQL query integrity, blocking sync calls, quadratic collection loops, framework render and cleanup issues, schema-aware indexes, OpenTelemetry traces, and optional read-only database inspection.
|
|
84
|
+
- **[Reliability](https://loadwise.mintlify.app/checkers/reliability)** (`loadwise rel`): transaction-client escapes (`pg`, Prisma, TypeORM), unreleased checkouts, unhandled rejections and swallowed errors, missing HTTP and pool timeouts, idempotency keys, migration lock risks, and breaking OpenAPI changes.
|
|
85
|
+
- **[Maintainability](https://loadwise.mintlify.app/checkers/maintainability)** (`loadwise maint`): deep nesting, branch complexity, duplicate implementations, dependency cycles, and declared architecture boundaries.
|
|
86
|
+
- **[Security](https://loadwise.mintlify.app/checkers/security)** (`loadwise sec`): request-to-sink injection, auth and crypto flaws, exposed secrets (including client bundles), unsafe HTML and URLs, Docker and Compose checks, row-scope verification, and optional `--online` advisories.
|
|
87
|
+
- **[Accessibility](https://loadwise.mintlify.app/checkers/accessibility)** (`loadwise a11y`): missing alt text, unlabelled controls, non-interactive click handlers, invalid ARIA, and missing page language in JSX, HTML, Vue, Svelte and Angular templates.
|
|
141
88
|
|
|
142
|
-
|
|
89
|
+
Some performance and reliability rules also cover Python, Go, Java, C#, Rust, Ruby, PHP and Kotlin through `polyglot` subcommands; see the [rule reference](#full-rule--checker-reference). The [corpus rule scorecard](https://github.com/IbrahimHafez1/loadwise/blob/main/bench/corpus/scorecard.md) lists measured precision and recall across 17 pinned open-source repositories, and [docs/rules](https://github.com/IbrahimHafez1/loadwise/tree/main/docs/rules) documents each rule.
|
|
143
90
|
|
|
144
|
-
|
|
91
|
+
Every finding has an impact level (`critical`, `high`, `medium` or `low`). Filter with `--min-impact <level>`; the [impact levels](https://loadwise.mintlify.app/configuration#impact-levels) section defines them.
|
|
145
92
|
|
|
146
|
-
|
|
93
|
+
## How fixes work
|
|
147
94
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
### Fixes
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
npx loadwise fix # preview automatic edits
|
|
154
|
-
npx loadwise fix --apply # apply automatic edits
|
|
155
|
-
npx loadwise fix --all # all generated edits, including review suggestions
|
|
156
|
-
npx loadwise fix --all performance security # only the named checkers
|
|
157
|
-
npx loadwise fix --all --dry-run # preview even edits marked for review
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
A preview prints the diff and a matching apply command when automatic edits are available. The existing `--yes` spelling also applies automatic fixes. Add `--dry-run` to preview an explicit write mode such as `--all` or `--id`.
|
|
161
|
-
|
|
162
|
-
Use the same directory, project configuration, workspace, and changed-line selection when going from a scan to a fix:
|
|
95
|
+
`loadwise fix` previews the generated edits as a diff and changes nothing. Loadwise writes edits only in an explicit mode, and checks source lines, scope and types before it writes.
|
|
163
96
|
|
|
164
97
|
```sh
|
|
165
|
-
npx loadwise
|
|
166
|
-
npx loadwise fix
|
|
167
|
-
npx loadwise fix
|
|
98
|
+
npx loadwise fix # preview automatic edits
|
|
99
|
+
npx loadwise fix --apply # apply automatic edits
|
|
100
|
+
npx loadwise fix --interactive # approve one finding at a time
|
|
101
|
+
npx loadwise fix --only perf --id <id> # apply exactly one finding, by the #id in the report
|
|
102
|
+
npx loadwise perf --fix --only <id> # the same edit through a checker command
|
|
168
103
|
```
|
|
169
104
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
Bare `loadwise fix` and `--dry-run` show the generated edits before project formatting. Applying the edits can change their whitespace or quoting. Each applied fix in a JavaScript or TypeScript file gets a `// Loadwise <rule-id>: <why>` comment above the fixed statement, and the changed lines are formatted with the project's own Prettier, honouring its config and `.prettierignore`; the rest of the file stays byte-identical. Without Prettier the edits are written as generated, with a note. `--no-comments` and `--no-format` turn these off, also on the per-checker `--fix`. `fix` also takes repeatable `--rule <rule-id>` filtering and `--no-verify-types` (skip the post-edit TypeScript check).
|
|
177
|
-
|
|
178
|
-
Maintainability `--fix` limits edits to the checked project. Performance, reliability, security, and accessibility `--fix` use the containing Git repositories of the checked projects or explicitly named source files, so fixes can include shared files such as a schema at a monorepo root. Outside a Git repository, they use the project root. Per-checker fixes refuse hard-linked files and symbolic links that are dangling or resolve outside those limits. Existing files keep their permissions when replaced.
|
|
105
|
+
- A finding marked for review needs its own approval. Naming its `--id` counts as approval, and `--dry-run` previews it first.
|
|
106
|
+
- `--all` applies every generated edit eligible for bulk application. Run your tests afterwards.
|
|
107
|
+
- Findings without a generated edit are manual. `loadwise fix --handoff` prints them as a Markdown brief.
|
|
108
|
+
- Use the same directory, `--config`, `--workspace` and changed-line filters (`--uncommitted`, `--staged`, `--changed-since <ref>`) for the scan and the fix.
|
|
109
|
+
- `--patch` writes a Git patch without touching files. `--record-reversal` keeps a receipt that `--reverse <run-id>` can preview undoing.
|
|
110
|
+
- To keep an intentional site, put `// loadwise-reviewed <rule-id> -- <reason>` on the line before it.
|
|
179
111
|
|
|
180
|
-
|
|
112
|
+
The [fixes guide](https://loadwise.mintlify.app/commands#fixes) covers recipes, `--json` output, formatting and the review rules in full.
|
|
181
113
|
|
|
182
|
-
|
|
114
|
+
## Editors
|
|
183
115
|
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
'rel/swallowed-error'({ finding, source }) {
|
|
187
|
-
if (finding.file !== 'scripts/refresh-cache.ts') return null;
|
|
188
|
-
const before = source.split(/\r?\n/)[finding.line - 1];
|
|
189
|
-
if (before?.trim() !== '} catch {}') return null;
|
|
190
|
-
return [{
|
|
191
|
-
line: finding.line,
|
|
192
|
-
before,
|
|
193
|
-
after: before.replace('catch {}', "catch (error) { throw new Error('Cache refresh failed', { cause: error }); }"),
|
|
194
|
-
}];
|
|
195
|
-
},
|
|
196
|
-
};
|
|
116
|
+
```sh
|
|
117
|
+
npx loadwise@latest editor setup
|
|
197
118
|
```
|
|
198
119
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
### Per-checker fixes and dismissals
|
|
120
|
+
Setup installs the extension or prepares a language client for VS Code, VSCodium, Grok Build (formerly Cursor), Devin (formerly Windsurf), Antigravity IDE, Zed, Sublime Text, Neovim, Helix, Emacs, Vim and JetBrains IDEs. Choose one with `--editor <name>`, or use `--editor stdio` for any other LSP client. A client can also launch `loadwise lsp --stdio` directly. Zed installs from the npm package (`loadwise editor setup --editor zed`). Diagnostics carry the rule as their code, with hovers, quick fixes, **Apply all** and dismissals. Requirements per editor are in the [editor guide](https://loadwise.mintlify.app/editor).
|
|
202
121
|
|
|
203
|
-
|
|
122
|
+
## AI coding agents
|
|
204
123
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
```ts
|
|
208
|
-
// loadwise-reviewed pg-query-in-loop -- Each iteration measures a separate query-plan sample.
|
|
209
|
-
await client.query(statement);
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Changed lines
|
|
124
|
+
Ask your agent to "Run Loadwise". When it runs a check or fix, the CLI gives a recognized agent a review workflow on stderr, and the agent asks before it edits.
|
|
213
125
|
|
|
214
126
|
```sh
|
|
215
|
-
|
|
216
|
-
npx loadwise
|
|
217
|
-
npx loadwise maint --staged .
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
These report only findings on changed lines, each with its id, the exact `--fix --only <id>` command when an automatic fix exists, and the `loadwise-reviewed` comment that dismisses it. `--json` keeps the usual shape, filtered, and the exit code is 1 when findings remain. With no changed supported source files the command exits 0 before TypeScript loads. Only the changed files are analysed as roots while imports still resolve through the project; untracked files count as fully changed with `--changed-since`, and a file with unstaged edits can report lines that differ from the staged version. `schema.prisma` findings are not part of this mode. The direct `perf`, `rel`, `sec` and `a11y` source commands accept these Git filters when scanning a project. Use the unified fix command to keep the same filter when applying an edit, for example `loadwise fix --staged --only perf --id FINDING_ID`. Maintainability also supports `loadwise maint --staged --fix --only FINDING_ID` and the equivalent `--changed-since` form.
|
|
221
|
-
|
|
222
|
-
For maintainability, a JS/TS function-level finding (`high-branch-complexity`, `deep-control-flow`) is kept when a changed line falls anywhere inside its function, and `--fail-on` defaults to `all`. When at least 600 files changed, the full scan runs and is filtered to the changed lines; otherwise `duplicate-implementation` is skipped and `dependency-cycle` only sees cycles made of the changed files' imports.
|
|
223
|
-
|
|
224
|
-
## Configuration
|
|
225
|
-
|
|
226
|
-
One optional file, `loadwise.config.json`, sets the defaults for every checker. `loadwise check` looks for it in the checked directory and each checker command (`loadwise perf`, `rel`, `maint`, `sec` or `a11y`) in the project folder; `--config <file>` on `check` (`--loadwise-config <file>` on the checker commands) names another one. Add `$schema` for editor completion and validation.
|
|
227
|
-
|
|
228
|
-
```json
|
|
229
|
-
{
|
|
230
|
-
"$schema": "./node_modules/loadwise/schema/loadwise.config.schema.json",
|
|
231
|
-
"checkers": ["perf", "rel", "maint"],
|
|
232
|
-
"ignore": ["generated/**", "scripts/**"],
|
|
233
|
-
"rules": {
|
|
234
|
-
"duplicate-implementation": "warn",
|
|
235
|
-
"array-repeated-find": "off",
|
|
236
|
-
"pg-query-in-loop": { "level": "error" }
|
|
237
|
-
},
|
|
238
|
-
"overrides": [{ "files": ["src/legacy/**"], "rules": { "high-branch-complexity": "off" } }],
|
|
239
|
-
"performance": {
|
|
240
|
-
"parallelReads": [{ "from": "@app/reads", "exports": ["fetchUser", "fetchPosts"] }]
|
|
241
|
-
},
|
|
242
|
-
"maintainability": {
|
|
243
|
-
"exclude": ["vendor"],
|
|
244
|
-
"placement": [{ "suffix": ".controller.ts", "under": ["src/controllers"] }]
|
|
245
|
-
}
|
|
246
|
-
}
|
|
127
|
+
npm install --save-dev loadwise
|
|
128
|
+
npx loadwise agent init
|
|
247
129
|
```
|
|
248
130
|
|
|
249
|
-
- `
|
|
250
|
-
- `ignore` lists globs, relative to the config file, that no checker scans or reports on; they leave the scan itself, so they cost no time and never count toward duplicates, cycles or architecture. `*` matches within a folder, `**` any depth, `?` one character and `{a,b}` alternatives; naming a folder covers everything below it.
|
|
251
|
-
- `rules` sets each rule to `"off"` (its findings are dropped), `"warn"` (reported, but never changes the exit code) or `"error"` (reported findings always count, even under `--fail-on contract`). A hidden contextual finding is not reported, so it never counts. The object form `{ "level": "warn", "options": { ... } }` sets thresholds for rules that take them, such as `maxDepth` or `maxComplexity`; the [config schema](schema/loadwise.config.schema.json) lists each rule's options, and an unknown option exits with code 2.
|
|
252
|
-
- `overrides` apply `rules` to the files matching `files`; a later override wins over an earlier one and over `rules`.
|
|
253
|
-
- `performance` holds the query policy (see [Project-defined access policy](#project-defined-access-policy)), and `maintainability` holds the maintainability policy (see [Project rules](#project-rules)). `--policy file.json` and `--config file.json` name a policy file for one run and beat the config sections.
|
|
254
|
-
- `--ignore <rule-id>` (repeatable, on `check` and every checker) adds a rule to `"off"` for one run and beats the config.
|
|
255
|
-
- `--workspace <name|path>` (repeatable) limits every checker to some workspace packages.
|
|
131
|
+
`agent init` adds an after-edit hook and a local MCP server named `loadwise` for Claude Code, GitHub Copilot, Grok Build, Gemini CLI, Codex, Devin and Cline, plus a managed section in `AGENTS.md` imported from `CLAUDE.md`. After each edit, the hook runs the project's installed `loadwise` on that file with a 20-second limit and returns findings with their `--fix --only <id>` commands. The hook does nothing until Loadwise is installed. The earlier Claude Code plugin and its `/loadwise` command are removed; run `/plugin uninstall loadwise` if you installed the plugin.
|
|
256
132
|
|
|
257
|
-
|
|
133
|
+
- `loadwise agent init --hook block` (or `warn`, `off`) manages a Git pre-commit hook that runs `loadwise check --staged`.
|
|
134
|
+
- `agent init --tools <list>` configures tools whose folder does not exist yet, and `--global` writes the Cline MCP file in your home folder. `--no-edit-hooks` and `--no-mcp` skip those files, while `--edit-hooks off` and `--mcp off` remove only the Loadwise entries.
|
|
135
|
+
- `loadwise agent mcp --print-config` prints the stdio server entry for another MCP client.
|
|
136
|
+
- `loadwise agent instructions` prints the review workflow, `loadwise agent prompt` prints a prompt to paste into any agent, and `loadwise agent pending` lists saved handoff reports.
|
|
137
|
+
- `loadwise agent history` reads past fixes and review decisions. `loadwise agent verify` checks that every finding has a recorded outcome.
|
|
138
|
+
- Detection uses agent environment variables. Set `LOADWISE_AGENT=1` to force it on and `LOADWISE_AGENT=0` to turn it off.
|
|
258
139
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
Every finding carries an impact level, shown after the rule in text output, where the most severe finding comes first within each file. JSON findings carry it as `impactLevel` (`impact` is the before/after estimate). `--min-impact <low|medium|high|critical>` reports only findings at that level or above, and the filtered ones do not count toward the exit code; an unknown level exits 2. The rule tables list each rule's default level, and dependency findings use the advisory severity.
|
|
262
|
-
|
|
263
|
-
- `critical`: data loss or corruption, an outage or a lock risk in production.
|
|
264
|
-
- `high`: a per-request scaling problem such as an N+1 or query in a loop, a deep offset, a missing foreign-key or filter index, an HTTP call without a timeout, or a dependency cycle with load-time effects.
|
|
265
|
-
- `medium`: a measurable but local cost, or significant maintainability debt.
|
|
266
|
-
- `low`: a micro-optimization or a readability issue.
|
|
140
|
+
Hook files per tool, flags and known limits are in [AI coding agents](https://loadwise.mintlify.app/ai-agents).
|
|
267
141
|
|
|
268
142
|
## GitHub Action
|
|
269
143
|
|
|
270
|
-
The repository root is a composite action
|
|
144
|
+
The repository root is a composite action. It runs `loadwise check`, prints annotations on the pull request and uploads SARIF to code scanning.
|
|
271
145
|
|
|
272
146
|
```yaml
|
|
273
147
|
name: loadwise
|
|
@@ -288,113 +162,53 @@ jobs:
|
|
|
288
162
|
fail-on: contract
|
|
289
163
|
```
|
|
290
164
|
|
|
291
|
-
|
|
292
|
-
| -------------- | --------------- | ----------------------------------------------------------------------------------------------------- |
|
|
293
|
-
| `checkers` | all | Passed to `--only`, for example `perf,rel,a11y`. |
|
|
294
|
-
| `path` | `.` | Directory to check. |
|
|
295
|
-
| `changed-only` | `false` | `true` passes `--changed-since` with the pull request base commit. |
|
|
296
|
-
| `fail-on` | checker default | Passed to `--fail-on` (`contract` or `all`). |
|
|
297
|
-
| `upload-sarif` | `true` | Uploads the SARIF report with `github/codeql-action/upload-sarif@v4`; needs `security-events: write`. |
|
|
298
|
-
| `annotations` | `true` | Prints findings as workflow annotations. |
|
|
299
|
-
|
|
300
|
-
The action installs its locked runtime dependencies in a runner temporary directory and runs the source at the selected action ref. SARIF and workflow annotations share one scan. The checker exit code is applied after the SARIF upload step.
|
|
301
|
-
|
|
302
|
-
## Use with AI coding agents
|
|
303
|
-
|
|
304
|
-
Ask your coding agent to run Loadwise. On its first check or fix, the CLI gives a recognized agent the review workflow on stderr: a check lets the agent inspect every scoped finding, earlier edit, caller and test, and a fix request also lets it apply or adapt justified changes. The agent can read the full workflow with `loadwise agent instructions`. The first run works in a fresh checkout and leaves project instruction files and Git hooks alone.
|
|
305
|
-
|
|
306
|
-
Loadwise recognizes agent shell markers from Codex, Claude Code, Cursor, Gemini CLI and GitHub Copilot, as well as tools that identify themselves with `AI_AGENT`. An integration that supplies no marker can set `LOADWISE_AGENT=1` in its tool subprocess. Set `LOADWISE_AGENT=0` on a command to disable detection. Commands typed in plain Git Bash or an ordinary IDE terminal run normally. A shell opened inside an agent can inherit its markers.
|
|
307
|
-
|
|
308
|
-
For persistent project instructions, or to have a future agent review fixes you run manually in a terminal, run `npx loadwise agent init`. It updates the managed section of `AGENTS.md`, imports it from `CLAUDE.md` and enables history for manual CLI fixes too.
|
|
309
|
-
|
|
310
|
-
Agent-run CLI fixes save their actual edited hunks locally from the first fix. For earlier fixes and saved review decisions, run `loadwise agent history` from the checked project, optionally with a checker name such as `maintainability`. History stays under the user's local state directory and can include excerpts of project source. For unrecorded edits, including edits made on another machine, use an earlier report or a known diff.
|
|
311
|
-
|
|
312
|
-
Agents check that every finding has a disposition with the original scan, the relevant history and the rescan. The outcomes file is an object with an `outcomes` array whose entries supply `checker`, `id`, `status` (`fixed`, `verified`, `intentional`, `false-positive` or `deferred`) and specific `evidence`. For a narrower request, provide only the authorized findings in those reports; put report files in a local scratch directory.
|
|
313
|
-
|
|
314
|
-
```sh
|
|
315
|
-
npx loadwise agent verify --outcomes outcomes.json before.json history.json after.json
|
|
316
|
-
npx loadwise agent verify --save --outcomes outcomes.json before.json history.json after.json
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
The first command checks coverage. `--save` also retains successful review decisions for the next session in a recognized agent session or an explicitly initialized checkout. A missing decision or skipped checker is reported as incomplete; a reasoned deferral counts as reviewed and stays visible as deferred. Code review and relevant tests establish whether a change works. For a standalone JSON scan, pass its checker, for example `--checker maint`: `perf` for performance and database reports, `rel` for reliability, migration and contract reports, `maint`, `sec` or `a11y`, one checker per invocation. Combined scans and history keep their original checker selection.
|
|
320
|
-
|
|
321
|
-
Use the handoff command printed by the fix run to preserve its scope. For a project-wide maintainability fix, save the manual findings with `npx loadwise fix --handoff maintainability > loadwise-manual.md`.
|
|
322
|
-
|
|
323
|
-
### Using Loadwise with an active coding agent
|
|
324
|
-
|
|
325
|
-
Ask the agent you are already working with to check the project with Loadwise. A shell-capable agent can run `npx loadwise check --json` and review the findings directly in the conversation. Ask it to verify findings against your code, suggest improvements, or implement the changes you choose. A check is read-only. A request to apply fixes can use `npx loadwise fix --yes --json` and review the actual edits and remaining findings in the same chat.
|
|
326
|
-
|
|
327
|
-
To copy a ready-made prompt into any AI coding tool (Claude Code, Cursor, Codex, Copilot, Windsurf, or Gemini CLI), run `npx loadwise agent prompt`:
|
|
328
|
-
|
|
329
|
-
```sh
|
|
330
|
-
npx loadwise agent prompt --pr --checkers perf,rel --report-fp
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
- `--pr` scopes the prompt's scan to `--changed-since origin/main` (or pass `--changed-since <git-ref>` directly).
|
|
334
|
-
- `--checkers <list>` picks the checkers to emphasize (default `perf,rel`).
|
|
335
|
-
- `--report-fp` appends an opt-in step so the agent asks before running `npx loadwise report-fp --rule <rule-id> --command "<cmd>" --expected "<text>" --note "<generic reason>" [--open]`. `report-fp` never sends telemetry automatically and redacts paths, emails, credentialed URLs, `KEY=value` secret env vars, and common API/JWT tokens—GitHub receives the pre-filled text when `--open` loads the form. Omit `--open` to inspect the link locally before opening it.
|
|
165
|
+
Inputs are `checkers`, `path`, `changed-only`, `base-sha`, `fail-on`, `upload-sarif`, `annotations`, `config`, `baseline`, `workspaces`, `skip`, `min-impact`, `ignore`, `include-contextual` and `online`. Defaults and details are in the [GitHub Action guide](https://loadwise.mintlify.app/github-action). Outside GitHub, `check --format` also writes `sarif`, `gitlab`, `junit`, `checkstyle`, `markdown` and `html` reports.
|
|
336
166
|
|
|
337
|
-
|
|
167
|
+
## Command reference
|
|
338
168
|
|
|
339
|
-
|
|
169
|
+
Run `loadwise <command> --help` for the options of each command. `loadwise` with no command runs `check`, and `loadwise --version` prints the installed version.
|
|
340
170
|
|
|
341
|
-
|
|
171
|
+
| Task | Commands |
|
|
172
|
+
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
173
|
+
| Scan a project or branch | `loadwise check [directory]`, `loadwise check --uncommitted`, `loadwise check --changed-since origin/main`, `loadwise check --staged` |
|
|
174
|
+
| Understand a finding | `loadwise explain <rule-id>` |
|
|
175
|
+
| Preview or apply edits | `loadwise fix`, `loadwise fix --apply`, `loadwise fix --id <finding-id>` |
|
|
176
|
+
| Focus on one checker | `loadwise check --only perf` or `--skip maint`. Choose from `perf`, `rel`, `maint`, `sec` and `a11y`; full names also work. |
|
|
177
|
+
| Review migrations or API changes | `loadwise rel migrations`, `loadwise rel contracts` |
|
|
178
|
+
| Investigate slow database operations | `loadwise perf db`, `loadwise perf plan <file>`, `loadwise perf traces <file>` |
|
|
179
|
+
| Check dependencies or other languages | `loadwise sec deps --online`, or `polyglot` under `loadwise perf`, `loadwise rel` or `loadwise sec` |
|
|
180
|
+
| Inspect module dependencies | `loadwise maint --graph <file>` |
|
|
181
|
+
| Set up an editor | `loadwise editor setup`, `loadwise editor doctor`, `loadwise lsp --stdio` |
|
|
182
|
+
| Connect a coding agent | `loadwise agent init`, `loadwise agent mcp --print-config` |
|
|
183
|
+
| Report a false positive | `loadwise report-fp --rule <rule-id>` |
|
|
184
|
+
| Shell completion | `loadwise completion bash` or `loadwise completion powershell` |
|
|
342
185
|
|
|
343
|
-
`
|
|
186
|
+
`check` flags apply to every selected checker:
|
|
344
187
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
### Git pre-commit hook
|
|
353
|
-
|
|
354
|
-
```sh
|
|
355
|
-
npx loadwise agent init --hook block # a commit with new findings fails
|
|
356
|
-
npx loadwise agent init --hook warn # findings are printed, the commit goes through (also plain --hook)
|
|
357
|
-
npx loadwise agent init --hook off # removes only this block
|
|
358
|
-
```
|
|
188
|
+
- `--json` prints one object with a key per checker (`performance`, `reliability`, `maintainability`, `security`, `accessibility`). `--format text|json|sarif|github|gitlab|junit|checkstyle|markdown|html` picks the combined report format.
|
|
189
|
+
- `--only <checkers>` and `--skip <checkers>` select checkers. `--config <file>` and `--workspace <name|path>` select configuration and packages.
|
|
190
|
+
- `--uncommitted`, `--staged` and `--changed-since <git-ref>` limit findings to changed lines. Choose one per run.
|
|
191
|
+
- `--min-impact <level>` filters by impact. `--fail-on contract|all` sets the exit threshold. `--ignore <rule-id>` turns a rule off for one run. `--include-contextual` also shows lower-priority findings with their reasons.
|
|
192
|
+
- `--write-baseline [file]` records current findings and `--baseline [file]` reports only new ones. The default file is `loadwise-baseline.json`.
|
|
193
|
+
- `--online` adds dependency advisory lookups. `--watch` rescans after saves. `--review` saves the report and prints an agent handoff.
|
|
359
194
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
## Editor (language server)
|
|
363
|
-
|
|
364
|
-
From your editor’s terminal, run:
|
|
365
|
-
|
|
366
|
-
```sh
|
|
367
|
-
npx loadwise@latest editor setup
|
|
368
|
-
```
|
|
195
|
+
When a broad root `jsconfig.json` includes sources covered by a workspace package's `tsconfig.json`, Loadwise checks those sources with the package's compiler options and still checks the files owned by the root project.
|
|
369
196
|
|
|
370
|
-
|
|
197
|
+
`fix` flags: `--apply` (alias `--yes`), `--interactive`, `--all`, `--dry-run`, `--id`, `--rule`, `--only`, `--handoff`, `--review`, `--json`, `--patch`, `--record-reversal`, `--reverse <run-id>`, `--polyglot-preview <sha256>`, `--recipe`, `--no-verify-types`, `--no-comments` and `--no-format`, plus the scope flags above.
|
|
371
198
|
|
|
372
|
-
|
|
199
|
+
**Exit codes:** `0` passed, `1` a checker met its exit threshold, `2` invalid input or configuration, a checker that produced no result, or a scan that skipped a file. Skipped files are named on stderr and in `skippedFiles` in `--json` output.
|
|
373
200
|
|
|
374
|
-
|
|
201
|
+
**Configuration.** An optional `loadwise.config.json` sets defaults for every checker: selected checkers, ignored paths, rule levels, per-path overrides and checker policies. Add `"$schema": "./node_modules/loadwise/schema/loadwise.config.schema.json"` for editor completion. See the [configuration guide](https://loadwise.mintlify.app/configuration) and the [schema](https://github.com/IbrahimHafez1/loadwise/blob/main/schema/loadwise.config.schema.json). `--config` and `--ignore` override the file for one run.
|
|
375
202
|
|
|
376
|
-
**
|
|
203
|
+
**Cache and memory.** `loadwise check` reuses the previous result for an unchanged Git project; `LOADWISE_NO_CACHE=1` always scans afresh. Large projects run with a larger Node memory limit, and a checker that still runs out of memory exits 2 with the limit it had. Raise it with `NODE_OPTIONS=--max-old-space-size=<megabytes>`. Details are in the [commands guide](https://loadwise.mintlify.app/commands).
|
|
377
204
|
|
|
378
|
-
|
|
205
|
+
## Security and releases
|
|
379
206
|
|
|
380
|
-
|
|
381
|
-
| --------------------------- | ---------------------------------------------------------- |
|
|
382
|
-
| `loadwise.scan` | Rescan every workspace folder now |
|
|
383
|
-
| `loadwise.applyFix` | Apply one fix (from a code action or code lens) |
|
|
384
|
-
| `loadwise.applyAllFixes` | Apply every eligible fix in a file (its URI as argument) |
|
|
385
|
-
| `loadwise.dismiss` | Dismiss a finding or a rule in a file |
|
|
386
|
-
| `loadwise.showDismissed` | List dismissed findings, with Restore and Restore all |
|
|
387
|
-
| `loadwise.restoreDismissed` | Restore the given dismissal, or every one without argument |
|
|
207
|
+
Releases carry Sigstore attestations. [Release signatures](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/release-signatures.md) shows how to verify a download with `gh attestation verify`. Report vulnerabilities as described in [SECURITY.md](https://github.com/IbrahimHafez1/loadwise/blob/main/SECURITY.md).
|
|
388
208
|
|
|
389
|
-
|
|
209
|
+
## Contributing
|
|
390
210
|
|
|
391
|
-
|
|
392
|
-
| ---------- | ----------- | ----------------------------------------------------------------------------- |
|
|
393
|
-
| `enabled` | `true` | Show diagnostics for the folder |
|
|
394
|
-
| `project` | `""` | TypeScript or JavaScript project config, relative to the folder |
|
|
395
|
-
| `cli` | `""` | Absolute path to another `dist/bin/loadwise.js`, such as a development build |
|
|
396
|
-
| `severity` | `"default"` | `error`, `warning`, `information` or `hint` shows every finding at that level |
|
|
397
|
-
| `codeLens` | `true` | Show the Apply fix and Dismiss code lenses |
|
|
211
|
+
See [CONTRIBUTING.md](https://github.com/IbrahimHafez1/loadwise/blob/main/CONTRIBUTING.md) and the [contributing guide](https://loadwise.mintlify.app/contributing). After your first scan, [share a useful finding or a false positive](https://github.com/IbrahimHafez1/loadwise/issues/203), or [pick a good first issue](https://github.com/IbrahimHafez1/loadwise/issues?q=is%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22).
|
|
398
212
|
|
|
399
213
|
## Full Rule & Checker Reference
|
|
400
214
|
|
|
@@ -419,86 +233,35 @@ examples/slow.ts:7:48 [array-repeated-find #9ab891a8b8f7] medium: Each item can
|
|
|
419
233
|
| --------------------------------------- | ------------------------------------------------------------------ | --------------------------------- |
|
|
420
234
|
| JavaScript or TypeScript | `-p tsconfig.json`, `--watch -p tsconfig.json` or `src/handler.ts` | No |
|
|
421
235
|
| Schema-aware index checks | `--schema snapshot.json` | No (snapshot) |
|
|
422
|
-
| Python, Go, Java, C#, Rust
|
|
236
|
+
| Python, Go, Java, C#, Rust, Ruby, PHP | `polyglot src` | No |
|
|
423
237
|
| OTLP/JSON from any application language | `traces request.otlp.json --threshold 5` | No |
|
|
424
238
|
| Executed PostgreSQL or MongoDB plan | `plan explain.json` | No |
|
|
425
239
|
| Live database inspection | `db` | Yes, read-only unless `--measure` |
|
|
426
240
|
|
|
427
241
|
## Source checks
|
|
428
242
|
|
|
429
|
-
Run
|
|
430
|
-
|
|
431
|
-
Engines: one-shot checks use Microsoft's Go-based [TypeScript 7](https://github.com/microsoft/typescript-go) compiler on Node.js 22.13+ with the optional native package for your platform (same findings; 1.7–2.2 times faster on the 3,200-file benchmark in [PERFORMANCE.md](PERFORMANCE.md), and the gain depends on the project) and fall back to TypeScript 6.0.3 with a stderr note when TypeScript 7 rejects the configuration (for example `baseUrl` or `moduleResolution: "node10"`). `--engine native` (alias `--native`) requires TypeScript 7 and reports incompatible configuration as exit 2; `--engine js` always uses TypeScript 6.0.3. `perf --json` names the engine in `engine` (`"js"` or `"native"`). `--watch` uses TypeScript 6.0.3 on a single project; with `--watch --json` each completed scan writes one JSON line.
|
|
243
|
+
Run it where `tsconfig.json` or `jsconfig.json` lives, pass `-p path/to/config.json`, or give explicit JS/TS files. One-shot checks use the TypeScript 7 native engine when its optional package is installed and fall back to TypeScript 6.0.3; `--engine js` or `--engine native` (alias `--native`) picks one, and `--watch` rescans after saves. Project discovery, engines and installs without optional packages are in [Source checks](https://loadwise.mintlify.app/checkers/performance#source-checks).
|
|
432
244
|
|
|
433
245
|
<!-- loadwise:rules:start checker=performance group=source-checks -->
|
|
434
246
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
| <a id="list-count-per-request"></a>[`list-count-per-request`](docs/rules/performance/list-count-per-request.md) | medium | A list endpoint runs a full count query on every request. |
|
|
454
|
-
| <a id="list-query-overfetch"></a>[`list-query-overfetch`](docs/rules/performance/list-query-overfetch.md) | medium | A list query loads large columns or nested relations without a narrow projection. |
|
|
455
|
-
| <a id="llm-call-without-max-tokens"></a>[`llm-call-without-max-tokens`](docs/rules/performance/llm-call-without-max-tokens.md) | medium | An OpenAI chat or responses call sets no output token limit. |
|
|
456
|
-
| <a id="loop-copy-accumulator"></a>[`loop-copy-accumulator`](docs/rules/performance/loop-copy-accumulator.md) | medium | A loop copies its growing result on every iteration. |
|
|
457
|
-
| <a id="mongoose-hydrate-for-to-object"></a>[`mongoose-hydrate-for-to-object`](docs/rules/performance/mongoose-hydrate-for-to-object.md) | medium | A Mongoose query hydrates full Documents only to convert them immediately via .toObject() or .toJSON(). |
|
|
458
|
-
| <a id="mongoose-missing-lean"></a>[`mongoose-missing-lean`](docs/rules/performance/mongoose-missing-lean.md) | medium | A Mongoose read query is returned or serialized without .lean(), paying full Document hydration overhead. |
|
|
459
|
-
| <a id="node-event-listener-leak"></a>[`node-event-listener-leak`](docs/rules/performance/node-event-listener-leak.md) | high | An event listener is registered inside a repeated or per-request context without matching cleanup. |
|
|
460
|
-
| <a id="node-sync-compression-in-async"></a>[`node-sync-compression-in-async`](docs/rules/performance/node-sync-compression-in-async.md) | medium | A synchronous zlib call blocks the event loop inside an async function. |
|
|
461
|
-
| <a id="node-sync-crypto-in-async"></a>[`node-sync-crypto-in-async`](docs/rules/performance/node-sync-crypto-in-async.md) | high | A synchronous crypto call blocks the event loop inside an async function. |
|
|
462
|
-
| <a id="node-sync-fs-in-async"></a>[`node-sync-fs-in-async`](docs/rules/performance/node-sync-fs-in-async.md) | medium | A synchronous fs call blocks the event loop inside an async function. |
|
|
463
|
-
| <a id="node-sync-process-in-async"></a>[`node-sync-process-in-async`](docs/rules/performance/node-sync-process-in-async.md) | high | A synchronous child_process call blocks the event loop inside an async function. |
|
|
464
|
-
| <a id="notification-send-in-loop"></a>[`notification-send-in-loop`](docs/rules/performance/notification-send-in-loop.md) | high | A push, email or Firebase message is sent once per loop iteration instead of in one batch. |
|
|
465
|
-
| <a id="orm-cartesian-include"></a>[`orm-cartesian-include`](docs/rules/performance/orm-cartesian-include.md) | high | One query joins two or more one-to-many relations, so the returned rows multiply. |
|
|
466
|
-
| <a id="orm-deep-offset"></a>[`orm-deep-offset`](docs/rules/performance/orm-deep-offset.md) | high | A list query pages with a large or unbounded offset, so the database reads and discards every skipped row. |
|
|
467
|
-
| <a id="password-hash-pure-js"></a>[`password-hash-pure-js`](docs/rules/performance/password-hash-pure-js.md) | medium | bcryptjs hashes passwords in pure JavaScript on the main thread. |
|
|
468
|
-
| <a id="password-hash-sync-in-async"></a>[`password-hash-sync-in-async`](docs/rules/performance/password-hash-sync-in-async.md) | high | A synchronous bcrypt call blocks the event loop inside an async function. |
|
|
469
|
-
| <a id="pg-count-materialization"></a>[`pg-count-materialization`](docs/rules/performance/pg-count-materialization.md) | medium | A pg query loads rows only to count them. |
|
|
470
|
-
| <a id="pg-filter-materialization"></a>[`pg-filter-materialization`](docs/rules/performance/pg-filter-materialization.md) | medium | A pg query loads an unbounded result that JavaScript then filters by equality. |
|
|
471
|
-
| <a id="pg-first-materialization"></a>[`pg-first-materialization`](docs/rules/performance/pg-first-materialization.md) | medium | A pg query loads an unbounded result to read only its first row. |
|
|
472
|
-
| <a id="pg-query-in-loop"></a>[`pg-query-in-loop`](docs/rules/performance/pg-query-in-loop.md) | high | A pg query runs once per loop iteration. |
|
|
473
|
-
| <a id="pg-top-k-materialization"></a>[`pg-top-k-materialization`](docs/rules/performance/pg-top-k-materialization.md) | medium | A pg query loads an unbounded result that JavaScript sorts to keep the top rows. |
|
|
474
|
-
| <a id="pg-unreleased-checkout"></a>[`pg-unreleased-checkout`](docs/rules/performance/pg-unreleased-checkout.md) | critical | A chained pool checkout loses the client, so it is never released. |
|
|
475
|
-
| <a id="pool-created-per-request-or-item"></a>[`pool-created-per-request-or-item`](docs/rules/performance/pool-created-per-request-or-item.md) | critical | A database, Redis, S3, OpenAI, Anthropic or Stripe client or pool is created on a per-request or per-item path. |
|
|
476
|
-
| <a id="prisma-count-materialization"></a>[`prisma-count-materialization`](docs/rules/performance/prisma-count-materialization.md) | medium | A Prisma query loads rows only to count them. |
|
|
477
|
-
| <a id="prisma-filter-materialization"></a>[`prisma-filter-materialization`](docs/rules/performance/prisma-filter-materialization.md) | medium | A Prisma query loads an unbounded result that JavaScript then filters by equality. |
|
|
478
|
-
| <a id="prisma-first-materialization"></a>[`prisma-first-materialization`](docs/rules/performance/prisma-first-materialization.md) | medium | A Prisma query loads an unbounded result to read only its first row. |
|
|
479
|
-
| <a id="prisma-query-in-loop"></a>[`prisma-query-in-loop`](docs/rules/performance/prisma-query-in-loop.md) | high | A Prisma query runs once per loop iteration. |
|
|
480
|
-
| <a id="prisma-top-k-materialization"></a>[`prisma-top-k-materialization`](docs/rules/performance/prisma-top-k-materialization.md) | medium | A Prisma query loads an unbounded result that JavaScript sorts to keep the top rows. |
|
|
481
|
-
| <a id="queue-add-in-loop"></a>[`queue-add-in-loop`](docs/rules/performance/queue-add-in-loop.md) | high | A job queue add runs once per item instead of one addBulk. |
|
|
482
|
-
| <a id="react-component-defined-in-component"></a>[`react-component-defined-in-component`](docs/rules/performance/react-component-defined-in-component.md) | medium | A component is declared inside another component and rendered as an element, so it remounts on every render and loses its state and DOM. |
|
|
483
|
-
| <a id="react-context-value-recreated"></a>[`react-context-value-recreated`](docs/rules/performance/react-context-value-recreated.md) | low | An inline object or array literal in Context.Provider value creates a new reference on every render. |
|
|
484
|
-
| <a id="react-fetch-in-effect-no-abort"></a>[`react-fetch-in-effect-no-abort`](docs/rules/performance/react-fetch-in-effect-no-abort.md) | low | A fetch in an effect has no AbortController or cleanup, so dependency changes can race and apply stale results. |
|
|
485
|
-
| <a id="react-index-as-key"></a>[`react-index-as-key`](docs/rules/performance/react-index-as-key.md) | low | A list item uses the map index as its React key, which breaks reconciliation when items are inserted or reordered. |
|
|
486
|
-
| <a id="react-inline-object-in-jsx-prop"></a>[`react-inline-object-in-jsx-prop`](docs/rules/performance/react-inline-object-in-jsx-prop.md) | low | An inline object literal is passed to a memo() component, creating a new reference each render and defeating the memo. |
|
|
487
|
-
| <a id="react-missing-cleanup"></a>[`react-missing-cleanup`](docs/rules/performance/react-missing-cleanup.md) | medium | An effect starts a global listener, interval, socket or endless subscription and returns no cleanup, so it leaks on every remount. |
|
|
488
|
-
| <a id="rebuild-lookup-in-loop"></a>[`rebuild-lookup-in-loop`](docs/rules/performance/rebuild-lookup-in-loop.md) | high | A Set or Map is rebuilt from the same data on every loop iteration. |
|
|
489
|
-
| <a id="redis-command-in-loop"></a>[`redis-command-in-loop`](docs/rules/performance/redis-command-in-loop.md) | high | A per-key Redis command runs once per loop iteration. |
|
|
490
|
-
| <a id="redis-keys-command"></a>[`redis-keys-command`](docs/rules/performance/redis-keys-command.md) | high | A Redis KEYS call blocks the server while it scans the keyspace. |
|
|
491
|
-
| <a id="reduce-copy-accumulator"></a>[`reduce-copy-accumulator`](docs/rules/performance/reduce-copy-accumulator.md) | medium | A reduce callback copies its growing accumulator on every step. |
|
|
492
|
-
| <a id="sequential-http-in-loop"></a>[`sequential-http-in-loop`](docs/rules/performance/sequential-http-in-loop.md) | high | Independent HTTP requests are awaited one at a time inside a loop. |
|
|
493
|
-
| <a id="serial-awaits-in-literal"></a>[`serial-awaits-in-literal`](docs/rules/performance/serial-awaits-in-literal.md) | medium | An array or object literal awaits two or more independent values one after another. |
|
|
494
|
-
| <a id="service-query-in-loop"></a>[`service-query-in-loop`](docs/rules/performance/service-query-in-loop.md) | high | A loop calls a project function that runs several database operations per item. |
|
|
495
|
-
| <a id="session-memory-store"></a>[`session-memory-store`](docs/rules/performance/session-memory-store.md) | high | An express-session middleware has no store, so sessions live in process memory. |
|
|
496
|
-
| <a id="sql-select-star-in-query"></a>[`sql-select-star-in-query`](docs/rules/performance/sql-select-star-in-query.md) | low | A raw SQL query selects every column with SELECT * instead of the columns it needs. |
|
|
497
|
-
| <a id="unbounded-list-query"></a>[`unbounded-list-query`](docs/rules/performance/unbounded-list-query.md) | high | A request handler returns query results without an apparent row limit. |
|
|
498
|
-
| <a id="unbounded-module-cache"></a>[`unbounded-module-cache`](docs/rules/performance/unbounded-module-cache.md) | medium | A long-lived cache accepts dynamic keys without an apparent bound or eviction. |
|
|
499
|
-
| <a id="vue-v-for-missing-key"></a>[`vue-v-for-missing-key`](docs/rules/performance/vue-v-for-missing-key.md) | low | A list rendered with h() has no key prop, forcing inefficient patching. |
|
|
500
|
-
| <a id="vue-watch-missing-cleanup"></a>[`vue-watch-missing-cleanup`](docs/rules/performance/vue-watch-missing-cleanup.md) | medium | onMounted registers a global listener, timer or observer with no unmount cleanup. |
|
|
501
|
-
| <a id="whole-payload-in-memory"></a>[`whole-payload-in-memory`](docs/rules/performance/whole-payload-in-memory.md) | medium | An operation loads an entire file, stream, or response into memory. |
|
|
247
|
+
<a id="angular-default-change-detection"></a>[`angular-default-change-detection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/angular-default-change-detection.md) · <a id="angular-ngfor-missing-trackby"></a>[`angular-ngfor-missing-trackby`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/angular-ngfor-missing-trackby.md) · <a id="angular-subscribe-without-cleanup"></a>[`angular-subscribe-without-cleanup`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/angular-subscribe-without-cleanup.md) · <a id="array-repeated-find"></a>[`array-repeated-find`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/array-repeated-find.md) · <a id="array-repeated-membership"></a>[`array-repeated-membership`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/array-repeated-membership.md) · <a id="array-shift-in-fifo-drain"></a>[`array-shift-in-fifo-drain`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/array-shift-in-fifo-drain.md) ·
|
|
248
|
+
<a id="dom-layout-thrashing"></a>[`dom-layout-thrashing`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/dom-layout-thrashing.md) · <a id="dom-listener-without-cleanup"></a>[`dom-listener-without-cleanup`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/dom-listener-without-cleanup.md) · <a id="dom-unthrottled-scroll-resize"></a>[`dom-unthrottled-scroll-resize`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/dom-unthrottled-scroll-resize.md) ·
|
|
249
|
+
<a id="express-missing-compression"></a>[`express-missing-compression`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/express-missing-compression.md) · <a id="external-call-in-transaction"></a>[`external-call-in-transaction`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/external-call-in-transaction.md) ·
|
|
250
|
+
<a id="filter-for-existence"></a>[`filter-for-existence`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/filter-for-existence.md) · <a id="frontend-barrel-heavy-import"></a>[`frontend-barrel-heavy-import`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/frontend-barrel-heavy-import.md) ·
|
|
251
|
+
<a id="graphql-n-plus-one-resolver"></a>[`graphql-n-plus-one-resolver`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/graphql-n-plus-one-resolver.md) ·
|
|
252
|
+
<a id="heavy-media-in-request-handler"></a>[`heavy-media-in-request-handler`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/heavy-media-in-request-handler.md) ·
|
|
253
|
+
<a id="js-fixed-regexp-in-loop"></a>[`js-fixed-regexp-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/js-fixed-regexp-in-loop.md) · <a id="json-roundtrip-clone"></a>[`json-roundtrip-clone`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/json-roundtrip-clone.md) · <a id="json-stringify-in-loop"></a>[`json-stringify-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/json-stringify-in-loop.md) ·
|
|
254
|
+
<a id="list-count-per-request"></a>[`list-count-per-request`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/list-count-per-request.md) · <a id="list-query-overfetch"></a>[`list-query-overfetch`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/list-query-overfetch.md) · <a id="llm-call-without-max-tokens"></a>[`llm-call-without-max-tokens`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/llm-call-without-max-tokens.md) · <a id="loop-copy-accumulator"></a>[`loop-copy-accumulator`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/loop-copy-accumulator.md) ·
|
|
255
|
+
<a id="mongoose-hydrate-for-to-object"></a>[`mongoose-hydrate-for-to-object`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/mongoose-hydrate-for-to-object.md) · <a id="mongoose-missing-lean"></a>[`mongoose-missing-lean`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/mongoose-missing-lean.md) ·
|
|
256
|
+
<a id="node-event-listener-leak"></a>[`node-event-listener-leak`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/node-event-listener-leak.md) · <a id="node-sync-compression-in-async"></a>[`node-sync-compression-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/node-sync-compression-in-async.md) · <a id="node-sync-crypto-in-async"></a>[`node-sync-crypto-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/node-sync-crypto-in-async.md) · <a id="node-sync-fs-in-async"></a>[`node-sync-fs-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/node-sync-fs-in-async.md) · <a id="node-sync-process-in-async"></a>[`node-sync-process-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/node-sync-process-in-async.md) · <a id="notification-send-in-loop"></a>[`notification-send-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/notification-send-in-loop.md) ·
|
|
257
|
+
<a id="orm-cartesian-include"></a>[`orm-cartesian-include`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/orm-cartesian-include.md) · <a id="orm-deep-offset"></a>[`orm-deep-offset`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/orm-deep-offset.md) ·
|
|
258
|
+
<a id="password-hash-pure-js"></a>[`password-hash-pure-js`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/password-hash-pure-js.md) · <a id="password-hash-sync-in-async"></a>[`password-hash-sync-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/password-hash-sync-in-async.md) · <a id="pg-count-materialization"></a>[`pg-count-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-count-materialization.md) · <a id="pg-filter-materialization"></a>[`pg-filter-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-filter-materialization.md) · <a id="pg-first-materialization"></a>[`pg-first-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-first-materialization.md) · <a id="pg-query-in-loop"></a>[`pg-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-query-in-loop.md) · <a id="pg-top-k-materialization"></a>[`pg-top-k-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-top-k-materialization.md) · <a id="pg-unreleased-checkout"></a>[`pg-unreleased-checkout`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-unreleased-checkout.md) · <a id="pool-created-per-request-or-item"></a>[`pool-created-per-request-or-item`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pool-created-per-request-or-item.md) · <a id="prisma-count-materialization"></a>[`prisma-count-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-count-materialization.md) · <a id="prisma-filter-materialization"></a>[`prisma-filter-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-filter-materialization.md) · <a id="prisma-first-materialization"></a>[`prisma-first-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-first-materialization.md) · <a id="prisma-query-in-loop"></a>[`prisma-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-query-in-loop.md) · <a id="prisma-top-k-materialization"></a>[`prisma-top-k-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-top-k-materialization.md) ·
|
|
259
|
+
<a id="queue-add-in-loop"></a>[`queue-add-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/queue-add-in-loop.md) ·
|
|
260
|
+
<a id="react-component-defined-in-component"></a>[`react-component-defined-in-component`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/react-component-defined-in-component.md) · <a id="react-context-value-recreated"></a>[`react-context-value-recreated`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/react-context-value-recreated.md) · <a id="react-fetch-in-effect-no-abort"></a>[`react-fetch-in-effect-no-abort`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/react-fetch-in-effect-no-abort.md) · <a id="react-index-as-key"></a>[`react-index-as-key`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/react-index-as-key.md) · <a id="react-inline-object-in-jsx-prop"></a>[`react-inline-object-in-jsx-prop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/react-inline-object-in-jsx-prop.md) · <a id="react-missing-cleanup"></a>[`react-missing-cleanup`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/react-missing-cleanup.md) · <a id="rebuild-lookup-in-loop"></a>[`rebuild-lookup-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/rebuild-lookup-in-loop.md) · <a id="redis-command-in-loop"></a>[`redis-command-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/redis-command-in-loop.md) · <a id="redis-keys-command"></a>[`redis-keys-command`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/redis-keys-command.md) · <a id="reduce-copy-accumulator"></a>[`reduce-copy-accumulator`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/reduce-copy-accumulator.md) ·
|
|
261
|
+
<a id="sequential-http-in-loop"></a>[`sequential-http-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/sequential-http-in-loop.md) · <a id="serial-awaits-in-literal"></a>[`serial-awaits-in-literal`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/serial-awaits-in-literal.md) · <a id="service-query-in-loop"></a>[`service-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/service-query-in-loop.md) · <a id="session-memory-store"></a>[`session-memory-store`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/session-memory-store.md) · <a id="sql-select-star-in-query"></a>[`sql-select-star-in-query`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/sql-select-star-in-query.md) ·
|
|
262
|
+
<a id="unbounded-list-query"></a>[`unbounded-list-query`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/unbounded-list-query.md) · <a id="unbounded-module-cache"></a>[`unbounded-module-cache`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/unbounded-module-cache.md) ·
|
|
263
|
+
<a id="vue-v-for-missing-key"></a>[`vue-v-for-missing-key`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/vue-v-for-missing-key.md) · <a id="vue-watch-missing-cleanup"></a>[`vue-watch-missing-cleanup`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/vue-watch-missing-cleanup.md) ·
|
|
264
|
+
<a id="whole-payload-in-memory"></a>[`whole-payload-in-memory`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/whole-payload-in-memory.md)
|
|
502
265
|
|
|
503
266
|
<!-- loadwise:rules:end -->
|
|
504
267
|
|
|
@@ -508,117 +271,76 @@ Covered libraries: Prisma, Drizzle ORM (PostgreSQL, MySQL and SQLite core APIs),
|
|
|
508
271
|
|
|
509
272
|
<!-- loadwise:rules:start checker=performance group=orm-and-query-integrity-checks -->
|
|
510
273
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
| <a id="orm-query-in-loop"></a>[`orm-query-in-loop`](docs/rules/performance/orm-query-in-loop.md) | high | A TypeORM, Sequelize, Mongoose, Knex or Kysely operation runs once per loop iteration. |
|
|
517
|
-
| <a id="prisma-distinct-in-memory"></a>[`prisma-distinct-in-memory`](docs/rules/performance/prisma-distinct-in-memory.md) | medium | Prisma findMany with distinct reads every matching row and de-duplicates in memory. |
|
|
518
|
-
| <a id="prisma-relation-count-in-list"></a>[`prisma-relation-count-in-list`](docs/rules/performance/prisma-relation-count-in-list.md) | medium | A paged Prisma findMany selects a relation _count computed over the whole related table. |
|
|
519
|
-
| <a id="typeorm-existence-materialization"></a>[`typeorm-existence-materialization`](docs/rules/performance/typeorm-existence-materialization.md) | medium | A TypeORM entity is loaded only to check whether it exists. |
|
|
520
|
-
| <a id="typeorm-load-then-save"></a>[`typeorm-load-then-save`](docs/rules/performance/typeorm-load-then-save.md) | high | A TypeORM entity is loaded only to change a few fields and save it back. |
|
|
521
|
-
| <a id="typeorm-transaction-in-loop"></a>[`typeorm-transaction-in-loop`](docs/rules/performance/typeorm-transaction-in-loop.md) | high | A loop calls a helper that starts one TypeORM transaction per item. |
|
|
522
|
-
| <a id="typeorm-wide-projection"></a>[`typeorm-wide-projection`](docs/rules/performance/typeorm-wide-projection.md) | low | A TypeORM DTO projection loads wide columns it never uses. |
|
|
274
|
+
<a id="drizzle-query-in-loop"></a>[`drizzle-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/drizzle-query-in-loop.md) ·
|
|
275
|
+
<a id="guard-query-per-request"></a>[`guard-query-per-request`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/guard-query-per-request.md) ·
|
|
276
|
+
<a id="orm-count-materialization"></a>[`orm-count-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/orm-count-materialization.md) · <a id="orm-query-in-loop"></a>[`orm-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/orm-query-in-loop.md) ·
|
|
277
|
+
<a id="prisma-distinct-in-memory"></a>[`prisma-distinct-in-memory`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-distinct-in-memory.md) · <a id="prisma-relation-count-in-list"></a>[`prisma-relation-count-in-list`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-relation-count-in-list.md) ·
|
|
278
|
+
<a id="typeorm-existence-materialization"></a>[`typeorm-existence-materialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/typeorm-existence-materialization.md) · <a id="typeorm-load-then-save"></a>[`typeorm-load-then-save`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/typeorm-load-then-save.md) · <a id="typeorm-transaction-in-loop"></a>[`typeorm-transaction-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/typeorm-transaction-in-loop.md) · <a id="typeorm-wide-projection"></a>[`typeorm-wide-projection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/typeorm-wide-projection.md)
|
|
523
279
|
|
|
524
280
|
<!-- loadwise:rules:end -->
|
|
525
281
|
|
|
526
282
|
### Project-defined access policy
|
|
527
283
|
|
|
528
|
-
Put
|
|
284
|
+
Put a policy in the `performance` section of `loadwise.config.json`, or pass `--policy path/to/file.json`. The [access policy guide](https://loadwise.mintlify.app/checkers/performance#project-defined-access-policy) lists its sections, and [examples/query-policy.json](https://github.com/IbrahimHafez1/loadwise/blob/main/examples/query-policy.json) is a starting point.
|
|
529
285
|
|
|
530
286
|
### Async work and sorting
|
|
531
287
|
|
|
532
288
|
<!-- loadwise:rules:start checker=performance group=async-work-and-sorting -->
|
|
533
289
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
| <a id="promise-combinator-serial-await"></a>[`promise-combinator-serial-await`](docs/rules/performance/promise-combinator-serial-await.md) | medium | Promise.all receives calls that were already awaited one by one. |
|
|
543
|
-
| <a id="repeated-workbook-decode"></a>[`repeated-workbook-decode`](docs/rules/performance/repeated-workbook-decode.md) | medium | A workflow decodes the same input with ExcelJS more than once. |
|
|
544
|
-
| <a id="typeorm-unused-count"></a>[`typeorm-unused-count`](docs/rules/performance/typeorm-unused-count.md) | medium | A TypeORM count-and-list query discards its total in immediate tuple destructuring. |
|
|
290
|
+
<a id="await-before-early-exit"></a>[`await-before-early-exit`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/await-before-early-exit.md) ·
|
|
291
|
+
<a id="count-then-page-serial"></a>[`count-then-page-serial`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/count-then-page-serial.md) ·
|
|
292
|
+
<a id="drizzle-last-insert-id"></a>[`drizzle-last-insert-id`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/drizzle-last-insert-id.md) ·
|
|
293
|
+
<a id="known-reads-awaited-serially"></a>[`known-reads-awaited-serially`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/known-reads-awaited-serially.md) ·
|
|
294
|
+
<a id="next-server-fetch-waterfall"></a>[`next-server-fetch-waterfall`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/next-server-fetch-waterfall.md) · <a id="numeric-sort-for-extreme"></a>[`numeric-sort-for-extreme`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/numeric-sort-for-extreme.md) ·
|
|
295
|
+
<a id="prisma-count-for-existence"></a>[`prisma-count-for-existence`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/prisma-count-for-existence.md) · <a id="promise-combinator-serial-await"></a>[`promise-combinator-serial-await`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/promise-combinator-serial-await.md) ·
|
|
296
|
+
<a id="repeated-workbook-decode"></a>[`repeated-workbook-decode`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/repeated-workbook-decode.md) ·
|
|
297
|
+
<a id="typeorm-unused-count"></a>[`typeorm-unused-count`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/typeorm-unused-count.md)
|
|
545
298
|
|
|
546
299
|
<!-- loadwise:rules:end -->
|
|
547
300
|
|
|
548
301
|
## Schema-aware index checks
|
|
549
302
|
|
|
550
|
-
The source checker
|
|
303
|
+
The source checker compares the indexes declared in the project's ORM schema (Prisma, Drizzle, TypeORM, Sequelize, Mongoose) with the queries it finds. Pass `--schema snapshot.json` (written by `perf db --schema-snapshot`) to use real table sizes. Details are in [Schema-aware index checks](https://loadwise.mintlify.app/checkers/performance#schema-aware-index-checks).
|
|
551
304
|
|
|
552
305
|
<!-- loadwise:rules:start checker=performance group=schema-aware-index-checks -->
|
|
553
306
|
|
|
554
|
-
|
|
555
|
-
| ------------------------------------------------------------------------------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------- |
|
|
556
|
-
| <a id="index-missing-filter"></a>[`index-missing-filter`](docs/rules/performance/index-missing-filter.md) | high | A query filters on a column that no index leads with. |
|
|
557
|
-
| <a id="index-missing-foreign-key"></a>[`index-missing-foreign-key`](docs/rules/performance/index-missing-foreign-key.md) | high | A foreign key column in the schema has no index. |
|
|
558
|
-
| <a id="index-missing-order"></a>[`index-missing-order`](docs/rules/performance/index-missing-order.md) | medium | A query orders by columns that no index serves in that order. |
|
|
559
|
-
| <a id="index-redundant-prefix"></a>[`index-redundant-prefix`](docs/rules/performance/index-redundant-prefix.md) | low | An index repeats the leading columns of a longer index on the same table, adding write cost for no read benefit. |
|
|
560
|
-
| <a id="index-unusable-expression"></a>[`index-unusable-expression`](docs/rules/performance/index-unusable-expression.md) | high | A function or expression on an indexed column keeps the index from being used. |
|
|
561
|
-
| <a id="index-unusable-pattern"></a>[`index-unusable-pattern`](docs/rules/performance/index-unusable-pattern.md) | high | A predicate such as a leading-wildcard LIKE cannot use an ordinary index. |
|
|
307
|
+
<a id="index-missing-filter"></a>[`index-missing-filter`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/index-missing-filter.md) · <a id="index-missing-foreign-key"></a>[`index-missing-foreign-key`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/index-missing-foreign-key.md) · <a id="index-missing-order"></a>[`index-missing-order`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/index-missing-order.md) · <a id="index-redundant-prefix"></a>[`index-redundant-prefix`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/index-redundant-prefix.md) · <a id="index-unusable-expression"></a>[`index-unusable-expression`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/index-unusable-expression.md) · <a id="index-unusable-pattern"></a>[`index-unusable-pattern`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/index-unusable-pattern.md)
|
|
562
308
|
|
|
563
309
|
<!-- loadwise:rules:end -->
|
|
564
310
|
|
|
565
311
|
## Polyglot source checks
|
|
566
312
|
|
|
567
|
-
`npx loadwise perf polyglot src`
|
|
313
|
+
`npx loadwise perf polyglot src` checks Python, Go, Java, C#, Rust, Ruby and PHP files with the optional [ast-grep](https://ast-grep.github.io/) binary, and `npx loadwise rel polyglot src` runs the reliability patterns. Details are in [Polyglot source checks](https://loadwise.mintlify.app/checkers/performance#polyglot-source-checks).
|
|
568
314
|
|
|
569
315
|
<!-- loadwise:rules:start checker=performance group=polyglot-source-checks -->
|
|
570
316
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
| <a id="go-sql-query-in-loop"></a>[`go-sql-query-in-loop`](docs/rules/performance/go-sql-query-in-loop.md) | high | A Go database query executes inside a loop instead of batching. |
|
|
577
|
-
| <a id="go-string-concat-in-loop"></a>[`go-string-concat-in-loop`](docs/rules/performance/go-string-concat-in-loop.md) | medium | String concatenation in a Go loop allocates repeatedly; use strings.Builder. |
|
|
578
|
-
| <a id="java-fixed-regex-in-loop"></a>[`java-fixed-regex-in-loop`](docs/rules/performance/java-fixed-regex-in-loop.md) | medium | A Java Pattern with a fixed pattern is compiled inside a loop. |
|
|
579
|
-
| <a id="java-jdbc-query-in-loop"></a>[`java-jdbc-query-in-loop`](docs/rules/performance/java-jdbc-query-in-loop.md) | high | A JDBC query executes inside a Java loop instead of batching. |
|
|
580
|
-
| <a id="java-string-concat-in-loop"></a>[`java-string-concat-in-loop`](docs/rules/performance/java-string-concat-in-loop.md) | medium | String concatenation in a Java loop allocates repeatedly; use StringBuilder. |
|
|
581
|
-
| <a id="python-blocking-sleep-in-async"></a>[`python-blocking-sleep-in-async`](docs/rules/performance/python-blocking-sleep-in-async.md) | high | A blocking time.sleep call runs inside a Python async def function. |
|
|
582
|
-
| <a id="python-copy-growing-list"></a>[`python-copy-growing-list`](docs/rules/performance/python-copy-growing-list.md) | medium | A Python loop rebuilds a growing list with items = items + [value]. |
|
|
583
|
-
| <a id="python-fixed-regex-in-loop"></a>[`python-fixed-regex-in-loop`](docs/rules/performance/python-fixed-regex-in-loop.md) | low | A Python loop compiles a fixed pattern with re.compile on every iteration. |
|
|
584
|
-
| <a id="python-n-plus-one-orm-loop"></a>[`python-n-plus-one-orm-loop`](docs/rules/performance/python-n-plus-one-orm-loop.md) | high | An ORM query executes inside a Python loop instead of using eager loading or batching. |
|
|
585
|
-
| <a id="python-sync-requests-in-async"></a>[`python-sync-requests-in-async`](docs/rules/performance/python-sync-requests-in-async.md) | high | A blocking requests HTTP call runs inside a Python async def function. |
|
|
586
|
-
| <a id="python-unbounded-comprehension"></a>[`python-unbounded-comprehension`](docs/rules/performance/python-unbounded-comprehension.md) | medium | A Python list comprehension materializes an unbounded collection in memory. |
|
|
587
|
-
| <a id="rust-clone-in-loop"></a>[`rust-clone-in-loop`](docs/rules/performance/rust-clone-in-loop.md) | low | Cloning values inside a Rust loop adds avoidable heap allocations. |
|
|
588
|
-
| <a id="rust-fixed-regex-in-loop"></a>[`rust-fixed-regex-in-loop`](docs/rules/performance/rust-fixed-regex-in-loop.md) | medium | A Rust Regex with a fixed pattern is compiled inside a loop. |
|
|
589
|
-
| <a id="rust-format-in-loop"></a>[`rust-format-in-loop`](docs/rules/performance/rust-format-in-loop.md) | low | Calling format! inside a Rust loop allocates a new String on every iteration. |
|
|
317
|
+
<a id="csharp-ef-count-materialized"></a>[`csharp-ef-count-materialized`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/csharp-ef-count-materialized.md) · <a id="csharp-ef-query-in-loop"></a>[`csharp-ef-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/csharp-ef-query-in-loop.md) · <a id="csharp-fixed-regex-in-loop"></a>[`csharp-fixed-regex-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/csharp-fixed-regex-in-loop.md) · <a id="csharp-string-concat-in-loop"></a>[`csharp-string-concat-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/csharp-string-concat-in-loop.md) ·
|
|
318
|
+
<a id="go-fixed-regexp-in-loop"></a>[`go-fixed-regexp-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/go-fixed-regexp-in-loop.md) · <a id="go-sql-query-in-loop"></a>[`go-sql-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/go-sql-query-in-loop.md) · <a id="go-string-concat-in-loop"></a>[`go-string-concat-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/go-string-concat-in-loop.md) ·
|
|
319
|
+
<a id="java-fixed-regex-in-loop"></a>[`java-fixed-regex-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/java-fixed-regex-in-loop.md) · <a id="java-jdbc-query-in-loop"></a>[`java-jdbc-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/java-jdbc-query-in-loop.md) · <a id="java-string-concat-in-loop"></a>[`java-string-concat-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/java-string-concat-in-loop.md) ·
|
|
320
|
+
<a id="php-eloquent-query-in-loop"></a>[`php-eloquent-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/php-eloquent-query-in-loop.md) · <a id="python-blocking-sleep-in-async"></a>[`python-blocking-sleep-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/python-blocking-sleep-in-async.md) · <a id="python-copy-growing-list"></a>[`python-copy-growing-list`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/python-copy-growing-list.md) · <a id="python-fixed-regex-in-loop"></a>[`python-fixed-regex-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/python-fixed-regex-in-loop.md) · <a id="python-n-plus-one-orm-loop"></a>[`python-n-plus-one-orm-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/python-n-plus-one-orm-loop.md) · <a id="python-sync-requests-in-async"></a>[`python-sync-requests-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/python-sync-requests-in-async.md) · <a id="python-unbounded-comprehension"></a>[`python-unbounded-comprehension`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/python-unbounded-comprehension.md) ·
|
|
321
|
+
<a id="ruby-active-record-query-in-loop"></a>[`ruby-active-record-query-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/ruby-active-record-query-in-loop.md) · <a id="rust-clone-in-loop"></a>[`rust-clone-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/rust-clone-in-loop.md) · <a id="rust-fixed-regex-in-loop"></a>[`rust-fixed-regex-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/rust-fixed-regex-in-loop.md) · <a id="rust-format-in-loop"></a>[`rust-format-in-loop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/rust-format-in-loop.md)
|
|
590
322
|
|
|
591
323
|
<!-- loadwise:rules:end -->
|
|
592
324
|
|
|
593
325
|
## Trace checks in other languages and databases
|
|
594
326
|
|
|
595
|
-
`npx loadwise perf traces <file>` reads one local OTLP
|
|
327
|
+
`npx loadwise perf traces <file>` reads one local OTLP, Jaeger or Zipkin v2 JSON export, and `--threshold` sets how many similar sibling calls form a finding. Details are in [Trace checks](https://loadwise.mintlify.app/checkers/performance#trace-checks-in-other-languages-and-databases).
|
|
596
328
|
|
|
597
329
|
<!-- loadwise:rules:start checker=performance group=trace-checks-in-other-languages-and-databases -->
|
|
598
330
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
| <a id="duplicate-key-read"></a>[`duplicate-key-read`](docs/rules/performance/duplicate-key-read.md) | medium | A trace repeats the same key or row read under one parent span. |
|
|
602
|
-
| <a id="redis-keys-scan"></a>[`redis-keys-scan`](docs/rules/performance/redis-keys-scan.md) | high | A trace shows a Redis KEYS command scanning the keyspace. |
|
|
603
|
-
| <a id="redis-repeated-read"></a>[`redis-repeated-read`](docs/rules/performance/redis-repeated-read.md) | medium | A trace shows repeated sibling Redis GET or HGET calls. |
|
|
604
|
-
| <a id="repeated-db-span"></a>[`repeated-db-span`](docs/rules/performance/repeated-db-span.md) | high | A trace shows many similar sibling database calls under one parent. |
|
|
331
|
+
<a id="duplicate-key-read"></a>[`duplicate-key-read`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/duplicate-key-read.md) ·
|
|
332
|
+
<a id="redis-keys-scan"></a>[`redis-keys-scan`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/redis-keys-scan.md) · <a id="redis-repeated-read"></a>[`redis-repeated-read`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/redis-repeated-read.md) · <a id="repeated-db-span"></a>[`repeated-db-span`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/repeated-db-span.md)
|
|
605
333
|
|
|
606
334
|
<!-- loadwise:rules:end -->
|
|
607
335
|
|
|
608
336
|
## Executed query plans
|
|
609
337
|
|
|
610
|
-
`npx loadwise perf plan <file>` reads
|
|
338
|
+
`npx loadwise perf plan <file>` reads PostgreSQL `EXPLAIN (ANALYZE, FORMAT JSON)` or MongoDB `explain("executionStats")` output and reports the stage path and observed counts. Details are in [Executed query plans](https://loadwise.mintlify.app/checkers/performance#executed-query-plans).
|
|
611
339
|
|
|
612
340
|
<!-- loadwise:rules:start checker=performance group=executed-query-plans -->
|
|
613
341
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
| <a id="mongo-collection-scan"></a>[`mongo-collection-scan`](docs/rules/performance/mongo-collection-scan.md) | high | A MongoDB plan scans many documents for each one it returns. |
|
|
617
|
-
| <a id="mongo-deep-skip"></a>[`mongo-deep-skip`](docs/rules/performance/mongo-deep-skip.md) | high | A MongoDB query skips past many documents to return a page. |
|
|
618
|
-
| <a id="mongo-disk-sort"></a>[`mongo-disk-sort`](docs/rules/performance/mongo-disk-sort.md) | medium | A MongoDB sort spilled to disk. |
|
|
619
|
-
| <a id="pg-deep-offset"></a>[`pg-deep-offset`](docs/rules/performance/pg-deep-offset.md) | high | A PostgreSQL plan walks past many rows with OFFSET to return a page. |
|
|
620
|
-
| <a id="pg-disk-sort"></a>[`pg-disk-sort`](docs/rules/performance/pg-disk-sort.md) | medium | A PostgreSQL sort spilled to disk. |
|
|
621
|
-
| <a id="pg-sequential-scan"></a>[`pg-sequential-scan`](docs/rules/performance/pg-sequential-scan.md) | high | A PostgreSQL plan scans many rows for each one it returns. |
|
|
342
|
+
<a id="mongo-collection-scan"></a>[`mongo-collection-scan`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/mongo-collection-scan.md) · <a id="mongo-deep-skip"></a>[`mongo-deep-skip`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/mongo-deep-skip.md) · <a id="mongo-disk-sort"></a>[`mongo-disk-sort`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/mongo-disk-sort.md) ·
|
|
343
|
+
<a id="pg-deep-offset"></a>[`pg-deep-offset`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-deep-offset.md) · <a id="pg-disk-sort"></a>[`pg-disk-sort`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-disk-sort.md) · <a id="pg-sequential-scan"></a>[`pg-sequential-scan`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/pg-sequential-scan.md)
|
|
622
344
|
|
|
623
345
|
<!-- loadwise:rules:end -->
|
|
624
346
|
|
|
@@ -626,7 +348,7 @@ The source checker reads the project's ORM schema (Prisma, Drizzle, TypeORM, Seq
|
|
|
626
348
|
|
|
627
349
|
`npx loadwise perf db` is the only command that connects to a database. Point it at a staging or read replica database, never a primary you cannot afford to touch. It uses the project's own `pg`, `mysql2` or `mongodb` package.
|
|
628
350
|
|
|
629
|
-
The connection comes from the environment, never a flag: `DATABASE_URL` (or the variable named by `--url-env`)
|
|
351
|
+
The connection comes from the environment, never a flag: `DATABASE_URL` (or the variable named by `--url-env`) or `DB_*` variables, optionally read from `--env-file FILE`.
|
|
630
352
|
|
|
631
353
|
```sh
|
|
632
354
|
npx loadwise perf db --env-file .env.staging --schema-snapshot snapshot.json
|
|
@@ -634,34 +356,14 @@ npx loadwise perf db --queries queries.sql --analyze
|
|
|
634
356
|
npx loadwise perf --schema snapshot.json
|
|
635
357
|
```
|
|
636
358
|
|
|
637
|
-
| Flag | Effect |
|
|
638
|
-
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
639
|
-
| `--schema-snapshot FILE` | Write a schema snapshot (indexes, table sizes, measured round trip) for `--schema`. |
|
|
640
|
-
| `--top N` | Explain the N slowest statements (default 20). |
|
|
641
|
-
| `--queries FILE` | Explain these concrete SELECT statements. |
|
|
642
|
-
| `--analyze` | Run `EXPLAIN ANALYZE` on the `--queries` SELECTs inside rolled-back read-only transactions. |
|
|
643
|
-
| `--measure --i-understand-this-locks-tables` | PostgreSQL staging only. Time each suggested index for `--queries` by building it in a rolled-back transaction. |
|
|
644
|
-
| `--runs N` | `EXPLAIN ANALYZE` runs per side for `--measure` (default 5). |
|
|
645
|
-
|
|
646
|
-
`--include-contextual`, `--ignore RULE` and `--json` work as in the other commands.
|
|
647
|
-
|
|
648
359
|
<!-- loadwise:rules:start checker=performance group=database-inspection-optional -->
|
|
649
360
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
| <a id="db-duplicate-index"></a>[`db-duplicate-index`](docs/rules/performance/db-duplicate-index.md) | low | A database index is covered by another index on the same table. |
|
|
653
|
-
| <a id="db-missing-index"></a>[`db-missing-index`](docs/rules/performance/db-missing-index.md) | high | A query plan scans a table that a suggested index would let it seek. |
|
|
654
|
-
| <a id="db-seq-scan-heavy-table"></a>[`db-seq-scan-heavy-table`](docs/rules/performance/db-seq-scan-heavy-table.md) | high | A large table is read by many sequential scans on the live database. |
|
|
655
|
-
| <a id="db-slow-query-plan"></a>[`db-slow-query-plan`](docs/rules/performance/db-slow-query-plan.md) | high | One of the slowest statements reads a table with a full table scan. |
|
|
656
|
-
| <a id="db-unindexed-foreign-key"></a>[`db-unindexed-foreign-key`](docs/rules/performance/db-unindexed-foreign-key.md) | high | A foreign key on the live database has no index that leads with its columns. |
|
|
657
|
-
| <a id="db-unused-index"></a>[`db-unused-index`](docs/rules/performance/db-unused-index.md) | low | A database index has not been scanned since statistics were last reset. |
|
|
658
|
-
| <a id="mongo-collection-scan-observed"></a>[`mongo-collection-scan-observed`](docs/rules/performance/mongo-collection-scan-observed.md) | high | Profiled MongoDB operations scanned a whole collection. |
|
|
361
|
+
<a id="db-duplicate-index"></a>[`db-duplicate-index`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/db-duplicate-index.md) · <a id="db-missing-index"></a>[`db-missing-index`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/db-missing-index.md) · <a id="db-seq-scan-heavy-table"></a>[`db-seq-scan-heavy-table`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/db-seq-scan-heavy-table.md) · <a id="db-slow-query-plan"></a>[`db-slow-query-plan`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/db-slow-query-plan.md) · <a id="db-sqlite-large-scan"></a>[`db-sqlite-large-scan`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/db-sqlite-large-scan.md) · <a id="db-unindexed-foreign-key"></a>[`db-unindexed-foreign-key`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/db-unindexed-foreign-key.md) · <a id="db-unused-index"></a>[`db-unused-index`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/db-unused-index.md) ·
|
|
362
|
+
<a id="mongo-collection-scan-observed"></a>[`mongo-collection-scan-observed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/performance/mongo-collection-scan-observed.md)
|
|
659
363
|
|
|
660
364
|
<!-- loadwise:rules:end -->
|
|
661
365
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
**`--measure` blocks writes** to the table while each index builds. It refuses a connection variable or database name matching `/prod/i`, a replica, an unknown table size and any table over 5,000,000 estimated rows, and it needs the long confirmation flag. With the HypoPG extension, suggested indexes are also checked hypothetically. Output labels every figure as _measured_ (timed on your database) or _estimated_ (planner statistics, a model or HypoPG).
|
|
366
|
+
Sessions are read-only. `--measure --i-understand-this-locks-tables` blocks writes while it times each suggested index, so it runs only on PostgreSQL staging databases. The [database inspection guide](https://loadwise.mintlify.app/checkers/performance#database-inspection-optional) covers every flag (`--top`, `--queries`, `--analyze`, `--runs`), SQLite files, MySQL without TLS and the safety limits.
|
|
665
367
|
|
|
666
368
|
# Reliability checker
|
|
667
369
|
|
|
@@ -673,96 +375,39 @@ Some rules moved here from the performance and maintainability checkers and kept
|
|
|
673
375
|
|
|
674
376
|
<!-- loadwise:rules:start checker=reliability group=source-rules -->
|
|
675
377
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
| <a id="http-call-without-timeout"></a>[`http-call-without-timeout`](docs/rules/reliability/http-call-without-timeout.md) | high | A fetch or axios call has no timeout or abort signal. |
|
|
698
|
-
| <a id="interval-not-cleared"></a>[`interval-not-cleared`](docs/rules/reliability/interval-not-cleared.md) | medium | A setInterval handle is discarded or never cleared, so the timer outlives its owner. |
|
|
699
|
-
| <a id="invalid-typeof-comparison"></a>[`invalid-typeof-comparison`](docs/rules/reliability/invalid-typeof-comparison.md) | high | A typeof result is compared to a string typeof never returns, so the check never matches. |
|
|
700
|
-
| <a id="java-resource-without-try"></a>[`java-resource-without-try`](docs/rules/reliability/java-resource-without-try.md) | high | A Java stream, reader or connection is opened outside try-with-resources, so an exception leaks it. |
|
|
701
|
-
| <a id="json-parse-unguarded"></a>[`json-parse-unguarded`](docs/rules/reliability/json-parse-unguarded.md) | medium | JSON.parse runs on outside input with no try/catch, so malformed input throws where it is not handled. |
|
|
702
|
-
| <a id="loop-index-past-length"></a>[`loop-index-past-length`](docs/rules/reliability/loop-index-past-length.md) | high | A loop runs its index up to and including length, so the last pass reads past the end. |
|
|
703
|
-
| <a id="mongoose-aggregate-uncast-id"></a>[`mongoose-aggregate-uncast-id`](docs/rules/reliability/mongoose-aggregate-uncast-id.md) | high | A Mongoose aggregate $match compares _id to an uncast string instead of an ObjectId. |
|
|
704
|
-
| <a id="nan-comparison"></a>[`nan-comparison`](docs/rules/reliability/nan-comparison.md) | high | A value is compared to NaN with an equality operator, which is never true. |
|
|
705
|
-
| <a id="next-server-env-in-client"></a>[`next-server-env-in-client`](docs/rules/reliability/next-server-env-in-client.md) | high | A 'use client' file reads a process.env variable without the NEXT_PUBLIC_ prefix, so it is unavailable in the browser by default. |
|
|
706
|
-
| <a id="parse-failure-resets-file"></a>[`parse-failure-resets-file`](docs/rules/reliability/parse-failure-resets-file.md) | high | A write after a read or parse failure can replace unreadable contents at the same path. |
|
|
707
|
-
| <a id="payment-missing-idempotency-key"></a>[`payment-missing-idempotency-key`](docs/rules/reliability/payment-missing-idempotency-key.md) | high | A Stripe call that moves money has no idempotency key, so a retry can charge or pay out twice. |
|
|
708
|
-
| <a id="pg-transaction-on-pool"></a>[`pg-transaction-on-pool`](docs/rules/reliability/pg-transaction-on-pool.md) | critical | A transaction statement is sent to a pool, so its statements can run on different connections. |
|
|
709
|
-
| <a id="pool-without-connection-timeout"></a>[`pool-without-connection-timeout`](docs/rules/reliability/pool-without-connection-timeout.md) | medium | A pg Pool or Client sets no connectionTimeoutMillis, so its default of 0 waits for a connection forever. |
|
|
710
|
-
| <a id="prisma-dependent-writes"></a>[`prisma-dependent-writes`](docs/rules/reliability/prisma-dependent-writes.md) | high | Adjacent Prisma creates pass a value from the first record into the next write. |
|
|
711
|
-
| <a id="prisma-read-modify-write"></a>[`prisma-read-modify-write`](docs/rules/reliability/prisma-read-modify-write.md) | critical | A Prisma read feeds a numeric update of the same row, losing concurrent updates. |
|
|
712
|
-
| <a id="prisma-transaction-client-escape"></a>[`prisma-transaction-client-escape`](docs/rules/reliability/prisma-transaction-client-escape.md) | critical | A Prisma call inside an interactive transaction uses the outer client instead of the transaction client. |
|
|
713
|
-
| <a id="promise-return-escapes-catch"></a>[`promise-return-escapes-catch`](docs/rules/reliability/promise-return-escapes-catch.md) | high | Returning a promise directly from a protected try block can bypass its catch on rejection. |
|
|
714
|
-
| <a id="python-bare-except"></a>[`python-bare-except`](docs/rules/reliability/python-bare-except.md) | medium | A bare except also catches SystemExit and KeyboardInterrupt, hiding shutdowns and bugs. |
|
|
715
|
-
| <a id="python-swallowed-exception"></a>[`python-swallowed-exception`](docs/rules/reliability/python-swallowed-exception.md) | medium | A Python except block only passes, so the failure is dropped silently. |
|
|
716
|
-
| <a id="query-runner-not-released"></a>[`query-runner-not-released`](docs/rules/reliability/query-runner-not-released.md) | critical | A TypeORM QueryRunner is not released in a finally block, so an error leaks its pooled connection. |
|
|
717
|
-
| <a id="react-async-effect-callback"></a>[`react-async-effect-callback`](docs/rules/reliability/react-async-effect-callback.md) | medium | An async function is passed to useEffect, so its promise is treated as the cleanup function and its errors go unhandled. |
|
|
718
|
-
| <a id="react-effect-sets-state-every-render"></a>[`react-effect-sets-state-every-render`](docs/rules/reliability/react-effect-sets-state-every-render.md) | high | An effect with no dependency array sets state to a new value on every run, so the component re-renders forever. |
|
|
719
|
-
| <a id="react-list-missing-key"></a>[`react-list-missing-key`](docs/rules/reliability/react-list-missing-key.md) | medium | An element or fragment returned from .map() has no key prop, so React cannot track items when the list changes. |
|
|
720
|
-
| <a id="react-state-mutated-in-place"></a>[`react-state-mutated-in-place`](docs/rules/reliability/react-state-mutated-in-place.md) | high | A useState value is mutated in place and passed to its own setter, so React sees the same reference and skips the re-render. |
|
|
721
|
-
| <a id="redis-incr-then-expire"></a>[`redis-incr-then-expire`](docs/rules/reliability/redis-incr-then-expire.md) | medium | A Redis counter increment and its expire on the same key are two round trips and not atomic. |
|
|
722
|
-
| <a id="request-number-unvalidated"></a>[`request-number-unvalidated`](docs/rules/reliability/request-number-unvalidated.md) | medium | A number parsed from request input reaches a query or calculation with no NaN or range check. |
|
|
723
|
-
| <a id="retry-without-backoff"></a>[`retry-without-backoff`](docs/rules/reliability/retry-without-backoff.md) | medium | A retry loop calls the network again with no delay between attempts. |
|
|
724
|
-
| <a id="return-in-finally"></a>[`return-in-finally`](docs/rules/reliability/return-in-finally.md) | high | Returning from finally can replace a pending return value or suppress a thrown error. |
|
|
725
|
-
| <a id="return-newline"></a>[`return-newline`](docs/rules/reliability/return-newline.md) | high | A line break after return ends the statement before the apparent return value. |
|
|
726
|
-
| <a id="rust-unwrap-in-production"></a>[`rust-unwrap-in-production`](docs/rules/reliability/rust-unwrap-in-production.md) | medium | Rust code outside tests calls unwrap(), turning an Err or None into a panic. |
|
|
727
|
-
| <a id="sql-insert-truncated-at-semicolon"></a>[`sql-insert-truncated-at-semicolon`](docs/rules/reliability/sql-insert-truncated-at-semicolon.md) | high | A SQL dump parser ends INSERT values at a semicolon inside quoted text. |
|
|
728
|
-
| <a id="stream-pipe-unhandled-error"></a>[`stream-pipe-unhandled-error`](docs/rules/reliability/stream-pipe-unhandled-error.md) | high | A stream is piped with .pipe() and no error handling, so a stream error can crash the process or leak the file. |
|
|
729
|
-
| <a id="swallowed-error"></a>[`swallowed-error`](docs/rules/reliability/swallowed-error.md) | medium | A catch block drops the error and the code after the try carries on as if it succeeded. |
|
|
730
|
-
| <a id="switch-not-exhaustive"></a>[`switch-not-exhaustive`](docs/rules/reliability/switch-not-exhaustive.md) | medium | A switch over a union or enum has no default and misses members, so the missing value leaves the result undefined. |
|
|
731
|
-
| <a id="test-cleanup-after-await"></a>[`test-cleanup-after-await`](docs/rules/reliability/test-cleanup-after-await.md) | medium | A test waits before cleaning up a local resource, so a rejection can leave it running. |
|
|
732
|
-
| <a id="throw-non-error"></a>[`throw-non-error`](docs/rules/reliability/throw-non-error.md) | medium | A string, number or object literal is thrown instead of an Error, so there is no stack trace. |
|
|
733
|
-
| <a id="typeorm-transaction-client-escape"></a>[`typeorm-transaction-client-escape`](docs/rules/reliability/typeorm-transaction-client-escape.md) | critical | A write inside a TypeORM transaction goes through a repository not bound to it. |
|
|
734
|
-
| <a id="unbounded-promise-all"></a>[`unbounded-promise-all`](docs/rules/reliability/unbounded-promise-all.md) | high | Promise.all runs over an unbounded collection without a concurrency limit, risking memory spikes or downstream saturation. |
|
|
735
|
-
| <a id="uncaught-exception-continues"></a>[`uncaught-exception-continues`](docs/rules/reliability/uncaught-exception-continues.md) | high | An uncaughtException handler neither exits nor rethrows, so the process keeps running in an undefined state. |
|
|
736
|
-
| <a id="unguarded-boundary-access"></a>[`unguarded-boundary-access`](docs/rules/reliability/unguarded-boundary-access.md) | medium | A nested property is read from outside input or a lookup that can be missing, so absent data throws a TypeError. |
|
|
737
|
-
| <a id="unreachable-code"></a>[`unreachable-code`](docs/rules/reliability/unreachable-code.md) | medium | Statements follow a return, throw, break or continue in the same block and never run. |
|
|
738
|
-
| <a id="upload-without-size-limit"></a>[`upload-without-size-limit`](docs/rules/reliability/upload-without-size-limit.md) | high | A multer or Nest upload interceptor has no file size limit. |
|
|
739
|
-
| <a id="webhook-missing-idempotency-check"></a>[`webhook-missing-idempotency-check`](docs/rules/reliability/webhook-missing-idempotency-check.md) | medium | A webhook route inserts rows without first checking whether the event was already processed. |
|
|
378
|
+
<a id="assignment-in-condition"></a>[`assignment-in-condition`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/assignment-in-condition.md) · <a id="async-array-predicate"></a>[`async-array-predicate`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/async-array-predicate.md) · <a id="async-callback-unhandled-rejection"></a>[`async-callback-unhandled-rejection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/async-callback-unhandled-rejection.md) · <a id="async-promise-executor"></a>[`async-promise-executor`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/async-promise-executor.md) · <a id="async-route-unhandled-rejection"></a>[`async-route-unhandled-rejection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/async-route-unhandled-rejection.md) ·
|
|
379
|
+
<a id="browser-not-closed"></a>[`browser-not-closed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/browser-not-closed.md) ·
|
|
380
|
+
<a id="check-then-update-race"></a>[`check-then-update-race`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/check-then-update-race.md) · <a id="child-process-without-error-listener"></a>[`child-process-without-error-listener`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/child-process-without-error-listener.md) · <a id="crlf-unsafe-line-split"></a>[`crlf-unsafe-line-split`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/crlf-unsafe-line-split.md) · <a id="csharp-async-void"></a>[`csharp-async-void`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/csharp-async-void.md) · <a id="csharp-disposable-without-using"></a>[`csharp-disposable-without-using`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/csharp-disposable-without-using.md) · <a id="csharp-sync-task-wait-in-async"></a>[`csharp-sync-task-wait-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/csharp-sync-task-wait-in-async.md) ·
|
|
381
|
+
<a id="db-pool-client-not-released"></a>[`db-pool-client-not-released`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/db-pool-client-not-released.md) · <a id="discarded-error-result"></a>[`discarded-error-result`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/discarded-error-result.md) · <a id="discarded-file-write-count"></a>[`discarded-file-write-count`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/discarded-file-write-count.md) · <a id="drizzle-unfiltered-write"></a>[`drizzle-unfiltered-write`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/drizzle-unfiltered-write.md) · <a id="drizzle-write-preflight"></a>[`drizzle-write-preflight`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/drizzle-write-preflight.md) ·
|
|
382
|
+
<a id="error-logged-without-stack"></a>[`error-logged-without-stack`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/error-logged-without-stack.md) · <a id="error-rethrown-without-cause"></a>[`error-rethrown-without-cause`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/error-rethrown-without-cause.md) ·
|
|
383
|
+
<a id="file-handle-not-closed"></a>[`file-handle-not-closed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/file-handle-not-closed.md) · <a id="find-then-create-race"></a>[`find-then-create-race`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/find-then-create-race.md) · <a id="floating-promise"></a>[`floating-promise`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/floating-promise.md) ·
|
|
384
|
+
<a id="go-defer-before-error-check"></a>[`go-defer-before-error-check`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/go-defer-before-error-check.md) · <a id="go-error-discarded"></a>[`go-error-discarded`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/go-error-discarded.md) · <a id="go-http-call-without-deadline"></a>[`go-http-call-without-deadline`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/go-http-call-without-deadline.md) · <a id="go-http-response-body-not-closed"></a>[`go-http-response-body-not-closed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/go-http-response-body-not-closed.md) · <a id="go-sql-rows-leaked"></a>[`go-sql-rows-leaked`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/go-sql-rows-leaked.md) · <a id="go-sql-rows-unchecked-err"></a>[`go-sql-rows-unchecked-err`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/go-sql-rows-unchecked-err.md) ·
|
|
385
|
+
<a id="http-call-without-timeout"></a>[`http-call-without-timeout`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/http-call-without-timeout.md) ·
|
|
386
|
+
<a id="interval-not-cleared"></a>[`interval-not-cleared`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/interval-not-cleared.md) · <a id="invalid-typeof-comparison"></a>[`invalid-typeof-comparison`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/invalid-typeof-comparison.md) ·
|
|
387
|
+
<a id="java-resource-without-try"></a>[`java-resource-without-try`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/java-resource-without-try.md) · <a id="java-shared-date-format"></a>[`java-shared-date-format`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/java-shared-date-format.md) · <a id="json-parse-unguarded"></a>[`json-parse-unguarded`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/json-parse-unguarded.md) ·
|
|
388
|
+
<a id="kotlin-run-blocking-in-suspend"></a>[`kotlin-run-blocking-in-suspend`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/kotlin-run-blocking-in-suspend.md) ·
|
|
389
|
+
<a id="loop-index-past-length"></a>[`loop-index-past-length`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/loop-index-past-length.md) · <a id="lossy-same-file-text-rewrite"></a>[`lossy-same-file-text-rewrite`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/lossy-same-file-text-rewrite.md) ·
|
|
390
|
+
<a id="mongoose-aggregate-uncast-id"></a>[`mongoose-aggregate-uncast-id`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/mongoose-aggregate-uncast-id.md) ·
|
|
391
|
+
<a id="nan-comparison"></a>[`nan-comparison`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/nan-comparison.md) · <a id="next-server-env-in-client"></a>[`next-server-env-in-client`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/next-server-env-in-client.md) · <a id="numeric-array-default-sort"></a>[`numeric-array-default-sort`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/numeric-array-default-sort.md) ·
|
|
392
|
+
<a id="parse-failure-resets-file"></a>[`parse-failure-resets-file`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/parse-failure-resets-file.md) · <a id="payment-missing-idempotency-key"></a>[`payment-missing-idempotency-key`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/payment-missing-idempotency-key.md) · <a id="pg-advisory-lock-session"></a>[`pg-advisory-lock-session`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/pg-advisory-lock-session.md) · <a id="pg-listen-session"></a>[`pg-listen-session`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/pg-listen-session.md) · <a id="pg-transaction-on-pool"></a>[`pg-transaction-on-pool`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/pg-transaction-on-pool.md) · <a id="pool-without-connection-timeout"></a>[`pool-without-connection-timeout`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/pool-without-connection-timeout.md) · <a id="prisma-dependent-writes"></a>[`prisma-dependent-writes`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/prisma-dependent-writes.md) · <a id="prisma-read-modify-write"></a>[`prisma-read-modify-write`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/prisma-read-modify-write.md) · <a id="prisma-transaction-client-escape"></a>[`prisma-transaction-client-escape`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/prisma-transaction-client-escape.md) · <a id="promise-return-escapes-catch"></a>[`promise-return-escapes-catch`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/promise-return-escapes-catch.md) · <a id="python-bare-except"></a>[`python-bare-except`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/python-bare-except.md) · <a id="python-file-not-closed"></a>[`python-file-not-closed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/python-file-not-closed.md) · <a id="python-mutated-mutable-default"></a>[`python-mutated-mutable-default`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/python-mutated-mutable-default.md) · <a id="python-requests-without-timeout"></a>[`python-requests-without-timeout`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/python-requests-without-timeout.md) · <a id="python-swallowed-exception"></a>[`python-swallowed-exception`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/python-swallowed-exception.md) ·
|
|
393
|
+
<a id="query-runner-not-released"></a>[`query-runner-not-released`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/query-runner-not-released.md) ·
|
|
394
|
+
<a id="react-async-effect-callback"></a>[`react-async-effect-callback`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/react-async-effect-callback.md) · <a id="react-effect-sets-state-every-render"></a>[`react-effect-sets-state-every-render`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/react-effect-sets-state-every-render.md) · <a id="react-list-missing-key"></a>[`react-list-missing-key`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/react-list-missing-key.md) · <a id="react-state-mutated-in-place"></a>[`react-state-mutated-in-place`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/react-state-mutated-in-place.md) · <a id="redis-incr-then-expire"></a>[`redis-incr-then-expire`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/redis-incr-then-expire.md) · <a id="request-number-unvalidated"></a>[`request-number-unvalidated`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/request-number-unvalidated.md) · <a id="retry-without-backoff"></a>[`retry-without-backoff`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/retry-without-backoff.md) · <a id="return-in-finally"></a>[`return-in-finally`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/return-in-finally.md) · <a id="return-newline"></a>[`return-newline`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/return-newline.md) · <a id="rust-blocking-std-in-async"></a>[`rust-blocking-std-in-async`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/rust-blocking-std-in-async.md) · <a id="rust-mutex-guard-across-await"></a>[`rust-mutex-guard-across-await`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/rust-mutex-guard-across-await.md) · <a id="rust-unwrap-in-production"></a>[`rust-unwrap-in-production`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/rust-unwrap-in-production.md) ·
|
|
395
|
+
<a id="same-file-stream-truncation"></a>[`same-file-stream-truncation`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/same-file-stream-truncation.md) · <a id="sql-insert-truncated-at-semicolon"></a>[`sql-insert-truncated-at-semicolon`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/sql-insert-truncated-at-semicolon.md) · <a id="stream-pipe-unhandled-error"></a>[`stream-pipe-unhandled-error`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/stream-pipe-unhandled-error.md) · <a id="swallowed-error"></a>[`swallowed-error`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/swallowed-error.md) · <a id="switch-not-exhaustive"></a>[`switch-not-exhaustive`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/switch-not-exhaustive.md) ·
|
|
396
|
+
<a id="test-cleanup-after-await"></a>[`test-cleanup-after-await`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/test-cleanup-after-await.md) · <a id="throw-non-error"></a>[`throw-non-error`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/throw-non-error.md) · <a id="typeorm-transaction-client-escape"></a>[`typeorm-transaction-client-escape`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/typeorm-transaction-client-escape.md) ·
|
|
397
|
+
<a id="unbounded-promise-all"></a>[`unbounded-promise-all`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/unbounded-promise-all.md) · <a id="uncaught-exception-continues"></a>[`uncaught-exception-continues`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/uncaught-exception-continues.md) · <a id="unchecked-json-cast"></a>[`unchecked-json-cast`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/unchecked-json-cast.md) · <a id="unguarded-boundary-access"></a>[`unguarded-boundary-access`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/unguarded-boundary-access.md) · <a id="unreachable-code"></a>[`unreachable-code`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/unreachable-code.md) · <a id="upload-without-size-limit"></a>[`upload-without-size-limit`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/upload-without-size-limit.md) ·
|
|
398
|
+
<a id="webhook-missing-idempotency-check"></a>[`webhook-missing-idempotency-check`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/webhook-missing-idempotency-check.md)
|
|
740
399
|
|
|
741
400
|
<!-- loadwise:rules:end -->
|
|
742
401
|
|
|
743
402
|
## Migration safety
|
|
744
403
|
|
|
745
|
-
`npx loadwise rel migrations` reads Prisma, Drizzle, TypeORM, Knex and Sequelize migrations (SQL or code) and flags
|
|
404
|
+
`npx loadwise rel migrations` reads Prisma, Drizzle, TypeORM, Knex and Sequelize migrations (SQL or code) and flags potentially unsafe schema changes. It reads files only. `--dialect postgres|mysql|sqlite|sqlserver` selects the rule set, `--json` gives structured output, and `--ignore RULE` skips a rule. The older `loadwise perf migrations` and `loadwise perf contracts` still work and print a note pointing to `rel`.
|
|
405
|
+
|
|
406
|
+
SQLite rebuilds, SQL Server index builds, dialect discovery and which migration files are read are covered in [Migration safety](https://loadwise.mintlify.app/checkers/reliability#migration-safety).
|
|
746
407
|
|
|
747
408
|
<!-- loadwise:rules:start checker=reliability group=migration-safety -->
|
|
748
409
|
|
|
749
|
-
|
|
750
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | -------------------------------------------------------------------------------------- |
|
|
751
|
-
| <a id="migration-breaking-drop"></a>[`migration-breaking-drop`](docs/rules/reliability/migration-breaking-drop.md) | critical | A migration drops a column or table that running code may still use. |
|
|
752
|
-
| <a id="migration-breaking-rename"></a>[`migration-breaking-rename`](docs/rules/reliability/migration-breaking-rename.md) | high | A migration renames a column or table that running code may still use. |
|
|
753
|
-
| <a id="migration-column-type-rewrite"></a>[`migration-column-type-rewrite`](docs/rules/reliability/migration-column-type-rewrite.md) | critical | A migration changes a column type in a way that rewrites the table. |
|
|
754
|
-
| <a id="migration-concurrent-in-transaction"></a>[`migration-concurrent-in-transaction`](docs/rules/reliability/migration-concurrent-in-transaction.md) | high | A CONCURRENTLY index statement runs inside a transaction, where PostgreSQL rejects it. |
|
|
755
|
-
| <a id="migration-constraint-not-valid"></a>[`migration-constraint-not-valid`](docs/rules/reliability/migration-constraint-not-valid.md) | high | A constraint is added and validated in one step instead of NOT VALID first. |
|
|
756
|
-
| <a id="migration-constraint-without-index"></a>[`migration-constraint-without-index`](docs/rules/reliability/migration-constraint-without-index.md) | high | A unique or primary key constraint builds its index while blocking writes. |
|
|
757
|
-
| <a id="migration-index-not-concurrent"></a>[`migration-index-not-concurrent`](docs/rules/reliability/migration-index-not-concurrent.md) | critical | A PostgreSQL index is built without CONCURRENTLY, blocking writes to the table. |
|
|
758
|
-
| <a id="migration-missing-lock-timeout"></a>[`migration-missing-lock-timeout`](docs/rules/reliability/migration-missing-lock-timeout.md) | high | A migration statement takes a lock with no lock_timeout set. |
|
|
759
|
-
| <a id="migration-mysql-lock-unspecified"></a>[`migration-mysql-lock-unspecified`](docs/rules/reliability/migration-mysql-lock-unspecified.md) | high | A MySQL ALTER does not state its LOCK level. |
|
|
760
|
-
| <a id="migration-mysql-table-copy"></a>[`migration-mysql-table-copy`](docs/rules/reliability/migration-mysql-table-copy.md) | critical | A MySQL ALTER copies the whole table. |
|
|
761
|
-
| <a id="migration-not-null-without-default"></a>[`migration-not-null-without-default`](docs/rules/reliability/migration-not-null-without-default.md) | high | A NOT NULL column is added without a default, which fails once rows exist. |
|
|
762
|
-
| <a id="migration-set-not-null-scan"></a>[`migration-set-not-null-scan`](docs/rules/reliability/migration-set-not-null-scan.md) | high | SET NOT NULL scans the whole table while holding a lock. |
|
|
763
|
-
| <a id="migration-table-rewrite-command"></a>[`migration-table-rewrite-command`](docs/rules/reliability/migration-table-rewrite-command.md) | critical | A migration runs VACUUM FULL, CLUSTER or REINDEX, which rewrites or locks the table. |
|
|
764
|
-
| <a id="migration-unparsed"></a>[`migration-unparsed`](docs/rules/reliability/migration-unparsed.md) | low | A migration statement could not be parsed and needs a manual review. |
|
|
765
|
-
| <a id="migration-volatile-default"></a>[`migration-volatile-default`](docs/rules/reliability/migration-volatile-default.md) | high | A column is added with a volatile default, which rewrites the table. |
|
|
410
|
+
<a id="migration-breaking-drop"></a>[`migration-breaking-drop`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-breaking-drop.md) · <a id="migration-breaking-rename"></a>[`migration-breaking-rename`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-breaking-rename.md) · <a id="migration-column-type-rewrite"></a>[`migration-column-type-rewrite`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-column-type-rewrite.md) · <a id="migration-concurrent-in-transaction"></a>[`migration-concurrent-in-transaction`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-concurrent-in-transaction.md) · <a id="migration-constraint-not-valid"></a>[`migration-constraint-not-valid`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-constraint-not-valid.md) · <a id="migration-constraint-without-index"></a>[`migration-constraint-without-index`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-constraint-without-index.md) · <a id="migration-index-not-concurrent"></a>[`migration-index-not-concurrent`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-index-not-concurrent.md) · <a id="migration-missing-lock-timeout"></a>[`migration-missing-lock-timeout`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-missing-lock-timeout.md) · <a id="migration-mysql-lock-unspecified"></a>[`migration-mysql-lock-unspecified`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-mysql-lock-unspecified.md) · <a id="migration-mysql-table-copy"></a>[`migration-mysql-table-copy`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-mysql-table-copy.md) · <a id="migration-not-null-without-default"></a>[`migration-not-null-without-default`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-not-null-without-default.md) · <a id="migration-set-not-null-scan"></a>[`migration-set-not-null-scan`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-set-not-null-scan.md) · <a id="migration-sqlserver-offline-index"></a>[`migration-sqlserver-offline-index`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-sqlserver-offline-index.md) · <a id="migration-table-access-exclusive-lock"></a>[`migration-table-access-exclusive-lock`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-table-access-exclusive-lock.md) · <a id="migration-table-rewrite-command"></a>[`migration-table-rewrite-command`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-table-rewrite-command.md) · <a id="migration-unparsed"></a>[`migration-unparsed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-unparsed.md) · <a id="migration-volatile-default"></a>[`migration-volatile-default`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/migration-volatile-default.md)
|
|
766
411
|
|
|
767
412
|
<!-- loadwise:rules:end -->
|
|
768
413
|
|
|
@@ -777,89 +422,50 @@ npx loadwise rel migrations # new migrations fail; baselined
|
|
|
777
422
|
|
|
778
423
|
## API contract safety
|
|
779
424
|
|
|
780
|
-
`npx loadwise rel contracts [--changed-since REF] [--json]` compares the working tree with the merge base of `REF` (default `HEAD`) and flags changes that break API clients
|
|
425
|
+
`npx loadwise rel contracts [--changed-since REF] [--json]` compares the working tree with the merge base of `REF` (default `HEAD`) and flags changes that break API clients in OpenAPI and Swagger JSON, GraphQL SDL and NestJS request and response classes. `loadwise check --changed-since REF` includes the same findings. What is compared is in [API contract safety](https://loadwise.mintlify.app/checkers/reliability#api-contract-safety).
|
|
781
426
|
|
|
782
427
|
<!-- loadwise:rules:start checker=reliability group=api-contract-safety -->
|
|
783
428
|
|
|
784
|
-
|
|
785
|
-
| --------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
|
|
786
|
-
| <a id="api-enum-value-removed"></a>[`api-enum-value-removed`](docs/rules/reliability/api-enum-value-removed.md) | high | An enum value or string-literal option that clients could send was removed. |
|
|
787
|
-
| <a id="api-removed-field"></a>[`api-removed-field`](docs/rules/reliability/api-removed-field.md) | high | A response field, GraphQL type, field, argument or union member, or returned DTO property was removed. |
|
|
788
|
-
| <a id="api-removed-operation"></a>[`api-removed-operation`](docs/rules/reliability/api-removed-operation.md) | critical | An OpenAPI operation or a GraphQL Query, Mutation or Subscription field was removed. |
|
|
789
|
-
| <a id="api-required-input"></a>[`api-required-input`](docs/rules/reliability/api-required-input.md) | high | A request field, parameter or GraphQL argument is new and required, or became required. |
|
|
790
|
-
| <a id="api-type-changed"></a>[`api-type-changed`](docs/rules/reliability/api-type-changed.md) | high | A field or parameter changed type, or a GraphQL type changed nullability in a breaking direction. |
|
|
429
|
+
<a id="api-enum-value-removed"></a>[`api-enum-value-removed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/api-enum-value-removed.md) · <a id="api-removed-field"></a>[`api-removed-field`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/api-removed-field.md) · <a id="api-removed-operation"></a>[`api-removed-operation`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/api-removed-operation.md) · <a id="api-required-input"></a>[`api-required-input`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/api-required-input.md) · <a id="api-type-changed"></a>[`api-type-changed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/reliability/api-type-changed.md)
|
|
791
430
|
|
|
792
431
|
<!-- loadwise:rules:end -->
|
|
793
432
|
|
|
794
433
|
# Maintainability checker
|
|
795
434
|
|
|
796
|
-
`loadwise maint` finds code that would benefit from a design review and enforces the architectural decisions a team has already made. Run it on a project folder with `npx loadwise maint .`, or `npx loadwise maint . --json`. The default `--fail-on contract` exits 1 only for a declared folder, data-access or query contract violation; design advisories stay visible and exit 0 on their own.
|
|
435
|
+
`loadwise maint` finds code that would benefit from a design review and enforces the architectural decisions a team has already made. Run it on a project folder with `npx loadwise maint .`, or `npx loadwise maint . --json`. The default `--fail-on contract` exits 1 only for a declared folder, data-access or query contract violation; design advisories stay visible and exit 0 on their own.
|
|
797
436
|
|
|
798
437
|
## What gets checked
|
|
799
438
|
|
|
800
439
|
<!-- loadwise:rules:start checker=maintainability group=what-gets-checked -->
|
|
801
440
|
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
| <a id="folder-boundary"></a>[`folder-boundary`](docs/rules/maintainability/folder-boundary.md) | medium | An import crosses a folder boundary the team declared. |
|
|
813
|
-
| <a id="high-branch-complexity"></a>[`high-branch-complexity`](docs/rules/maintainability/high-branch-complexity.md) | medium | A function reaches a branch complexity score of 15. |
|
|
814
|
-
| <a id="large-class"></a>[`large-class`](docs/rules/maintainability/large-class.md) | low | A class has more than 30 methods, accessors, constructors or function-valued fields. |
|
|
815
|
-
| <a id="large-module"></a>[`large-module`](docs/rules/maintainability/large-module.md) | low | A file has more than 600 lines of code. |
|
|
816
|
-
| <a id="long-parameter-list"></a>[`long-parameter-list`](docs/rules/maintainability/long-parameter-list.md) | low | A function takes more than 5 positional parameters. |
|
|
817
|
-
| <a id="query-mutates-state"></a>[`query-mutates-state`](docs/rules/maintainability/query-mutates-state.md) | medium | A method marked @maintainabilityQuery writes through this. |
|
|
818
|
-
| <a id="stray-console"></a>[`stray-console`](docs/rules/maintainability/stray-console.md) | low | A console call in production code bypasses the logger, so its output has no level or structure. |
|
|
819
|
-
| <a id="ts-suppression-without-reason"></a>[`ts-suppression-without-reason`](docs/rules/maintainability/ts-suppression-without-reason.md) | low | A @ts-ignore, @ts-expect-error or @ts-nocheck directive has no explanation. |
|
|
820
|
-
| <a id="tsconfig-strict-disabled"></a>[`tsconfig-strict-disabled`](docs/rules/maintainability/tsconfig-strict-disabled.md) | medium | A tsconfig turns off strict type checking. |
|
|
821
|
-
| <a id="unreferenced-file"></a>[`unreferenced-file`](docs/rules/maintainability/unreferenced-file.md) | low | A source file that nothing imports and that is not an entry point. |
|
|
822
|
-
| <a id="unused-export"></a>[`unused-export`](docs/rules/maintainability/unused-export.md) | low | An export that no scanned file imports. |
|
|
823
|
-
| <a id="unused-import"></a>[`unused-import`](docs/rules/maintainability/unused-import.md) | low | An imported name is never used in the file. |
|
|
824
|
-
| <a id="unused-local-function"></a>[`unused-local-function`](docs/rules/maintainability/unused-local-function.md) | low | A private function declaration has no references. |
|
|
825
|
-
| <a id="unused-local-variable"></a>[`unused-local-variable`](docs/rules/maintainability/unused-local-variable.md) | low | A local variable is assigned but never read. |
|
|
441
|
+
<a id="data-access-boundary"></a>[`data-access-boundary`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/data-access-boundary.md) · <a id="deep-control-flow"></a>[`deep-control-flow`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/deep-control-flow.md) · <a id="dependency-cycle"></a>[`dependency-cycle`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/dependency-cycle.md) · <a id="deprecated-node-api"></a>[`deprecated-node-api`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/deprecated-node-api.md) · <a id="double-type-assertion"></a>[`double-type-assertion`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/double-type-assertion.md) · <a id="duplicate-implementation"></a>[`duplicate-implementation`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/duplicate-implementation.md) ·
|
|
442
|
+
<a id="explicit-any"></a>[`explicit-any`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/explicit-any.md) ·
|
|
443
|
+
<a id="file-placement"></a>[`file-placement`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/file-placement.md) · <a id="focused-test-committed"></a>[`focused-test-committed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/focused-test-committed.md) · <a id="folder-boundary"></a>[`folder-boundary`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/folder-boundary.md) ·
|
|
444
|
+
<a id="high-branch-complexity"></a>[`high-branch-complexity`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/high-branch-complexity.md) ·
|
|
445
|
+
<a id="large-class"></a>[`large-class`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/large-class.md) · <a id="large-module"></a>[`large-module`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/large-module.md) · <a id="long-parameter-list"></a>[`long-parameter-list`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/long-parameter-list.md) ·
|
|
446
|
+
<a id="python-interactive-debugger"></a>[`python-interactive-debugger`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/python-interactive-debugger.md) ·
|
|
447
|
+
<a id="query-mutates-state"></a>[`query-mutates-state`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/query-mutates-state.md) ·
|
|
448
|
+
<a id="stray-console"></a>[`stray-console`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/stray-console.md) ·
|
|
449
|
+
<a id="ts-suppression-without-reason"></a>[`ts-suppression-without-reason`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/ts-suppression-without-reason.md) · <a id="tsconfig-strict-disabled"></a>[`tsconfig-strict-disabled`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/tsconfig-strict-disabled.md) ·
|
|
450
|
+
<a id="unreferenced-file"></a>[`unreferenced-file`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/unreferenced-file.md) · <a id="unsafe-wide-type"></a>[`unsafe-wide-type`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/unsafe-wide-type.md) · <a id="unused-export"></a>[`unused-export`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/unused-export.md) · <a id="unused-import"></a>[`unused-import`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/unused-import.md) · <a id="unused-local-function"></a>[`unused-local-function`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/unused-local-function.md) · <a id="unused-local-variable"></a>[`unused-local-variable`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/maintainability/unused-local-variable.md)
|
|
826
451
|
|
|
827
452
|
<!-- loadwise:rules:end -->
|
|
828
453
|
|
|
829
|
-
JS and TS use the TypeScript parser
|
|
454
|
+
JS and TS use the TypeScript parser, and the optional ast-grep executable supplies parsers for Python, Go, Java, C#, Rust, PHP, Ruby, Kotlin, C and C++. File discovery is described in [What gets checked](https://loadwise.mintlify.app/checkers/maintainability#what-gets-checked).
|
|
830
455
|
|
|
831
456
|
## Project rules
|
|
832
457
|
|
|
833
|
-
Save team decisions in the `maintainability` section of `loadwise.config.json` at the project root, or pass `--config path/to/policy.json`.
|
|
834
|
-
|
|
835
|
-
```json
|
|
836
|
-
{
|
|
837
|
-
"boundaries": [{ "from": "src/domain", "disallow": ["src/http"] }],
|
|
838
|
-
"placement": [{ "suffix": "_adapter.py", "under": ["adapters", "integrations"] }],
|
|
839
|
-
"dataAccess": { "modules": ["pg", "@prisma/client", "./src/generated"], "allowIn": ["src/data"] },
|
|
840
|
-
"limits": { "largeModuleLines": 600, "largeClassMembers": 30, "longParameterCount": 5 },
|
|
841
|
-
"exclude": ["third_party/legacy"]
|
|
842
|
-
}
|
|
843
|
-
```
|
|
844
|
-
|
|
845
|
-
`limits` sets the thresholds of `large-module`, `large-class` and `long-parameter-list` (positive integers; the values shown are the defaults). `dataAccess` restricts runtime imports of named packages, their subpaths, module aliases (`#models`, `@/db`) or project-local entry points (starting with `./`, matched by resolved file) to the paths in `allowIn`; both lists are required and nonempty, type-only imports are not reported, and findings are contract violations. Paths are project-relative, directory boundaries match complete segments, and the longest matching filename suffix wins.
|
|
458
|
+
Save team decisions (`boundaries`, `placement`, `dataAccess`, `limits` and `exclude`) in the `maintainability` section of `loadwise.config.json` at the project root, or pass `--config path/to/policy.json`. The [project rules guide](https://loadwise.mintlify.app/checkers/maintainability#project-rules) has an example and the meaning of each setting.
|
|
846
459
|
|
|
847
460
|
## A module graph in any language
|
|
848
461
|
|
|
849
|
-
|
|
850
|
-
{
|
|
851
|
-
"files": ["src/domain/order.ex", "src/http/handler.ex"],
|
|
852
|
-
"edges": [
|
|
853
|
-
{ "from": "src/domain/order.ex", "to": "src/http/handler.ex", "line": 3, "column": 1 }
|
|
854
|
-
]
|
|
855
|
-
}
|
|
856
|
-
```
|
|
462
|
+
For a language without import extraction, pass a module inventory and its edges as JSON with `--graph`:
|
|
857
463
|
|
|
858
464
|
```sh
|
|
859
465
|
npx loadwise maint . --graph modules.json --config policy.json
|
|
860
466
|
```
|
|
861
467
|
|
|
862
|
-
|
|
468
|
+
The [module graph guide](https://loadwise.mintlify.app/checkers/maintainability#a-module-graph-in-any-language) describes the file format.
|
|
863
469
|
|
|
864
470
|
# Security checker
|
|
865
471
|
|
|
@@ -876,133 +482,72 @@ npx loadwise sec polyglot src/ # ast-grep rules for Python, Go, Java, C#,
|
|
|
876
482
|
|
|
877
483
|
Run `loadwise sec deps --help` or `loadwise sec polyglot --help` for the options specific to those checks.
|
|
878
484
|
|
|
879
|
-
It accepts the source-check flags of `loadwise perf`, including `--format`, `--min-impact`, `--baseline`, `--write-baseline`, `--loadwise-config`, `--workspace`, `--policy`, `--json`, `--include-contextual`, `--ignore`, `--fail-on`, `--fix` with `--yes` or `--only` and `--no-comments` or `--no-format`, `--staged` and `--changed-since`. `--engine auto` (the default) and `--engine js`
|
|
485
|
+
It accepts the source-check flags of `loadwise perf`, including `--format`, `--min-impact`, `--baseline`, `--write-baseline`, `--loadwise-config`, `--workspace`, `--policy`, `--json`, `--include-contextual`, `--ignore`, `--fail-on`, `--fix` with `--yes` or `--only` and `--no-comments` or `--no-format`, `--staged` and `--changed-since`. `--engine auto` (the default) and `--engine js` run TypeScript 6, and `--engine native` (alias `--native`) runs TypeScript 7. Engine coverage, contextual files and fix limits are in the [security guide](https://loadwise.mintlify.app/checkers/security).
|
|
880
486
|
|
|
881
487
|
## Rules
|
|
882
488
|
|
|
883
489
|
<!-- loadwise:rules:start checker=security group=rules -->
|
|
884
490
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
| <a id="express-missing-helmet"></a>[`express-missing-helmet`](docs/rules/security/express-missing-helmet.md) | low | The Express or NestJS server starts without helmet security headers middleware (contextual: a proxy may set them). |
|
|
910
|
-
| <a id="frontend-storage-secret-token"></a>[`frontend-storage-secret-token`](docs/rules/security/frontend-storage-secret-token.md) | medium | A token, JWT, password or API key is stored in localStorage or sessionStorage, readable by any script on the page. |
|
|
911
|
-
| <a id="graphql-batching-unbounded"></a>[`graphql-batching-unbounded`](docs/rules/security/graphql-batching-unbounded.md) | medium | GraphQL query batching is enabled without a batch size, query depth, or cost/complexity limit. |
|
|
912
|
-
| <a id="graphql-introspection-enabled"></a>[`graphql-introspection-enabled`](docs/rules/security/graphql-introspection-enabled.md) | medium | A GraphQL server explicitly enables schema introspection. |
|
|
913
|
-
| <a id="graphql-query-depth-unbounded"></a>[`graphql-query-depth-unbounded`](docs/rules/security/graphql-query-depth-unbounded.md) | medium | A GraphQL server accepts queries of any depth. |
|
|
914
|
-
| <a id="hardcoded-secret"></a>[`hardcoded-secret`](docs/rules/security/hardcoded-secret.md) | critical | The source supplies a literal credential or cryptographic secret. |
|
|
915
|
-
| <a id="insecure-cipher"></a>[`insecure-cipher`](docs/rules/security/insecure-cipher.md) | medium | A cryptographic operation selects an insecure cipher or mode. |
|
|
916
|
-
| <a id="insecure-random-for-secret"></a>[`insecure-random-for-secret`](docs/rules/security/insecure-random-for-secret.md) | high | A sensitive token or secret uses a non-cryptographic random source. |
|
|
917
|
-
| <a id="jsx-javascript-url"></a>[`jsx-javascript-url`](docs/rules/security/jsx-javascript-url.md) | high | In React 18 and older or Preact, a URL search parameter or location hash starts a JSX href, action or iframe src (javascript: XSS). |
|
|
918
|
-
| <a id="jwt-decode-for-auth"></a>[`jwt-decode-for-auth`](docs/rules/security/jwt-decode-for-auth.md) | high | Authentication uses decoded JWT claims without verifying the token signature. |
|
|
919
|
-
| <a id="jwt-none-algorithm"></a>[`jwt-none-algorithm`](docs/rules/security/jwt-none-algorithm.md) | critical | JWT signing or verification allows an unsigned token. |
|
|
920
|
-
| <a id="jwt-sign-without-expiry"></a>[`jwt-sign-without-expiry`](docs/rules/security/jwt-sign-without-expiry.md) | medium | A signed JWT has no explicit expiration. |
|
|
921
|
-
| <a id="jwt-verify-without-algorithms"></a>[`jwt-verify-without-algorithms`](docs/rules/security/jwt-verify-without-algorithms.md) | high | JWT verification does not restrict the accepted signing algorithms. |
|
|
922
|
-
| <a id="jwt-weak-secret-literal"></a>[`jwt-weak-secret-literal`](docs/rules/security/jwt-weak-secret-literal.md) | high | JWT signing or verification uses a short (< 32 chars) or weak literal secret susceptible to brute-force forgery. |
|
|
923
|
-
| <a id="knex-raw-dynamic-text"></a>[`knex-raw-dynamic-text`](docs/rules/security/knex-raw-dynamic-text.md) | critical | A dynamic SQL fragment reaches Knex without parameter binding. |
|
|
924
|
-
| <a id="mass-assignment"></a>[`mass-assignment`](docs/rules/security/mass-assignment.md) | high | An unfiltered request body reaches a persistence operation. |
|
|
925
|
-
| <a id="mysql-dynamic-query-text"></a>[`mysql-dynamic-query-text`](docs/rules/security/mysql-dynamic-query-text.md) | critical | Dynamic SQL text reaches a MySQL client without parameter binding. |
|
|
926
|
-
| <a id="nest-validation-without-whitelist"></a>[`nest-validation-without-whitelist`](docs/rules/security/nest-validation-without-whitelist.md) | medium | A NestJS ValidationPipe permits properties outside the validated DTO. |
|
|
927
|
-
| <a id="next-image-any-remote-host"></a>[`next-image-any-remote-host`](docs/rules/security/next-image-any-remote-host.md) | medium | A Next.js images.remotePatterns entry sets hostname '**', so the image optimizer fetches and serves any host (open proxy). |
|
|
928
|
-
| <a id="nosql-operator-injection"></a>[`nosql-operator-injection`](docs/rules/security/nosql-operator-injection.md) | high | Request data can introduce query operators into a NoSQL filter. |
|
|
929
|
-
| <a id="open-redirect"></a>[`open-redirect`](docs/rules/security/open-redirect.md) | medium | An HTTP redirect destination is controlled by request data. |
|
|
930
|
-
| <a id="password-hash-in-response"></a>[`password-hash-in-response`](docs/rules/security/password-hash-in-response.md) | high | A response returns a user record that still holds its password hash. |
|
|
931
|
-
| <a id="path-traversal"></a>[`path-traversal`](docs/rules/security/path-traversal.md) | high | Request data controls a filesystem path without a recognized containment check. |
|
|
932
|
-
| <a id="pg-dynamic-query-text"></a>[`pg-dynamic-query-text`](docs/rules/security/pg-dynamic-query-text.md) | medium | Dynamic SQL text reaches the PostgreSQL client without parameter binding. |
|
|
933
|
-
| <a id="plaintext-password-storage"></a>[`plaintext-password-storage`](docs/rules/security/plaintext-password-storage.md) | critical | A password is stored or written without being hashed. |
|
|
934
|
-
| <a id="postmessage-missing-origin-check"></a>[`postmessage-missing-origin-check`](docs/rules/security/postmessage-missing-origin-check.md) | medium | postMessage targets '*', or a window message listener reads event.data without checking origin or source. |
|
|
935
|
-
| <a id="prisma-raw-unsafe-dynamic"></a>[`prisma-raw-unsafe-dynamic`](docs/rules/security/prisma-raw-unsafe-dynamic.md) | critical | Dynamic SQL text reaches an unsafe Prisma raw-query method. |
|
|
936
|
-
| <a id="prisma-scope-unverified"></a>[`prisma-scope-unverified`](docs/rules/security/prisma-scope-unverified.md) | high | A Prisma operation lacks the row scope required by the declared policy. |
|
|
937
|
-
| <a id="prototype-pollution"></a>[`prototype-pollution`](docs/rules/security/prototype-pollution.md) | high | Request data can supply keys to a write or merge that can modify an object prototype. |
|
|
938
|
-
| <a id="react-dangerously-set-inner-html"></a>[`react-dangerously-set-inner-html`](docs/rules/security/react-dangerously-set-inner-html.md) | high | dangerouslySetInnerHTML receives HTML that is not a constant or sanitized. |
|
|
939
|
-
| <a id="reflected-xss-response"></a>[`reflected-xss-response`](docs/rules/security/reflected-xss-response.md) | low | An HTML response reflects request data without recognized escaping. |
|
|
940
|
-
| <a id="regex-catastrophic-backtracking"></a>[`regex-catastrophic-backtracking`](docs/rules/security/regex-catastrophic-backtracking.md) | high | A regular expression that can backtrack exponentially or in polynomial time runs on request input. |
|
|
941
|
-
| <a id="regex-from-input"></a>[`regex-from-input`](docs/rules/security/regex-from-input.md) | medium | Request input supplies a regular expression pattern without recognized escaping. |
|
|
942
|
-
| <a id="secret-compared-non-constant-time"></a>[`secret-compared-non-constant-time`](docs/rules/security/secret-compared-non-constant-time.md) | medium | A secret is compared with an operation that can vary in timing with its contents. |
|
|
943
|
-
| <a id="secret-in-log"></a>[`secret-in-log`](docs/rules/security/secret-in-log.md) | high | A log statement can expose a credential, token, or other secret. |
|
|
944
|
-
| <a id="secret-in-url-query"></a>[`secret-in-url-query`](docs/rules/security/secret-in-url-query.md) | medium | A password, token or API key is passed in a URL query string. |
|
|
945
|
-
| <a id="sequelize-dynamic-query-text"></a>[`sequelize-dynamic-query-text`](docs/rules/security/sequelize-dynamic-query-text.md) | critical | Dynamic SQL text reaches Sequelize without parameter binding. |
|
|
946
|
-
| <a id="server-action-missing-auth"></a>[`server-action-missing-auth`](docs/rules/security/server-action-missing-auth.md) | high | An exported Next.js Server Action performs work without verifying authentication or session state. |
|
|
947
|
-
| <a id="ssrf-redirect-bypass"></a>[`ssrf-redirect-bypass`](docs/rules/security/ssrf-redirect-bypass.md) | high | An outbound HTTP request with a dynamic URL does not disable redirects, allowing SSRF allowlist bypasses. |
|
|
948
|
-
| <a id="ssrf-request-url"></a>[`ssrf-request-url`](docs/rules/security/ssrf-request-url.md) | high | Request data controls the destination of a server-side network request. |
|
|
949
|
-
| <a id="storage-object-public-acl"></a>[`storage-object-public-acl`](docs/rules/security/storage-object-public-acl.md) | high | A storage upload makes the object publicly readable. |
|
|
950
|
-
| <a id="template-autoescape-disabled"></a>[`template-autoescape-disabled`](docs/rules/security/template-autoescape-disabled.md) | medium | A template engine is configured to render values without HTML escaping. |
|
|
951
|
-
| <a id="template-injection"></a>[`template-injection`](docs/rules/security/template-injection.md) | critical | Request data is interpreted as template source rather than a template value. |
|
|
952
|
-
| <a id="tls-verification-disabled"></a>[`tls-verification-disabled`](docs/rules/security/tls-verification-disabled.md) | high | A TLS client skips certificate or server hostname verification. |
|
|
953
|
-
| <a id="typeorm-dynamic-query-text"></a>[`typeorm-dynamic-query-text`](docs/rules/security/typeorm-dynamic-query-text.md) | critical | A dynamic SQL fragment reaches TypeORM without parameter binding. |
|
|
954
|
-
| <a id="upload-client-filename"></a>[`upload-client-filename`](docs/rules/security/upload-client-filename.md) | medium | A file upload is stored under the original name supplied by the client. |
|
|
955
|
-
| <a id="vm-sandbox-escape"></a>[`vm-sandbox-escape`](docs/rules/security/vm-sandbox-escape.md) | critical | Node `vm` or `vm2` executes dynamic code or an untrusted context, risking sandbox escape and host RCE. |
|
|
956
|
-
| <a id="vue-v-html-unsanitized"></a>[`vue-v-html-unsanitized`](docs/rules/security/vue-v-html-unsanitized.md) | high | A Vue render function binds unsanitized dynamic HTML to innerHTML. |
|
|
957
|
-
| <a id="weak-password-hash"></a>[`weak-password-hash`](docs/rules/security/weak-password-hash.md) | high | A password is hashed with an algorithm unsuitable for password storage. |
|
|
958
|
-
| <a id="xml-external-entities"></a>[`xml-external-entities`](docs/rules/security/xml-external-entities.md) | medium | An XML parser allows processing of external entities. |
|
|
959
|
-
| <a id="zip-slip-extraction"></a>[`zip-slip-extraction`](docs/rules/security/zip-slip-extraction.md) | high | An archive entry controls an extraction path without a recognized containment check. |
|
|
491
|
+
<a id="angular-bypass-security-trust"></a>[`angular-bypass-security-trust`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/angular-bypass-security-trust.md) · <a id="auth-route-without-rate-limit"></a>[`auth-route-without-rate-limit`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/auth-route-without-rate-limit.md) ·
|
|
492
|
+
<a id="bcrypt-low-cost"></a>[`bcrypt-low-cost`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/bcrypt-low-cost.md) ·
|
|
493
|
+
<a id="client-env-secret-exposed"></a>[`client-env-secret-exposed`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/client-env-secret-exposed.md) · <a id="code-injection"></a>[`code-injection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/code-injection.md) · <a id="command-injection"></a>[`command-injection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/command-injection.md) · <a id="committed-secret"></a>[`committed-secret`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/committed-secret.md) · <a id="compose-hardcoded-secret"></a>[`compose-hardcoded-secret`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/compose-hardcoded-secret.md) · <a id="cookie-missing-security-flags"></a>[`cookie-missing-security-flags`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/cookie-missing-security-flags.md) · <a id="cors-credentials-any-origin"></a>[`cors-credentials-any-origin`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/cors-credentials-any-origin.md) · <a id="cors-origin-regex-unanchored"></a>[`cors-origin-regex-unanchored`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/cors-origin-regex-unanchored.md) ·
|
|
494
|
+
<a id="database-error-in-response"></a>[`database-error-in-response`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/database-error-in-response.md) · <a id="discarded-signature-verification-result"></a>[`discarded-signature-verification-result`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/discarded-signature-verification-result.md) · <a id="dockerfile-add-remote-url"></a>[`dockerfile-add-remote-url`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/dockerfile-add-remote-url.md) · <a id="dockerfile-runs-as-root"></a>[`dockerfile-runs-as-root`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/dockerfile-runs-as-root.md) · <a id="dockerfile-secret-in-build"></a>[`dockerfile-secret-in-build`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/dockerfile-secret-in-build.md) · <a id="dockerfile-unpinned-base-image"></a>[`dockerfile-unpinned-base-image`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/dockerfile-unpinned-base-image.md) · <a id="dom-xss-sink"></a>[`dom-xss-sink`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/dom-xss-sink.md) · <a id="drizzle-scope-unverified"></a>[`drizzle-scope-unverified`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/drizzle-scope-unverified.md) · <a id="drizzle-sql-raw-dynamic"></a>[`drizzle-sql-raw-dynamic`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/drizzle-sql-raw-dynamic.md) ·
|
|
495
|
+
<a id="error-stack-in-response"></a>[`error-stack-in-response`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/error-stack-in-response.md) · <a id="escape-replace-incomplete"></a>[`escape-replace-incomplete`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/escape-replace-incomplete.md) · <a id="express-cookie-auth-missing-csrf"></a>[`express-cookie-auth-missing-csrf`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/express-cookie-auth-missing-csrf.md) · <a id="express-missing-helmet"></a>[`express-missing-helmet`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/express-missing-helmet.md) ·
|
|
496
|
+
<a id="frontend-storage-secret-token"></a>[`frontend-storage-secret-token`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/frontend-storage-secret-token.md) ·
|
|
497
|
+
<a id="graphql-batching-unbounded"></a>[`graphql-batching-unbounded`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/graphql-batching-unbounded.md) · <a id="graphql-introspection-enabled"></a>[`graphql-introspection-enabled`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/graphql-introspection-enabled.md) · <a id="graphql-query-depth-unbounded"></a>[`graphql-query-depth-unbounded`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/graphql-query-depth-unbounded.md) ·
|
|
498
|
+
<a id="hardcoded-secret"></a>[`hardcoded-secret`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/hardcoded-secret.md) ·
|
|
499
|
+
<a id="insecure-cipher"></a>[`insecure-cipher`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/insecure-cipher.md) · <a id="insecure-deserialization"></a>[`insecure-deserialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/insecure-deserialization.md) · <a id="insecure-random-for-secret"></a>[`insecure-random-for-secret`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/insecure-random-for-secret.md) ·
|
|
500
|
+
<a id="js-yaml-unsafe-schema"></a>[`js-yaml-unsafe-schema`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/js-yaml-unsafe-schema.md) · <a id="jsx-javascript-url"></a>[`jsx-javascript-url`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/jsx-javascript-url.md) · <a id="jwt-decode-for-auth"></a>[`jwt-decode-for-auth`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/jwt-decode-for-auth.md) · <a id="jwt-none-algorithm"></a>[`jwt-none-algorithm`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/jwt-none-algorithm.md) · <a id="jwt-sign-without-expiry"></a>[`jwt-sign-without-expiry`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/jwt-sign-without-expiry.md) · <a id="jwt-verify-without-algorithms"></a>[`jwt-verify-without-algorithms`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/jwt-verify-without-algorithms.md) · <a id="jwt-weak-secret-literal"></a>[`jwt-weak-secret-literal`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/jwt-weak-secret-literal.md) ·
|
|
501
|
+
<a id="knex-raw-dynamic-text"></a>[`knex-raw-dynamic-text`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/knex-raw-dynamic-text.md) · <a id="kubernetes-privileged-container"></a>[`kubernetes-privileged-container`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/kubernetes-privileged-container.md) · <a id="kysely-scope-unverified"></a>[`kysely-scope-unverified`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/kysely-scope-unverified.md) ·
|
|
502
|
+
<a id="ldap-filter-injection"></a>[`ldap-filter-injection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/ldap-filter-injection.md) ·
|
|
503
|
+
<a id="mass-assignment"></a>[`mass-assignment`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/mass-assignment.md) · <a id="mysql-dynamic-query-text"></a>[`mysql-dynamic-query-text`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/mysql-dynamic-query-text.md) ·
|
|
504
|
+
<a id="nest-validation-without-whitelist"></a>[`nest-validation-without-whitelist`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/nest-validation-without-whitelist.md) · <a id="next-image-any-remote-host"></a>[`next-image-any-remote-host`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/next-image-any-remote-host.md) · <a id="nosql-operator-injection"></a>[`nosql-operator-injection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/nosql-operator-injection.md) ·
|
|
505
|
+
<a id="open-redirect"></a>[`open-redirect`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/open-redirect.md) ·
|
|
506
|
+
<a id="password-hash-in-response"></a>[`password-hash-in-response`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/password-hash-in-response.md) · <a id="path-traversal"></a>[`path-traversal`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/path-traversal.md) · <a id="pg-dynamic-query-text"></a>[`pg-dynamic-query-text`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/pg-dynamic-query-text.md) · <a id="plaintext-password-storage"></a>[`plaintext-password-storage`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/plaintext-password-storage.md) · <a id="postmessage-missing-origin-check"></a>[`postmessage-missing-origin-check`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/postmessage-missing-origin-check.md) · <a id="prisma-raw-unsafe-dynamic"></a>[`prisma-raw-unsafe-dynamic`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/prisma-raw-unsafe-dynamic.md) · <a id="prisma-scope-unverified"></a>[`prisma-scope-unverified`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/prisma-scope-unverified.md) · <a id="prototype-pollution"></a>[`prototype-pollution`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/prototype-pollution.md) ·
|
|
507
|
+
<a id="raw-content-disposition-filename"></a>[`raw-content-disposition-filename`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/raw-content-disposition-filename.md) · <a id="react-dangerously-set-inner-html"></a>[`react-dangerously-set-inner-html`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/react-dangerously-set-inner-html.md) · <a id="reflected-xss-response"></a>[`reflected-xss-response`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/reflected-xss-response.md) · <a id="regex-catastrophic-backtracking"></a>[`regex-catastrophic-backtracking`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/regex-catastrophic-backtracking.md) · <a id="regex-from-input"></a>[`regex-from-input`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/regex-from-input.md) · <a id="request-selected-executable"></a>[`request-selected-executable`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/request-selected-executable.md) ·
|
|
508
|
+
<a id="secret-compared-non-constant-time"></a>[`secret-compared-non-constant-time`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/secret-compared-non-constant-time.md) · <a id="secret-in-log"></a>[`secret-in-log`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/secret-in-log.md) · <a id="secret-in-url-query"></a>[`secret-in-url-query`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/secret-in-url-query.md) · <a id="sequelize-dynamic-query-text"></a>[`sequelize-dynamic-query-text`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/sequelize-dynamic-query-text.md) · <a id="server-action-missing-auth"></a>[`server-action-missing-auth`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/server-action-missing-auth.md) · <a id="ssrf-redirect-bypass"></a>[`ssrf-redirect-bypass`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/ssrf-redirect-bypass.md) · <a id="ssrf-request-url"></a>[`ssrf-request-url`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/ssrf-request-url.md) · <a id="storage-object-public-acl"></a>[`storage-object-public-acl`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/storage-object-public-acl.md) ·
|
|
509
|
+
<a id="template-autoescape-disabled"></a>[`template-autoescape-disabled`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/template-autoescape-disabled.md) · <a id="template-injection"></a>[`template-injection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/template-injection.md) · <a id="template-raw-html-binding"></a>[`template-raw-html-binding`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/template-raw-html-binding.md) · <a id="tls-verification-disabled"></a>[`tls-verification-disabled`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/tls-verification-disabled.md) · <a id="trust-boundary-violation"></a>[`trust-boundary-violation`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/trust-boundary-violation.md) · <a id="typeorm-dynamic-query-text"></a>[`typeorm-dynamic-query-text`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/typeorm-dynamic-query-text.md) ·
|
|
510
|
+
<a id="upload-client-filename"></a>[`upload-client-filename`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/upload-client-filename.md) ·
|
|
511
|
+
<a id="vm-sandbox-escape"></a>[`vm-sandbox-escape`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/vm-sandbox-escape.md) · <a id="vue-v-html-unsanitized"></a>[`vue-v-html-unsanitized`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/vue-v-html-unsanitized.md) ·
|
|
512
|
+
<a id="weak-hash"></a>[`weak-hash`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/weak-hash.md) · <a id="weak-password-hash"></a>[`weak-password-hash`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/weak-password-hash.md) · <a id="webhook-body-without-verification"></a>[`webhook-body-without-verification`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/webhook-body-without-verification.md) ·
|
|
513
|
+
<a id="xml-external-entities"></a>[`xml-external-entities`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/xml-external-entities.md) · <a id="xpath-injection"></a>[`xpath-injection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/xpath-injection.md) ·
|
|
514
|
+
<a id="zip-slip-extraction"></a>[`zip-slip-extraction`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/zip-slip-extraction.md)
|
|
960
515
|
|
|
961
516
|
<!-- loadwise:rules:end -->
|
|
962
517
|
|
|
963
|
-
|
|
518
|
+
Secret, Compose and Dockerfile rules read project files rather than TypeScript; [Rules](https://loadwise.mintlify.app/checkers/security#rules) explains which files they read and which placeholder values they accept.
|
|
964
519
|
|
|
965
520
|
## Polyglot source checks
|
|
966
521
|
|
|
967
|
-
`npx loadwise sec polyglot src/`
|
|
522
|
+
`npx loadwise sec polyglot src/` checks Python, Go, Java, C# and Rust files with the optional ast-grep binary. These are syntactic patterns without taint tracking: confirm that untrusted input can reach the call. See [Polyglot source checks](https://loadwise.mintlify.app/checkers/security#polyglot-source-checks).
|
|
968
523
|
|
|
969
524
|
<!-- loadwise:rules:start checker=security group=polyglot-source-checks -->
|
|
970
525
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
| <a id="go-sql-sprintf-injection"></a>[`go-sql-sprintf-injection`](docs/rules/security/go-sql-sprintf-injection.md) | high | SQL text formatted with fmt.Sprintf risks SQL injection. |
|
|
977
|
-
| <a id="java-runtime-exec"></a>[`java-runtime-exec`](docs/rules/security/java-runtime-exec.md) | medium | Runtime.getRuntime().exec runs an OS command and risks command injection with untrusted arguments. |
|
|
978
|
-
| <a id="java-sql-string-concat"></a>[`java-sql-string-concat`](docs/rules/security/java-sql-string-concat.md) | high | A SQL query built by string concatenation risks SQL injection. |
|
|
979
|
-
| <a id="python-insecure-deserialization"></a>[`python-insecure-deserialization`](docs/rules/security/python-insecure-deserialization.md) | high | pickle or marshal deserialization of untrusted data can execute arbitrary code. |
|
|
980
|
-
| <a id="python-subprocess-shell-true"></a>[`python-subprocess-shell-true`](docs/rules/security/python-subprocess-shell-true.md) | high | subprocess with shell=True or os.system passes input through a shell, risking command injection. |
|
|
981
|
-
| <a id="python-unsafe-yaml-load"></a>[`python-unsafe-yaml-load`](docs/rules/security/python-unsafe-yaml-load.md) | high | yaml.load without SafeLoader can construct arbitrary Python objects. |
|
|
982
|
-
| <a id="rust-command-shell"></a>[`rust-command-shell`](docs/rules/security/rust-command-shell.md) | high | Command::new("sh") or Command::new("bash") spawns a shell and risks command injection. |
|
|
983
|
-
| <a id="rust-unsafe-raw-pointer-deref"></a>[`rust-unsafe-raw-pointer-deref`](docs/rules/security/rust-unsafe-raw-pointer-deref.md) | medium | A raw pointer dereference in an unsafe block bypasses Rust memory safety guarantees. |
|
|
526
|
+
<a id="csharp-binaryformatter-request-deserialization"></a>[`csharp-binaryformatter-request-deserialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/csharp-binaryformatter-request-deserialization.md) · <a id="csharp-ef-from-sql-raw"></a>[`csharp-ef-from-sql-raw`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/csharp-ef-from-sql-raw.md) · <a id="csharp-process-start"></a>[`csharp-process-start`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/csharp-process-start.md) ·
|
|
527
|
+
<a id="go-exec-command-shell"></a>[`go-exec-command-shell`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/go-exec-command-shell.md) · <a id="go-sql-sprintf-injection"></a>[`go-sql-sprintf-injection`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/go-sql-sprintf-injection.md) · <a id="go-tls-insecure-skip-verify"></a>[`go-tls-insecure-skip-verify`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/go-tls-insecure-skip-verify.md) ·
|
|
528
|
+
<a id="java-des-cipher"></a>[`java-des-cipher`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/java-des-cipher.md) · <a id="java-objectinputstream-request-deserialization"></a>[`java-objectinputstream-request-deserialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/java-objectinputstream-request-deserialization.md) · <a id="java-runtime-exec"></a>[`java-runtime-exec`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/java-runtime-exec.md) · <a id="java-sql-string-concat"></a>[`java-sql-string-concat`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/java-sql-string-concat.md) ·
|
|
529
|
+
<a id="python-insecure-deserialization"></a>[`python-insecure-deserialization`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/python-insecure-deserialization.md) · <a id="python-requests-tls-verify-disabled"></a>[`python-requests-tls-verify-disabled`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/python-requests-tls-verify-disabled.md) · <a id="python-sqlite-unbound-value"></a>[`python-sqlite-unbound-value`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/python-sqlite-unbound-value.md) · <a id="python-subprocess-shell-true"></a>[`python-subprocess-shell-true`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/python-subprocess-shell-true.md) · <a id="python-unsafe-yaml-load"></a>[`python-unsafe-yaml-load`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/python-unsafe-yaml-load.md) ·
|
|
530
|
+
<a id="rust-command-shell"></a>[`rust-command-shell`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/rust-command-shell.md) · <a id="rust-reqwest-danger-accept-invalid-certs"></a>[`rust-reqwest-danger-accept-invalid-certs`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/rust-reqwest-danger-accept-invalid-certs.md) · <a id="rust-unsafe-raw-pointer-deref"></a>[`rust-unsafe-raw-pointer-deref`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/rust-unsafe-raw-pointer-deref.md)
|
|
984
531
|
|
|
985
532
|
<!-- loadwise:rules:end -->
|
|
986
533
|
|
|
987
534
|
## Dependency checks
|
|
988
535
|
|
|
989
|
-
`loadwise sec deps --online [directory]` reads
|
|
536
|
+
`loadwise sec deps --online [directory]` reads the npm, pnpm, Yarn, Cargo, Deno or Bun lockfile and asks the [OSV database](https://osv.dev) about every pinned package version. It sends package names, ecosystems and versions, and caches answers for 24 hours. The network is opt-in: `loadwise sec --online` and `loadwise check --online` add these findings to their security report. Supported lockfiles, `LOADWISE_OSV_URL` mirrors and cache settings are in [Dependency checks](https://loadwise.mintlify.app/checkers/security#dependency-checks).
|
|
990
537
|
|
|
991
538
|
<!-- loadwise:rules:start checker=security group=dependency-checks -->
|
|
992
539
|
|
|
993
|
-
|
|
994
|
-
| ------------------------------------------------------------------------------------------------------------------------------------ | ------ | ------------------------------------------------------------------------------ |
|
|
995
|
-
| <a id="dependency-known-vulnerability"></a>[`dependency-known-vulnerability`](docs/rules/security/dependency-known-vulnerability.md) | medium | A resolved dependency version is listed in a published vulnerability advisory. |
|
|
540
|
+
<a id="dependency-known-vulnerability"></a>[`dependency-known-vulnerability`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/security/dependency-known-vulnerability.md)
|
|
996
541
|
|
|
997
542
|
<!-- loadwise:rules:end -->
|
|
998
543
|
|
|
999
544
|
## Project-defined row scopes
|
|
1000
545
|
|
|
1001
|
-
Row-scope checks read `prismaScopes` and `
|
|
546
|
+
Row-scope checks read `prismaScopes`, `drizzleScopes` and `kyselyScopes` from the `performance` section of `loadwise.config.json` (see [Project-defined access policy](#project-defined-access-policy)) and start only when the project names the model or table, its scoped property and the trusted helper that supplies an authorized scalar. The [row scopes guide](https://loadwise.mintlify.app/checkers/security#project-defined-row-scopes) shows each setting and what the checks assume.
|
|
1002
547
|
|
|
1003
548
|
# Accessibility checker
|
|
1004
549
|
|
|
1005
|
-
`loadwise a11y` finds markup that people using screen readers, keyboards or zoom cannot use. It reads JSX and inline Angular templates from the TypeScript program
|
|
550
|
+
`loadwise a11y` finds markup that people using screen readers, keyboards or zoom cannot use. It reads JSX and inline Angular templates from the TypeScript program and markup files such as `.html`, `.vue` and `.svelte` from the project folders, and shares the source check of `loadwise perf`. `loadwise check` skips it with a note on a project with no frontend sources. Details are in the [accessibility guide](https://loadwise.mintlify.app/checkers/accessibility).
|
|
1006
551
|
|
|
1007
552
|
```sh
|
|
1008
553
|
npx loadwise a11y -p tsconfig.json # JSX, Angular templates and the project's markup files
|
|
@@ -1014,21 +559,7 @@ npx loadwise a11y --fix --only <id> # apply one generated fix
|
|
|
1014
559
|
|
|
1015
560
|
<!-- loadwise:rules:start checker=accessibility group=rules -->
|
|
1016
561
|
|
|
1017
|
-
|
|
1018
|
-
| -------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
1019
|
-
| <a id="a11y-button-missing-type"></a>[`a11y-button-missing-type`](docs/rules/accessibility/a11y-button-missing-type.md) | medium | A button associated with a form has a click handler but no explicit type, so clicking it can also submit the form. |
|
|
1020
|
-
| <a id="a11y-clickable-non-interactive"></a>[`a11y-clickable-non-interactive`](docs/rules/accessibility/a11y-clickable-non-interactive.md) | high | A click handler sits on a non-interactive element without a role and keyboard support, so keyboard users cannot activate it. |
|
|
1021
|
-
| <a id="a11y-heading-level-skipped"></a>[`a11y-heading-level-skipped`](docs/rules/accessibility/a11y-heading-level-skipped.md) | low | A heading jumps more than one level down, which leaves a gap in the page outline. |
|
|
1022
|
-
| <a id="a11y-html-missing-lang"></a>[`a11y-html-missing-lang`](docs/rules/accessibility/a11y-html-missing-lang.md) | medium | The html element has no lang attribute, so screen readers guess the pronunciation. |
|
|
1023
|
-
| <a id="a11y-iframe-missing-title"></a>[`a11y-iframe-missing-title`](docs/rules/accessibility/a11y-iframe-missing-title.md) | medium | An iframe has no title, so screen readers cannot say what it contains. |
|
|
1024
|
-
| <a id="a11y-img-missing-alt"></a>[`a11y-img-missing-alt`](docs/rules/accessibility/a11y-img-missing-alt.md) | high | An image has no alt text, so screen readers announce its file name or nothing. |
|
|
1025
|
-
| <a id="a11y-input-missing-autocomplete"></a>[`a11y-input-missing-autocomplete`](docs/rules/accessibility/a11y-input-missing-autocomplete.md) | low | An input for personal data has no autocomplete, so browsers cannot fill it in for people who find typing hard. |
|
|
1026
|
-
| <a id="a11y-invalid-aria"></a>[`a11y-invalid-aria`](docs/rules/accessibility/a11y-invalid-aria.md) | high | An ARIA attribute or role is misspelled or invalid, so assistive technology ignores it. |
|
|
1027
|
-
| <a id="a11y-link-text-not-descriptive"></a>[`a11y-link-text-not-descriptive`](docs/rules/accessibility/a11y-link-text-not-descriptive.md) | medium | A link says only "click here" or "read more", so it means nothing out of context. |
|
|
1028
|
-
| <a id="a11y-media-autoplay"></a>[`a11y-media-autoplay`](docs/rules/accessibility/a11y-media-autoplay.md) | medium | A video or audio element plays on its own with sound, so it talks over screen readers. |
|
|
1029
|
-
| <a id="a11y-missing-form-label"></a>[`a11y-missing-form-label`](docs/rules/accessibility/a11y-missing-form-label.md) | high | A form control has no label, so screen readers announce it without its purpose. |
|
|
1030
|
-
| <a id="a11y-positive-tabindex"></a>[`a11y-positive-tabindex`](docs/rules/accessibility/a11y-positive-tabindex.md) | medium | A positive tabindex reorders keyboard focus away from the visual order. |
|
|
1031
|
-
| <a id="a11y-viewport-zoom-disabled"></a>[`a11y-viewport-zoom-disabled`](docs/rules/accessibility/a11y-viewport-zoom-disabled.md) | high | The viewport meta tag disables zoom, so people with low vision cannot enlarge the page. |
|
|
562
|
+
<a id="a11y-aria-hidden-focus"></a>[`a11y-aria-hidden-focus`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-aria-hidden-focus.md) · <a id="a11y-aria-role-missing-checked"></a>[`a11y-aria-role-missing-checked`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-aria-role-missing-checked.md) · <a id="a11y-button-missing-name"></a>[`a11y-button-missing-name`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-button-missing-name.md) · <a id="a11y-button-missing-type"></a>[`a11y-button-missing-type`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-button-missing-type.md) · <a id="a11y-clickable-non-interactive"></a>[`a11y-clickable-non-interactive`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-clickable-non-interactive.md) · <a id="a11y-competing-autofocus"></a>[`a11y-competing-autofocus`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-competing-autofocus.md) · <a id="a11y-data-table-missing-headers"></a>[`a11y-data-table-missing-headers`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-data-table-missing-headers.md) · <a id="a11y-heading-level-skipped"></a>[`a11y-heading-level-skipped`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-heading-level-skipped.md) · <a id="a11y-html-invalid-lang"></a>[`a11y-html-invalid-lang`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-html-invalid-lang.md) · <a id="a11y-html-missing-lang"></a>[`a11y-html-missing-lang`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-html-missing-lang.md) · <a id="a11y-iframe-missing-title"></a>[`a11y-iframe-missing-title`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-iframe-missing-title.md) · <a id="a11y-img-missing-alt"></a>[`a11y-img-missing-alt`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-img-missing-alt.md) · <a id="a11y-input-missing-autocomplete"></a>[`a11y-input-missing-autocomplete`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-input-missing-autocomplete.md) · <a id="a11y-invalid-aria"></a>[`a11y-invalid-aria`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-invalid-aria.md) · <a id="a11y-invalid-id-reference"></a>[`a11y-invalid-id-reference`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-invalid-id-reference.md) · <a id="a11y-link-text-not-descriptive"></a>[`a11y-link-text-not-descriptive`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-link-text-not-descriptive.md) · <a id="a11y-media-autoplay"></a>[`a11y-media-autoplay`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-media-autoplay.md) · <a id="a11y-missing-form-label"></a>[`a11y-missing-form-label`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-missing-form-label.md) · <a id="a11y-nested-interactive"></a>[`a11y-nested-interactive`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-nested-interactive.md) · <a id="a11y-placeholder-link-action"></a>[`a11y-placeholder-link-action`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-placeholder-link-action.md) · <a id="a11y-positive-tabindex"></a>[`a11y-positive-tabindex`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-positive-tabindex.md) · <a id="a11y-svg-image-missing-name"></a>[`a11y-svg-image-missing-name`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-svg-image-missing-name.md) · <a id="a11y-video-captions-review"></a>[`a11y-video-captions-review`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-video-captions-review.md) · <a id="a11y-viewport-zoom-disabled"></a>[`a11y-viewport-zoom-disabled`](https://github.com/IbrahimHafez1/loadwise/blob/main/docs/rules/accessibility/a11y-viewport-zoom-disabled.md)
|
|
1032
563
|
|
|
1033
564
|
<!-- loadwise:rules:end -->
|
|
1034
565
|
|
|
@@ -1042,6 +573,8 @@ npx loadwise a11y --fix --only <id> # apply one generated fix
|
|
|
1042
573
|
|
|
1043
574
|
Error monitoring, uptime checks, and scheduled-job monitoring for Loadwise are sponsored by **[Sentry](https://sentry.io)** through the Sentry Open Source Program.
|
|
1044
575
|
|
|
576
|
+
Pull requests get free AI code review from **[CodeRabbit](https://coderabbit.ai)**, **[cubic](https://cubic.dev)**, **[Qodo](https://www.qodo.ai)**, and **[Sourcery](https://www.sourcery.ai/)** through their open-source programs.
|
|
577
|
+
|
|
1045
578
|
# License
|
|
1046
579
|
|
|
1047
|
-
Licensed under the [Apache License 2.0](LICENSE). Copyright © 2026 Ibrahim Hafez.
|
|
580
|
+
Licensed under the [Apache License 2.0](https://github.com/IbrahimHafez1/loadwise/blob/main/LICENSE). Copyright © 2026 Ibrahim Hafez.
|