Improving the Nextjs/JS analyzers #1790
chinmaypant21
started this conversation in
Ideas
Replies: 2 comments 2 replies
|
@chinmaypant21
These feel worth tracking as separate issues. Want to open them yourself, or should I create the issues? And if you want to take any of them for a PR, feel free. Happy to review. Thanks again :D |
0 replies
|
Thanks for the feedback @hahwul . I'll create the issues for the same, and pick a few (or all) of them gradually :) |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I was testing noir against some real Next.js codebases and noticed a few things on the JS/TS / Next.js analyzers. Wanted to check these before opening issues/PRs. Roughly ordered by how self-contained I think they are.
1. Commented-out code is treated as live
Lines starting with
//(and/* */blocks) still get analyzed, so commented-out handlers/headers show up as real endpoints. Feels like it belongs in a shared JS/TS lexer since other analyzers might hit the same thing (I didn't check tho).2. Variable header keys get dropped
req.headers["stripe-signature"]works, butreq.headers[SIGNATURE_HEADER]doesn't . I believe it's more informative to surface the identifier and mark it "unresolved" than droping it.3. formData bodies render as
a=&b=&c=For
formData.get("file")etc., the body prints asfile=&description=&folder=, which reads like empty query params. Empty values are fine but I believe showing this as a searchParam isn't the most ideal way. Could we preserve the source/content-type? (Separate Q: is thea=&b=&c=body rendering intentional?4. Server Actions show as
POST /actionNameServer actions aren't real URL routes, so
POST /actionNameis a bit misleading and can't be grep'd in the sourcecode. Some action-specific representation might fit better (e.g. POST [action] banUser). Also: direct JS args (banUser(userId: string, reason: string)) appear in-f jsonbut not in console output, which looks like a console-formatter gap.I'd love to know your opinion for this and would be glad to help resolving them :)
All reactions