-
Notifications
You must be signed in to change notification settings - Fork 1.7k
JS: reintroduce js/server-crash #4951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach sounds good to me, and I also like the use of path-problem
to show how the exception throw relates to the route handler.
I think we could consider hiding the mid-nodes that are function-nodes.
E.g. looking at eclipse/orion.client
, the function writeResponse
takes a lot of space, without really contributing.
Just a single suggestion (in two parts) explicitly stating that invokedByRouteHandler
can pass through try-catch statements.
Co-authored-by: Erik Krogh Kristensen <[email protected]>
Co-authored-by: Erik Krogh Kristensen <[email protected]>
fc1fdf9
to
ad2e062
Compare
ad2e062
to
5688d8b
Compare
7724274
to
5a6e692
Compare
Lets try again - I had to do another rewrite 🙄 Presentation(see this 236-run)
We only present the exception path now, the path from the
I went back and forth on this, ultimately I found it more useful (albeit verbose) to have the function nodes in the path. PerformanceAfter a LGTM-run-on-all and a few optimizations, I have not observed any of the slowest project to require more than 100 seconds of analysis locally. The speed is backed by a unstable dist-compare for I had to do another rewrite to handle performance and presentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, but otherwise it looks fine to me.
javascript/ql/src/Security/CWE-730/examples/server-crash.GOOD-B.js
Outdated
Show resolved
Hide resolved
javascript/ql/src/Security/CWE-730/examples/server-crash.BAD.js
Outdated
Show resolved
Hide resolved
javascript/ql/src/Security/CWE-730/examples/server-crash.GOOD-B.js
Outdated
Show resolved
Hide resolved
…B.js Co-authored-by: Erik Krogh Kristensen <[email protected]>
This closes https://github.com/github/codeql-javascript-team/issues/188 by rewriting the reverted js/server-crash - see original PR and its revert.
The core idea remains the same, but there are two major implementation changes:
@kind path-problem
query that uses the path to explain how the exception connects to the async call back and the route handlerSample run: https://lgtm.com/query/4927397113480631507/. To view a path explanation in vscode, try the eclipse/orion.client database.
The qhelp is still missing. Lets first agree that we believe in the current formulation of the query.
For the record, there is plenty of future work for this query. See https://github.com/github/codeql-javascript-team/issues/105.