-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java: add class that represents callables that are interesting for MaD models #12838
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: add class that represents callables that are interesting for MaD models #12838
Conversation
9d301be
to
f139610
Compare
@jcogs33 Thank you for the very good PR description!!! |
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.
This looks good to me! Great work Jami!
f139610
to
8554263
Compare
Thanks for the review @michaelnebel! I rebased to get the update from #12851. @aschackmull When you get a chance, can you review and let me know if you think there should be any changes, especially to |
Update qldoc.
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.
I've adjusted the qldoc a bit. Member.qll
LGTM now.
No need, I think. |
Description
This PR adds a
ModelApi
class which represents all callables for which we might be interested in having a MaD model. The original purpose of adding this class was to disconnect the manual vs automated coverage counting from theDataFlowTargetApi
class sinceDataFlowTargetApi
is too specific to the dataflow model generator.The
ModelApi
class will also be useful for replacing some code used in the heuristics queries.The
SrcCallable
class may also be useful forTypeFlow.qll
.More specifically, this PR does the following:
SrcCallable
class with anisEffectivelyPublic
predicate inMember.qll
to approximate an effectively public callable in Java.ModelExclusions.qll
file to centralize the exclusions needed to identify APIs that are interesting for MaD models, and creates aModelApi
class which uses those exclusions.CaptureModelsSpecific.qll
andExternalApi.qll
to use the newModelExclusions.qll
file.GeneratedVsManualCoverage
metrics query to useModelApi
instead ofDataFlowTargetApi
, and adjusts theTopJdkApisTest
for this query accordingly.Consideration
Member.qll
(Note: theisEffectivelyPublic
name was chosen to align with C#'sisEffectivelyPublic
predicate name.)ModelExclusions.qll
a good name or is there something better that can be used?ModelApi
a good name or is there something better that can be used?isUninterestingForModels
:c.getDeclaringType() instanceof TestLibrary
. Let me know if this exclusion is incorrect for the model generator.Member.qll
? Or are these trivial enough to not need a change note?