mirror of
https://github.com/github/codeql.git
synced 2026-04-24 08:15:14 +02:00
JS: Move getName() to a shared location
This commit is contained in:
@@ -11,13 +11,6 @@
|
||||
import javascript
|
||||
import meta.internal.TaintMetrics
|
||||
|
||||
string getName(DataFlow::Node node) {
|
||||
result = node.(RemoteFlowSource).getSourceType()
|
||||
or
|
||||
not node instanceof RemoteFlowSource and
|
||||
result = "Taint source"
|
||||
}
|
||||
|
||||
from DataFlow::Node node
|
||||
where node = relevantTaintSource()
|
||||
select node, getName(node)
|
||||
select node, getTaintSourceName(node)
|
||||
|
||||
@@ -100,3 +100,10 @@ DataFlow::Node relevantSanitizerInput() {
|
||||
result = any(HtmlSanitizerCall call).getInput() and
|
||||
not result.getFile() instanceof IgnoredFile
|
||||
}
|
||||
|
||||
string getTaintSourceName(DataFlow::Node node) {
|
||||
result = node.(RemoteFlowSource).getSourceType()
|
||||
or
|
||||
not node instanceof RemoteFlowSource and
|
||||
result = "Taint source"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user