Skip to content

Commit 7fccdec

Browse files
committed
Create CallGraphForComparison.ql
1 parent f11815c commit 7fccdec

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @name Call graph for comparison
3+
* @description An edge in the call graph.
4+
* @kind problem
5+
* @problem.severity recommendation
6+
* @id js/meta/alerts/call-graph-for-comparison
7+
* @tags meta
8+
* @precision very-low
9+
*/
10+
11+
import javascript
12+
private import semmle.javascript.dataflow.internal.DataFlowPrivate
13+
14+
from InvokeExpr invoke, Function f, string kind
15+
where
16+
viableCallable(any(DataFlowCall call | call.asOrdinaryCall().getInvokeExpr() = invoke))
17+
.asSourceCallable() = f and
18+
kind = "Call" and
19+
not f.getTopLevel().isExterns()
20+
select invoke, kind + " to $@", f, f.toString()

0 commit comments

Comments
 (0)