-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
JS: Add library for naming endpoints #15380
Conversation
8842c18
to
930d79d
Compare
17263c5
to
08e61b6
Compare
08e61b6
to
36e069b
Compare
36e069b
to
1737ba1
Compare
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.
Since a given endpoint can very often be reached via multiple access paths (some of which are very ugly) a great deal of work goes into ranking these access paths and try to pick the least bad best one.
Looks like you did a lot of iterations of making it slightly better.
Nice work 👍
I got some comments, but they're all minor.
javascript/ql/test/testUtilities/internal/InlineExpectationsTestImpl.qll
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/endpoints/EndpointNaming.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/endpoints/EndpointNaming.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/endpoints/EndpointNaming.qll
Outdated
Show resolved
Hide resolved
javascript/ql/lib/semmle/javascript/endpoints/EndpointNaming.qll
Outdated
Show resolved
Hide resolved
Previously it was theoretically possible to create a cycle of preferred predecessors, since badness had higher precedence than depth. We now require the preferred predecessor to have lower depth. With this criteria we can remove the arbitray cap on badness.
Thanks for the review @erik-krogh, I've answered all comments, PTAL. |
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.
Nice work 👍
Adds a library,
EndpointNaming.qll
for generating human-readable names for endpoints, based on their access paths.Since a given endpoint can very often be reached via multiple access paths (some of which are very ugly) a great deal of work goes into ranking these access paths and try to pick the
least badbest one.There are several intended use-cases for this. The model editor and VEA both need to generate human-readable names for endpoints. Also, for library summarisation we need to be able to name intermediate types and good readability for those names not a strict requirement though certainly a nice-to-have.
There are some unit tests in the PR, and some more real-world test output stored in a separate repo (internal link).
The work isn't entirely done yet, though I think it would be helpful to get it reviewed and merged in the current state, and then iterate from there.
Commit-by-commit review recommended as there are some general-purpose initial commits.