mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Improve AccessPath printing.
This commit is contained in:
@@ -128,10 +128,30 @@ SummaryComponent interpretComponentSpecific(AccessPathToken c) {
|
||||
)
|
||||
}
|
||||
|
||||
private string getContentSpecific(Content cs) {
|
||||
cs = TListElementContent() and result = "ListElement"
|
||||
or
|
||||
cs = TSetElementContent() and result = "SetElement"
|
||||
or
|
||||
exists(int index |
|
||||
cs = TTupleElementContent(index) and result = "TupleElement[" + index.toString() + "]"
|
||||
)
|
||||
or
|
||||
exists(string key |
|
||||
cs = TDictionaryElementContent(key) and result = "DictionaryElement[" + key + "]"
|
||||
)
|
||||
or
|
||||
cs = TDictionaryElementAnyContent() and result = "DictionaryElementAny"
|
||||
or
|
||||
exists(string attr | cs = TAttributeContent(attr) and result = "Attribute[" + attr + "]")
|
||||
}
|
||||
|
||||
/** Gets the textual representation of a summary component in the format used for flow summaries. */
|
||||
string getAccessStepSpecific(SummaryComponent sc) {
|
||||
sc = TContentSummaryComponent(any(ListElementContent c)) and
|
||||
result = "ListElement"
|
||||
exists(Content c |
|
||||
sc = TContentSummaryComponent(c) and
|
||||
result = getContentSpecific(c)
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the textual representation of a parameter position in the format used for flow summaries. */
|
||||
|
||||
Reference in New Issue
Block a user