-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Python: Rich type
column in MaD
#16490
Conversation
973e09a
to
21b0dd3
Compare
21b0dd3
to
d4d6b48
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.
A few comments here and there, but overall I think this looks good. 👍
bindingset[type] | ||
private predicate parseType(string type, string typePath, string suffix) { | ||
exists(string regexp | | ||
regexp = "([^!]+)(!|)" and |
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.
Is (!|)
different from (!?)
somehow? (Apart from the latter expressing some level of surprise. 😅)
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 must admit that I just copied the Ruby one...I kind of like the surprised version :-)
python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsSpecific.qll
Outdated
Show resolved
Hide resolved
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.
Apart from a minor suggestion, I think this looks good. Don't forget to do a performance test (though I doubt we have anything that will actually exercise this code that much).
Co-authored-by: Taus <tausbn@github.com>
I kicked off a DCA run, but you are right that it might not show much until we really start using this... |
The DCA run showed no degredation (no chnage at all, really, as expected). |
This allows a dotted path in the
type
column of a MaD row. This means that- ["foo", "Member[MS_Class].Instance.Member[instance_method]", "Argument[self]", "ReturnValue.TupleElement[0]", "value"]
can now be written
- ["foo.MS_Class", "Member[instance_method]", "Argument[self]", "ReturnValue.TupleElement[0]", "value"]
see the rewritten test models for more examples.