Skip to content

Commit 30d192a

Browse files
committed
JS: Move getName() to a shared location
1 parent f845ac1 commit 30d192a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

javascript/ql/src/meta/alerts/TaintSources.ql

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
import javascript
1212
import meta.internal.TaintMetrics
1313

14-
string getName(DataFlow::Node node) {
15-
result = node.(RemoteFlowSource).getSourceType()
16-
or
17-
not node instanceof RemoteFlowSource and
18-
result = "Taint source"
19-
}
20-
2114
from DataFlow::Node node
2215
where node = relevantTaintSource()
23-
select node, getName(node)
16+
select node, getTaintSourceName(node)

javascript/ql/src/meta/internal/TaintMetrics.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,10 @@ DataFlow::Node relevantSanitizerInput() {
100100
result = any(HtmlSanitizerCall call).getInput() and
101101
not result.getFile() instanceof IgnoredFile
102102
}
103+
104+
string getTaintSourceName(DataFlow::Node node) {
105+
result = node.(RemoteFlowSource).getSourceType()
106+
or
107+
not node instanceof RemoteFlowSource and
108+
result = "Taint source"
109+
}

0 commit comments

Comments
 (0)