-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java/C#: exclude FunctionalExpr
s from DataFlowTargetApi
#11623
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
Java/C#: exclude FunctionalExpr
s from DataFlowTargetApi
#11623
Conversation
FunctionalExpr
s from DataFlowTargetApi
FunctionalExpr
s from DataFlowTargetApi
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.
Java part LGTM. When I did a quick test on a C# db, then the C# change didn't appear to have any effect, so maybe these are already excluded somehow? I.e. the following predicate appears empty:
predicate test(TargetApiSpecific api) {
isRelevantForModels(api) and
api instanceof CS::AnonymousFunctionExpr
}
No, that shouldn't be necessary.
Yes, I think so. It doesn't affect any normal queries. |
I think that:
implies (by accident)
In any case, I think the case for anonymous functions should be explicit in C# as well. |
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.
Looks good to me, but try and run DCA before mad-queries.qls
before merging to see, if we overlooked something.
I think we should try and run DCA to see the impact on the generated models. |
@michaelnebel I haven't run DCA on specific projects before, so can I confirm that I would need to use the "Manually select sources" option for this? (That's what I did for the two "CustomSources" DCA runs above, just want to make sure that was correct 🙂) |
Yes, you are right - you need to select custom sources and for C#, it is enough to select the |
Thanks! I see you've rerun DCA for this. |
(1) DCA reports no changes in the generated models for C# (as we expected). |
@jcogs33 : There are no changes in the number of generated models for |
The flakyness is probably because the branch needs to be rebased on main (the PR renaming the negative to neutral models has been merged in the meantime). |
66af985
to
91c1ec3
Compare
@michaelnebel The new DCA run looks good to me. Let me know if you disagree. |
The numbers reported by DCA looks a bit wrong. The summary section shows that all the neutral models are unique in both variants of the analysis. This is not a problem with the content of this PR, but rather a problem with the DCA implementation. |
DCA looks good now :-) |
@michaelnebel Can you re-approve? Rebasing yesterday dismissed your approval. |
Thanks @tamasvajk! 😄 |
Description
This PR updates
DataFlowTargetApi
to exclude functional expressions.Consideration
DataFlowTargetApi
where I could add a test case for this scenario? I couldn't find any existing tests in thelibrary-tests
directory, but I may have missed them.no-change-note-required
label?