This commit is contained in:
2026-01-19 09:34:42 +00:00
parent 0210cb4d39
commit dae3f9fea5
28 changed files with 1575 additions and 2 deletions

32
AGENTS.md Normal file
View File

@@ -0,0 +1,32 @@
# Project Agent Guide
This repo is migrating legacy TSX components to JSON-driven components with hooks.
Use this file as the quick, local guide for automation and review.
## Conversion Workflow (TSX -> JSON)
1) Identify component under `src/components/atoms|molecules|organisms`.
2) Read TSX and decide if stateful.
3) If stateful, extract logic to `src/hooks/use-<component>.ts`.
4) Create JSON definition in `src/components/json-definitions/<component>.json`.
5) Add interface in `src/lib/json-ui/interfaces/<component>.ts`.
6) Export hook (if any) in `src/hooks/index.ts` and `src/lib/json-ui/hooks-registry.ts`.
7) Export interface in `src/lib/json-ui/interfaces/index.ts`.
8) Export JSON component in `src/lib/json-ui/json-components.ts`.
9) Update imports to `@/lib/json-ui/json-components` and delete TSX.
10) Verify with `npm run build` and `npm run audit:json`.
## CodeQL Helpers
Custom query pack: `codeql/custom-queries/`
Optimized DB (source-root `src/`): `codeql-db-optimized/`
Latest SARIF: `codeql-db-optimized/diagnostic/migration-queries.sarif`
Key queries:
- Legacy component imports and barrels
- Hooks usage in components (guides hook extraction)
- JSX presence in components
- Imports from json-definitions (should be zero)
- Migration target folder inventory
## Related Docs
- `CLAUDE.md` for migration status and CodeQL results
- `docs/reference/AGENTS.md` for agent architecture background

View File

@@ -287,6 +287,21 @@ npm run components:generate-types
npm run build
```
## CodeQL Migration Helpers (Jan 2026)
Custom query pack lives in `codeql/custom-queries/` with SARIF output at:
`codeql-db-optimized/diagnostic/migration-queries.sarif`
Latest optimized DB results (source-root `src/`):
- custom/component-files-with-jsx: 400
- custom/component-hooks-usage: 98
- custom/component-custom-hook-usage: 191
- custom/legacy-component-barrel-imports: 470
- custom/components-in-migration-target-folders: 21
- custom/legacy-imports-in-migration-targets: 0
- custom/imports-json-definitions: 0
- custom/imports-converted-json-components: 0
## Key Files
- `json-components-registry.json` - Master registry of all components

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -28,7 +28,7 @@
íÖä×éƒè
ëØãÙé¨ê
ëÚãÛéçð
ëÜèÝéÛˆ õÞÛß鎌 ÐàÍáé<01><> Úâ×ã鑎 ääâåé¬<> ðæóç飑 …é‚ê醒 <0B>ëŒìéé’ ™í—îé•” ¥ï¢ðéñ” ¯ñ«òéè• ·óµôéÅ– Ãõ¹ö铘 ¿÷¡øéË› ’ùûù餜 óúÖûé°ž Èüªýéå  ›þ‚ÿéõ¥ øÿÛ€éÓ¨ Í<>²‚é–¬ ¦ƒ‡„éÀ° ÷„í…éé² ó†æ‡é€´ éˆ܉éíµ ßŠÖ‹éÖ¸ ÝŒË<>é¥À ÈŽº<>é£Ã ¼<>³‘騯 º’¨“éêÈ ¥”<04>éÅÔ ¥–Š—é¿Ö þ—æ˜é‰Ø Ý™Кéî٠ӛŜéÒÚ Ç<>¹žéÊÛ »Ÿ­ éñÜ ¯¡ ¢ééÝ ¡£’¤éêÞ “¥‰¦éãß <0B>§„¨éÇà ‰©õ©é›â ðªõ«éãã ‰­‡®éôå •¯‘°éÑæ <0B>±˜²é÷ç £³Ÿ´é<01>é «µ¨¶éìé µ·¸¸éÉê ʹ̺é‡ì ݻ޼éÿì î½í¾éãí ü¿ÿÀéáï ‘Â”Ãé’ñ ¦Ä Åéìñ ªÆ¨ÇéÉò ¶È¬ÉéÀô ²Ê•Ëé÷û ‡ÌêÌéЇ ÜÍãÎ阉 ùÏúÐ鵋 ŠÒˆÓé’Œ –Ô“Õé<>  Öž×éÎŽ ¬Ø«Ùé«<> ºÚ¿Ûéˆ<> ÓÜ×ÝéÅ‘ êÞíßé½’ ÿà<04>âé¡“ ’ã—ä韕 «å°æéò– ÄçÀèéÌ— ÌéÍê騘 ÝëÕìéžš ÝíËî鯛 Èïºðéµ<> ¼ñ¨ò镟 £óŽô鬠 ˆõôõéè¡ ïöÝ÷éý¥ ÚøÁùé•© ·ú<04>ûéÉ­ ’üôüéÑ® åýÇþé<01>± ¸ÿ²€éÔ² ¼<>°‚鄵 ´ƒ¦„éܵ ¨…™†éÿ¶ š‡Œˆé•¸ މÿ‰éí¸ €‹ó‹éĹ öŒî<>韺 öŽí<>éÚ» ô<>ê‘éм ð’å“é²½ ê”â•鮿 ê–â—éÿÀ ê˜Ú™é×Á ٚ͛éæÂ Ñœ½<>é¾Ä ¸ž½Ÿé¶Æ Ñ Ø¡é„È î¢ð£éúÈ <0C>¥ƒ¦éïÉ ”§–¨éÑË §©¬ªéšÍ À«Ƭé·Ï Û­×®éíÐ ã¯ʰéËÖ À±¤²é’Ú —³ü³éÂÛ ð´صéÔÝ Ï¶µ·é®à ª¸’¹éûã ‰ºûºéóç ý»í¼éËè ì½Û¾é‘ê Ù¿ÉÀéŠë ÈÁÅÂéšì ÒÃÍÄé«í ØÅÌÆé¡î ÐÇÂÈéæï ÄÉ´Êé½ð ³Ë<05>Ìé”ñ –ÍüÍéƒó ñÎÓÏéùü ÄиÑéãþ ¼Ò¯ÓéÍÿ ²Ô«Õé<>
ëÜèÝéÛˆ õÞÛß鎌 ÐàÍáé<01><> Úâ×ã鑎 ääâåé¬<> ðæóç飑 …é‚ê醒 <0B>ëŒìéé’ ™í—îé•” ¥ï¢ðéñ” ¯ñ«òéè• ·óµôéÅ– Ãõ¹ö铘 ¿÷¡øéË› ’ùûù餜 óúÖûé°ž Èüªýéå  ›þ‚ÿéõ¥ øÿÛ€éÓ¨ Í<>²‚é–¬ ¦ƒ‡„éÀ° ÷„í…éé² ó†æ‡é€´ éˆ܉éíµ ßŠÖ‹éÖ¸ ÝŒË<>é¥À ÈŽº<>é£Ã ¼<>³‘騯 º’¨“éêÈ ¥”<04>éÅÔ ¥–Š—é¿Ö þ—æ˜é‰Ø Ý™Кéî٠ӛŜéÒÚ Ç<>¹žéÊÛ »Ÿ­ éñÜ ¯¡ ¢ééÝ ¡£’¤éêÞ “¥‰¦éãß <0B>§„¨éÇà ‰©õ©é›â ðªõ«éãã ‰­‡®éôå •¯‘°éÑæ <0B>±˜²é÷ç £³Ÿ´é<01>é «µ¨¶éìé µ·¸¸éÉê ʹ̺é‡ì ݻ޼éÿì î½í¾éãí ü¿ÿÀéáï ‘Â”Ãé’ñ ¦Ä Åéìñ ªÆ¨ÇéÉò ¶È¬ÉéÀô ²Ê•Ëé÷û ‡ÌêÌéЇ ÜÍãÎ阉 ùÏúÐ鵋 ŠÒˆÓé’Œ –Ô“Õé<>  Öž×éÎŽ ¬Ø«Ùé«<> ºÚ¿Ûéˆ<> ÓÜ×ÝéÅ‘ êÞíßé½’ ÿà<04>âé¡“ ’ã—ä韕 «å°æéò– ÄçÀèéÌ— ÌéÍê騘 ÝëÕìéžš ÝíËî鯛 Èïºðéµ<> ¼ñ¨ò镟 £óŽô鬠 ˆõôõéè¡ ïöÝ÷éý¥ ÚøÁùé•© ·ú<04>ûéÉ­ ’üôüéÑ® åýÇþé<01>± ¸ÿ²€éÔ² ¼<>°‚鄵 ´ƒ¦„éܵ ¨…™†éÿ¶ š‡Œˆé•¸ މÿ‰éí¸ €‹ó‹éĹ öŒî<>韺 öŽí<>éÚ» ô<>ê‘éм ð’å“é²½ ê”â•鮿 ê–â—éÿÀ ê˜Ú™é×Á ٚ͛éæÂ Ñœ½<>é¾Ä ¸ž½Ÿé¶Æ Ñ Ø¡é„È î¢ð£éúÈ <0C>¥ƒ¦éïÉ ”§–¨éÑË §©¬ªéšÍ À«Ƭé·Ï Û­×®éíÐ ã¯ʰéËÖ À±¤²é’Ú —³ü³éÂÛ ð´صéÔÝ Ï¶µ·é®à ª¸’¹éûã ‰ºûºéóç ý»í¼éËè ì½Û¾é‘ê Ù¿ÉÀéŠë ÈÁÅÂéšì ÒÃÍÄé«í ØÅÌÆé¡î ÐÇÂÈéæï ÄÉ´Êé½ð ³Ë<05>Ìé”ñ –ÍüÍéƒó ñÎÓÏéùü ÄиÑéãþ ¼Ò¯ÓéÍÿ ²Ô«Õé<>
´Ö®×éó<>
¸Ø°Ùé̃
¸ÚªÛé¶„

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,617 @@
---
queries:
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentCustomHookUsage.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentCustomHookUsage.bqrs
metadata:
name: Custom hook usage in components
description: Flags calls to hooks (useX) inside src/components files to guide
hook extraction.
kind: problem
severity: warning
id: custom/component-custom-hook-usage
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentFilesInMigrationTargets.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentFilesInMigrationTargets.bqrs
metadata:
name: Components in migration target folders
description: Lists TSX files under src/components/atoms|molecules|organisms (primary
migration targets).
kind: problem
severity: warning
id: custom/components-in-migration-target-folders
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentFilesWithJSX.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentFilesWithJSX.bqrs
metadata:
name: Component files with JSX
description: Lists component TSX files that contain JSX (candidate for JSON conversion).
kind: problem
severity: warning
id: custom/component-files-with-jsx
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentHooksUsage.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentHooksUsage.bqrs
metadata:
name: React hook usage in components
description: Flags component files that call React hooks (likely needs custom
hook extraction).
kind: problem
severity: warning
id: custom/component-hooks-usage
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/LegacyComponentBarrelImports.ql
relativeBqrsPath: custom/low-code-react-migration/queries/LegacyComponentBarrelImports.bqrs
metadata:
name: Legacy component barrel imports
description: "Flags imports from '@/components/atoms', '@/components/molecules',\
\ '@/components/organisms', or '@/components/ui'."
kind: problem
severity: warning
id: custom/legacy-component-barrel-imports
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/LegacyComponentImports.ql
relativeBqrsPath: custom/low-code-react-migration/queries/LegacyComponentImports.bqrs
metadata:
name: Legacy component imports
description: Finds imports still referencing legacy components instead of JSON
components.
kind: problem
severity: warning
id: custom/legacy-component-imports
extensionPacks: []
packs:
codeql/util#3:
name: codeql/util
version: 2.0.26
isLibrary: true
isExtensionPack: false
localPath: file:///Users/rmac/.codeql/packages/codeql/util/2.0.26/
localPackDefinitionFile: file:///Users/rmac/.codeql/packages/codeql/util/2.0.26/qlpack.yml
headSha: b4f4b0e6b0d0e819d1242d1911d54af219e065db
runDataExtensions: []
codeql/javascript-all#1:
name: codeql/javascript-all
version: 2.6.19
isLibrary: true
isExtensionPack: false
localPath: file:///Users/rmac/.codeql/packages/codeql/javascript-all/2.6.19/
localPackDefinitionFile: file:///Users/rmac/.codeql/packages/codeql/javascript-all/2.6.19/qlpack.yml
headSha: b4f4b0e6b0d0e819d1242d1911d54af219e065db
runDataExtensions: []
codeql/threat-models#2:
name: codeql/threat-models
version: 1.0.39
isLibrary: true
isExtensionPack: false
localPath: file:///Users/rmac/.codeql/packages/codeql/threat-models/1.0.39/
localPackDefinitionFile: file:///Users/rmac/.codeql/packages/codeql/threat-models/1.0.39/qlpack.yml
headSha: b4f4b0e6b0d0e819d1242d1911d54af219e065db
runDataExtensions: []
custom/low-code-react-migration#0:
name: custom/low-code-react-migration
version: 0.0.1
isLibrary: false
isExtensionPack: false
localPath: file:///Users/rmac/.claude-worktrees/low-code-react-app-b/distracted-hawking/codeql/custom-queries/
localPackDefinitionFile: file:///Users/rmac/.claude-worktrees/low-code-react-app-b/distracted-hawking/codeql/custom-queries/qlpack.yml
runDataExtensions:
-
pack: codeql/javascript-all#1
relativePath: ext/apollo-server.model.yml
index: 0
firstRowId: 0
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/apollo-server.model.yml
index: 1
firstRowId: 1
rowCount: 2
locations:
lineNumbers: A=12+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/apollo-server.model.yml
index: 2
firstRowId: 3
rowCount: 10
locations:
lineNumbers: A=19+1*9
columnNumbers: A=9*10
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 0
firstRowId: 13
rowCount: 8
locations:
lineNumbers: A=6+1*7
columnNumbers: A=9*8
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 1
firstRowId: 21
rowCount: 10
locations:
lineNumbers: A=18+1*9
columnNumbers: A=9*10
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 2
firstRowId: 31
rowCount: 8
locations:
lineNumbers: A=32+1*7
columnNumbers: A=9*8
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 3
firstRowId: 39
rowCount: 9
locations:
lineNumbers: A=44+1*8
columnNumbers: A=9*9
-
pack: codeql/javascript-all#1
relativePath: ext/axios.model.yml
index: 0
firstRowId: 48
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/axios.model.yml
index: 1
firstRowId: 49
rowCount: 1
locations:
lineNumbers: A=12
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/call-me-maybe.model.yml
index: 0
firstRowId: 50
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/cors.model.yml
index: 0
firstRowId: 51
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/default-threat-models-fixup.model.yml
index: 0
firstRowId: 52
rowCount: 1
locations:
lineNumbers: A=8
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/graph-ql.model.yml
index: 0
firstRowId: 53
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/graph-ql.model.yml
index: 1
firstRowId: 54
rowCount: 1
locations:
lineNumbers: A=11
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/hana-db-client.model.yml
index: 0
firstRowId: 55
rowCount: 4
locations:
lineNumbers: A=6+1*3
columnNumbers: A=9*4
-
pack: codeql/javascript-all#1
relativePath: ext/hana-db-client.model.yml
index: 1
firstRowId: 59
rowCount: 2
locations:
lineNumbers: A=15+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/hana-db-client.model.yml
index: 2
firstRowId: 61
rowCount: 6
locations:
lineNumbers: A=22+1*5
columnNumbers: A=9*6
-
pack: codeql/javascript-all#1
relativePath: ext/make-dir.model.yml
index: 0
firstRowId: 67
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/markdown-table.model.yml
index: 0
firstRowId: 68
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/mkdirp.model.yml
index: 0
firstRowId: 69
rowCount: 2
locations:
lineNumbers: A=6+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/open.model.yml
index: 0
firstRowId: 71
rowCount: 2
locations:
lineNumbers: A=6+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/react-relay-threat.model.yml
index: 0
firstRowId: 73
rowCount: 10
locations:
lineNumbers: A=6+1*9
columnNumbers: A=9*10
-
pack: codeql/javascript-all#1
relativePath: ext/react.model.yml
index: 0
firstRowId: 83
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/rimraf.model.yml
index: 0
firstRowId: 84
rowCount: 3
locations:
lineNumbers: A=6+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: ext/shelljs.model.yml
index: 0
firstRowId: 87
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/tanstack.model.yml
index: 0
firstRowId: 88
rowCount: 6
locations:
lineNumbers: A=6+1*5
columnNumbers: A=9*6
-
pack: codeql/javascript-all#1
relativePath: ext/underscore.string.model.yml
index: 0
firstRowId: 94
rowCount: 5
locations:
lineNumbers: A=6+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: ext/underscore.string.model.yml
index: 1
firstRowId: 99
rowCount: 20
locations:
lineNumbers: A=16+1*19
columnNumbers: A=9*20
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/NoSQL.model.yml
index: 0
firstRowId: 119
rowCount: 4
locations:
lineNumbers: A=8+3+1*2
columnNumbers: A=9*4
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/NodeJSLib.model.yml
index: 0
firstRowId: 123
rowCount: 5
locations:
lineNumbers: A=6+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/SQL.model.yml
index: 0
firstRowId: 128
rowCount: 5
locations:
lineNumbers: A=6+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/SQL.model.yml
index: 1
firstRowId: 133
rowCount: 4
locations:
lineNumbers: A=16+1*3
columnNumbers: A=9*4
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/helmet/Helmet.Required.Setting.model.yml
index: 0
firstRowId: 137
rowCount: 2
locations:
lineNumbers: A=6+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/minimongo/model.yml
index: 0
firstRowId: 139
rowCount: 75
locations:
lineNumbers: A=6+1*74
columnNumbers: A=9*75
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 0
firstRowId: 214
rowCount: 26
locations:
lineNumbers: A=6+1*25
columnNumbers: A=9*26
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 1
firstRowId: 240
rowCount: 611
locations:
lineNumbers: A=37+1*610
columnNumbers: A=9*611
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 2
firstRowId: 851
rowCount: 32
locations:
lineNumbers: A=653+1*31
columnNumbers: A=9*32
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 3
firstRowId: 883
rowCount: 102
locations:
lineNumbers: A=690+1*101
columnNumbers: A=9*102
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mssql/model.yml
index: 0
firstRowId: 985
rowCount: 34
locations:
lineNumbers: A=6+1*33
columnNumbers: A=9*34
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mysql/model.yml
index: 0
firstRowId: 1019
rowCount: 57
locations:
lineNumbers: A=6+1*56
columnNumbers: A=9*57
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mysql/model.yml
index: 1
firstRowId: 1076
rowCount: 3
locations:
lineNumbers: A=68+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/pg/model.yml
index: 0
firstRowId: 1079
rowCount: 65
locations:
lineNumbers: A=6+1*64
columnNumbers: A=9*65
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/pg/model.yml
index: 1
firstRowId: 1144
rowCount: 5
locations:
lineNumbers: A=76+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/pg/model.yml
index: 2
firstRowId: 1149
rowCount: 23
locations:
lineNumbers: A=86+1*22
columnNumbers: A=9*23
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 0
firstRowId: 1172
rowCount: 7
locations:
lineNumbers: A=6+1*6
columnNumbers: A=9*7
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 1
firstRowId: 1179
rowCount: 248
locations:
lineNumbers: A=18+1*247
columnNumbers: A=9*248
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 2
firstRowId: 1427
rowCount: 5
locations:
lineNumbers: A=271+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 3
firstRowId: 1432
rowCount: 2
locations:
lineNumbers: A=281+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/spanner/model.yml
index: 0
firstRowId: 1434
rowCount: 174
locations:
lineNumbers: A=6+1*173
columnNumbers: A=9*174
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/spanner/model.yml
index: 1
firstRowId: 1608
rowCount: 5
locations:
lineNumbers: A=185+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sqlite3/model.yml
index: 0
firstRowId: 1613
rowCount: 15
locations:
lineNumbers: A=6+1*14
columnNumbers: A=9*15
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sqlite3/model.yml
index: 1
firstRowId: 1628
rowCount: 3
locations:
lineNumbers: A=26+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/security/domains/IntegrityCheckingRequired/integrity_checking_required.model.yml
index: 0
firstRowId: 1631
rowCount: 3
locations:
lineNumbers: A=6+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/security/domains/compromised/compromised_domains.model.yml
index: 0
firstRowId: 1634
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/security/domains/untrusted/untrusted_domains.model.yml
index: 0
firstRowId: 1635
rowCount: 6
locations:
lineNumbers: A=7+1+3+1*3
columnNumbers: A=9*6
-
pack: codeql/threat-models#2
relativePath: ext/supported-threat-models.model.yml
index: 0
firstRowId: 1641
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/threat-models#2
relativePath: ext/threat-model-grouping.model.yml
index: 0
firstRowId: 1642
rowCount: 15
locations:
lineNumbers: A=8+3+1+3+1*5+3+1+5+1*3
columnNumbers: A=9*15

View File

@@ -0,0 +1,649 @@
---
queries:
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentCustomHookUsage.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentCustomHookUsage.bqrs
metadata:
name: Custom hook usage in components
description: Flags calls to hooks (useX) inside src/components files to guide
hook extraction.
kind: problem
severity: warning
id: custom/component-custom-hook-usage
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentFilesInMigrationTargets.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentFilesInMigrationTargets.bqrs
metadata:
name: Components in migration target folders
description: Lists TSX files under src/components/atoms|molecules|organisms (primary
migration targets).
kind: problem
severity: warning
id: custom/components-in-migration-target-folders
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentFilesWithJSX.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentFilesWithJSX.bqrs
metadata:
name: Component files with JSX
description: Lists component TSX files that contain JSX (candidate for JSON conversion).
kind: problem
severity: warning
id: custom/component-files-with-jsx
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ComponentHooksUsage.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ComponentHooksUsage.bqrs
metadata:
name: React hook usage in components
description: Flags component files that call React hooks (likely needs custom
hook extraction).
kind: problem
severity: warning
id: custom/component-hooks-usage
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ImportsConvertedJsonComponents.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ImportsConvertedJsonComponents.bqrs
metadata:
name: Imports of converted JSON components
description: Flags imports of components now in json-components to help update
call sites.
kind: problem
severity: warning
id: custom/imports-converted-json-components
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/ImportsJsonDefinitions.ql
relativeBqrsPath: custom/low-code-react-migration/queries/ImportsJsonDefinitions.bqrs
metadata:
name: Direct JSON definition imports
description: Flags imports from '@/components/json-definitions' to enforce centralized
exports.
kind: problem
severity: warning
id: custom/imports-json-definitions
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/LegacyComponentBarrelImports.ql
relativeBqrsPath: custom/low-code-react-migration/queries/LegacyComponentBarrelImports.bqrs
metadata:
name: Legacy component barrel imports
description: "Flags imports from '@/components/atoms', '@/components/molecules',\
\ '@/components/organisms', or '@/components/ui'."
kind: problem
severity: warning
id: custom/legacy-component-barrel-imports
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/LegacyComponentImports.ql
relativeBqrsPath: custom/low-code-react-migration/queries/LegacyComponentImports.bqrs
metadata:
name: Legacy component imports
description: Finds imports still referencing legacy components instead of JSON
components.
kind: problem
severity: warning
id: custom/legacy-component-imports
-
pack: custom/low-code-react-migration#0
relativeQueryPath: queries/LegacyImportsInMigrationTargets.ql
relativeBqrsPath: custom/low-code-react-migration/queries/LegacyImportsInMigrationTargets.bqrs
metadata:
name: Legacy imports in migration targets
description: Flags imports from '@/components/*' inside atoms/molecules/organisms.
kind: problem
severity: warning
id: custom/legacy-imports-in-migration-targets
extensionPacks: []
packs:
codeql/util#3:
name: codeql/util
version: 2.0.26
isLibrary: true
isExtensionPack: false
localPath: file:///Users/rmac/.codeql/packages/codeql/util/2.0.26/
localPackDefinitionFile: file:///Users/rmac/.codeql/packages/codeql/util/2.0.26/qlpack.yml
headSha: b4f4b0e6b0d0e819d1242d1911d54af219e065db
runDataExtensions: []
codeql/javascript-all#1:
name: codeql/javascript-all
version: 2.6.19
isLibrary: true
isExtensionPack: false
localPath: file:///Users/rmac/.codeql/packages/codeql/javascript-all/2.6.19/
localPackDefinitionFile: file:///Users/rmac/.codeql/packages/codeql/javascript-all/2.6.19/qlpack.yml
headSha: b4f4b0e6b0d0e819d1242d1911d54af219e065db
runDataExtensions: []
codeql/threat-models#2:
name: codeql/threat-models
version: 1.0.39
isLibrary: true
isExtensionPack: false
localPath: file:///Users/rmac/.codeql/packages/codeql/threat-models/1.0.39/
localPackDefinitionFile: file:///Users/rmac/.codeql/packages/codeql/threat-models/1.0.39/qlpack.yml
headSha: b4f4b0e6b0d0e819d1242d1911d54af219e065db
runDataExtensions: []
custom/low-code-react-migration#0:
name: custom/low-code-react-migration
version: 0.0.1
isLibrary: false
isExtensionPack: false
localPath: file:///Users/rmac/.claude-worktrees/low-code-react-app-b/distracted-hawking/codeql/custom-queries/
localPackDefinitionFile: file:///Users/rmac/.claude-worktrees/low-code-react-app-b/distracted-hawking/codeql/custom-queries/qlpack.yml
runDataExtensions:
-
pack: codeql/javascript-all#1
relativePath: ext/apollo-server.model.yml
index: 0
firstRowId: 0
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/apollo-server.model.yml
index: 1
firstRowId: 1
rowCount: 2
locations:
lineNumbers: A=12+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/apollo-server.model.yml
index: 2
firstRowId: 3
rowCount: 10
locations:
lineNumbers: A=19+1*9
columnNumbers: A=9*10
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 0
firstRowId: 13
rowCount: 8
locations:
lineNumbers: A=6+1*7
columnNumbers: A=9*8
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 1
firstRowId: 21
rowCount: 10
locations:
lineNumbers: A=18+1*9
columnNumbers: A=9*10
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 2
firstRowId: 31
rowCount: 8
locations:
lineNumbers: A=32+1*7
columnNumbers: A=9*8
-
pack: codeql/javascript-all#1
relativePath: ext/aws-sdk.model.yml
index: 3
firstRowId: 39
rowCount: 9
locations:
lineNumbers: A=44+1*8
columnNumbers: A=9*9
-
pack: codeql/javascript-all#1
relativePath: ext/axios.model.yml
index: 0
firstRowId: 48
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/axios.model.yml
index: 1
firstRowId: 49
rowCount: 1
locations:
lineNumbers: A=12
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/call-me-maybe.model.yml
index: 0
firstRowId: 50
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/cors.model.yml
index: 0
firstRowId: 51
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/default-threat-models-fixup.model.yml
index: 0
firstRowId: 52
rowCount: 1
locations:
lineNumbers: A=8
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/graph-ql.model.yml
index: 0
firstRowId: 53
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/graph-ql.model.yml
index: 1
firstRowId: 54
rowCount: 1
locations:
lineNumbers: A=11
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/hana-db-client.model.yml
index: 0
firstRowId: 55
rowCount: 4
locations:
lineNumbers: A=6+1*3
columnNumbers: A=9*4
-
pack: codeql/javascript-all#1
relativePath: ext/hana-db-client.model.yml
index: 1
firstRowId: 59
rowCount: 2
locations:
lineNumbers: A=15+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/hana-db-client.model.yml
index: 2
firstRowId: 61
rowCount: 6
locations:
lineNumbers: A=22+1*5
columnNumbers: A=9*6
-
pack: codeql/javascript-all#1
relativePath: ext/make-dir.model.yml
index: 0
firstRowId: 67
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/markdown-table.model.yml
index: 0
firstRowId: 68
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/mkdirp.model.yml
index: 0
firstRowId: 69
rowCount: 2
locations:
lineNumbers: A=6+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/open.model.yml
index: 0
firstRowId: 71
rowCount: 2
locations:
lineNumbers: A=6+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: ext/react-relay-threat.model.yml
index: 0
firstRowId: 73
rowCount: 10
locations:
lineNumbers: A=6+1*9
columnNumbers: A=9*10
-
pack: codeql/javascript-all#1
relativePath: ext/react.model.yml
index: 0
firstRowId: 83
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/rimraf.model.yml
index: 0
firstRowId: 84
rowCount: 3
locations:
lineNumbers: A=6+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: ext/shelljs.model.yml
index: 0
firstRowId: 87
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: ext/tanstack.model.yml
index: 0
firstRowId: 88
rowCount: 6
locations:
lineNumbers: A=6+1*5
columnNumbers: A=9*6
-
pack: codeql/javascript-all#1
relativePath: ext/underscore.string.model.yml
index: 0
firstRowId: 94
rowCount: 5
locations:
lineNumbers: A=6+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: ext/underscore.string.model.yml
index: 1
firstRowId: 99
rowCount: 20
locations:
lineNumbers: A=16+1*19
columnNumbers: A=9*20
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/NoSQL.model.yml
index: 0
firstRowId: 119
rowCount: 4
locations:
lineNumbers: A=8+3+1*2
columnNumbers: A=9*4
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/NodeJSLib.model.yml
index: 0
firstRowId: 123
rowCount: 5
locations:
lineNumbers: A=6+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/SQL.model.yml
index: 0
firstRowId: 128
rowCount: 5
locations:
lineNumbers: A=6+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/SQL.model.yml
index: 1
firstRowId: 133
rowCount: 4
locations:
lineNumbers: A=16+1*3
columnNumbers: A=9*4
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/helmet/Helmet.Required.Setting.model.yml
index: 0
firstRowId: 137
rowCount: 2
locations:
lineNumbers: A=6+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/minimongo/model.yml
index: 0
firstRowId: 139
rowCount: 75
locations:
lineNumbers: A=6+1*74
columnNumbers: A=9*75
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 0
firstRowId: 214
rowCount: 26
locations:
lineNumbers: A=6+1*25
columnNumbers: A=9*26
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 1
firstRowId: 240
rowCount: 611
locations:
lineNumbers: A=37+1*610
columnNumbers: A=9*611
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 2
firstRowId: 851
rowCount: 32
locations:
lineNumbers: A=653+1*31
columnNumbers: A=9*32
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mongodb/model.yml
index: 3
firstRowId: 883
rowCount: 102
locations:
lineNumbers: A=690+1*101
columnNumbers: A=9*102
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mssql/model.yml
index: 0
firstRowId: 985
rowCount: 34
locations:
lineNumbers: A=6+1*33
columnNumbers: A=9*34
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mysql/model.yml
index: 0
firstRowId: 1019
rowCount: 57
locations:
lineNumbers: A=6+1*56
columnNumbers: A=9*57
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/mysql/model.yml
index: 1
firstRowId: 1076
rowCount: 3
locations:
lineNumbers: A=68+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/pg/model.yml
index: 0
firstRowId: 1079
rowCount: 65
locations:
lineNumbers: A=6+1*64
columnNumbers: A=9*65
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/pg/model.yml
index: 1
firstRowId: 1144
rowCount: 5
locations:
lineNumbers: A=76+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/pg/model.yml
index: 2
firstRowId: 1149
rowCount: 23
locations:
lineNumbers: A=86+1*22
columnNumbers: A=9*23
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 0
firstRowId: 1172
rowCount: 7
locations:
lineNumbers: A=6+1*6
columnNumbers: A=9*7
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 1
firstRowId: 1179
rowCount: 248
locations:
lineNumbers: A=18+1*247
columnNumbers: A=9*248
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 2
firstRowId: 1427
rowCount: 5
locations:
lineNumbers: A=271+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sequelize/model.yml
index: 3
firstRowId: 1432
rowCount: 2
locations:
lineNumbers: A=281+1
columnNumbers: A=9*2
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/spanner/model.yml
index: 0
firstRowId: 1434
rowCount: 174
locations:
lineNumbers: A=6+1*173
columnNumbers: A=9*174
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/spanner/model.yml
index: 1
firstRowId: 1608
rowCount: 5
locations:
lineNumbers: A=185+1*4
columnNumbers: A=9*5
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sqlite3/model.yml
index: 0
firstRowId: 1613
rowCount: 15
locations:
lineNumbers: A=6+1*14
columnNumbers: A=9*15
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/frameworks/sqlite3/model.yml
index: 1
firstRowId: 1628
rowCount: 3
locations:
lineNumbers: A=26+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/security/domains/IntegrityCheckingRequired/integrity_checking_required.model.yml
index: 0
firstRowId: 1631
rowCount: 3
locations:
lineNumbers: A=6+1*2
columnNumbers: A=9*3
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/security/domains/compromised/compromised_domains.model.yml
index: 0
firstRowId: 1634
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/javascript-all#1
relativePath: semmle/javascript/security/domains/untrusted/untrusted_domains.model.yml
index: 0
firstRowId: 1635
rowCount: 6
locations:
lineNumbers: A=7+1+3+1*3
columnNumbers: A=9*6
-
pack: codeql/threat-models#2
relativePath: ext/supported-threat-models.model.yml
index: 0
firstRowId: 1641
rowCount: 1
locations:
lineNumbers: A=6
columnNumbers: A=9
-
pack: codeql/threat-models#2
relativePath: ext/threat-model-grouping.model.yml
index: 0
firstRowId: 1642
rowCount: 15
locations:
lineNumbers: A=8+3+1+3+1*5+3+1+5+1*3
columnNumbers: A=9*15

View File

@@ -0,0 +1,20 @@
/**
* @name Custom hook usage in components
* @description Flags calls to hooks (useX) inside src/components files to guide hook extraction.
* @kind problem
* @severity warning
* @id custom/component-custom-hook-usage
*/
import javascript
predicate isComponentFile(File f) {
f.getRelativePath().regexpMatch("^(src/)?components/.*\\.tsx$")
}
from CallExpr call, File f, VarRef ref
where
f = call.getFile() and
isComponentFile(f) and
ref = call.getCallee() and
ref.getName().regexpMatch("^use[A-Z].*")
select call, "Hook call in component: " + ref.getName()

View File

@@ -0,0 +1,16 @@
/**
* @name Components in migration target folders
* @description Lists TSX files under src/components/atoms|molecules|organisms (primary migration targets).
* @kind problem
* @severity warning
* @id custom/components-in-migration-target-folders
*/
import javascript
predicate isTargetComponentFile(File f) {
f.getRelativePath().regexpMatch("^(src/)?components/(atoms|molecules|organisms)/.*\\.tsx$")
}
from File f
where isTargetComponentFile(f)
select f, "Component file in migration target folder"

View File

@@ -0,0 +1,20 @@
/**
* @name Imports of converted JSON components
* @description Flags imports of components now in json-components to help update call sites.
* @kind problem
* @severity warning
* @id custom/imports-converted-json-components
*/
import javascript
predicate isConvertedType(string name) {
name = "NavigationMenu"
}
from ImportDeclaration imp, ImportSpecifier spec, string name
where
spec = imp.getASpecifier() and
name = spec.getImportedName() and
isConvertedType(name) and
imp.getRawImportPath().regexpMatch("^@/components/")
select imp, "Import converted to JSON: " + name

View File

@@ -0,0 +1,12 @@
/**
* @name Direct JSON definition imports
* @description Flags imports from '@/components/json-definitions' to enforce centralized exports.
* @kind problem
* @severity warning
* @id custom/imports-json-definitions
*/
import javascript
from ImportDeclaration imp
where imp.getRawImportPath().regexpMatch("^@/components/json-definitions/")
select imp, "Direct JSON definition import: " + imp.getRawImportPath()

View File

@@ -0,0 +1,12 @@
/**
* @name Legacy component barrel imports
* @description Flags imports from '@/components/atoms', '@/components/molecules', '@/components/organisms', or '@/components/ui'.
* @kind problem
* @severity warning
* @id custom/legacy-component-barrel-imports
*/
import javascript
from ImportDeclaration imp
where imp.getRawImportPath().regexpMatch("^@/components/(atoms|molecules|organisms|ui)(/.*)?$")
select imp, "Legacy component barrel import: " + imp.getRawImportPath()

View File

@@ -0,0 +1,19 @@
/**
* @name Legacy imports in migration targets
* @description Flags imports from '@/components/*' inside atoms/molecules/organisms.
* @kind problem
* @severity warning
* @id custom/legacy-imports-in-migration-targets
*/
import javascript
predicate isTargetComponentFile(File f) {
f.getRelativePath().regexpMatch("^(src/)?components/(atoms|molecules|organisms)/.*\\.tsx$")
}
from ImportDeclaration imp, File f
where
f = imp.getFile() and
isTargetComponentFile(f) and
imp.getRawImportPath().regexpMatch("^@/components/")
select imp, "Legacy import in migration target: " + imp.getRawImportPath()