Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds missing modeling for superagent use cases in the code analysis framework.
- Adds modeling for the del method (superagent.del(url)).
- Models function call syntax for specifying HTTP method (superagent('GET', url)).
- Introduces modeling for agent-based requests (superagent.agent().post(url).send(data)).
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js | Adds a new function with superagent API modeling |
| javascript/ql/lib/change-notes/2025-03-20-superagent.md | Updates change notes for enhanced superagent support |
Files not reviewed (2)
- javascript/ql/lib/semmle/javascript/frameworks/ClientRequests.qll: Language not supported
- javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected: Language not supported
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
asgerf
reviewed
Mar 20, 2025
| agent = DataFlow::moduleMember(moduleName, "agent").getACall() and | ||
| this = agent.getAMethodCall(httpMethodName()) and | ||
| url = this.getArgument(0) | ||
| ) |
Contributor
There was a problem hiding this comment.
If you feel like going a step further you could switch to API:: here instead of DataFlow::, but I'll leave it up to you.
Contributor
Author
There was a problem hiding this comment.
I have tried to remake it to use API graph d61d038, hopefully I didn't miss anything.
Co-authored-by: Asger F <asgerf@github.com>
asgerf
previously approved these changes
Mar 20, 2025
asgerf
approved these changes
Mar 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses missing modeling for
superagentin specific use cases:superagent.del(url).superagent('GET', url).superagent.agent().