Skip to content

Ruby/Python: add meta-queries for calls to summarised callables #13299

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

Merged
merged 2 commits into from
May 26, 2023

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented May 26, 2023

Adds meta-queries which are similar to CallGraph.ql, except they show calls to SummarizedCallable.

@asgerf asgerf added the no-change-note-required This PR does not need a change note label May 26, 2023
@asgerf asgerf requested review from a team as code owners May 26, 2023 09:42
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby 👍

Comment on lines +16 to +24
from DataFlow::Node useSite, SummarizedCallable target, string kind
where
(
useSite = target.getACall() and kind = "Call"
or
useSite = target.getACallback() and kind = "Callback"
) and
not useSite.getLocation().getFile() instanceof IgnoredFile
select useSite, kind + " to " + target

Check warning

Code scanning / CodeQL

Consistent alert message

The py/meta/summarized-callable-call-sites query does not have the same alert message as rb.
Comment on lines +14 to +16
from Call invoke, SummarizedCallable f
where f.getACall() = invoke or f.getACallSimple() = invoke
select invoke, "Call to " + f

Check warning

Code scanning / CodeQL

Consistent alert message

The rb/meta/summarized-callable-call-sites query does not have the same alert message as py.
Copy link
Contributor

@yoff yoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@yoff
Copy link
Contributor

yoff commented May 26, 2023

I retriggered the timed-out Python test..

@yoff yoff merged commit af1f4c3 into github:main May 26, 2023
@asgerf
Copy link
Contributor Author

asgerf commented May 26, 2023

I'm running a test experiment here with these meta queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Python Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants