Add support for CSV-specified flow to or from fields.

This commit is contained in:
Chris Smowton
2021-04-26 15:38:12 +01:00
parent 200126b302
commit 73fa680224

View File

@@ -70,9 +70,23 @@ predicate summaryElement(DataFlowCallable c, string input, string output, string
)
}
bindingset[name]
private FieldContent interpretField(string name) {
exists(string splitRegex, string package, string className, string fieldName |
splitRegex = "^(.*)\\.([^.]+)\\.([^.]+)$" and
package = name.regexpCapture(splitRegex, 1) and
className = name.regexpCapture(splitRegex, 2) and
fieldName = name.regexpCapture(splitRegex, 3)
|
result.getField().hasQualifiedName(package, className, fieldName)
)
}
/** Gets the summary component for specification component `c`, if any. */
bindingset[c]
SummaryComponent interpretComponentSpecific(string c) {
c.matches("Field %") and result = SummaryComponent::content(interpretField(c.splitAt(" ", 1)))
or
c = "ArrayElement" and result = SummaryComponent::content(any(ArrayContent c0))
or
c = "Element" and result = SummaryComponent::content(any(CollectionContent c0))