Skip to content

Commit 75fd20b

Browse files
committed
Python: add meta-query for calls to summarized callables
1 parent 1c7f6dc commit 75fd20b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @name Summarized callable call sites
3+
* @description A call site for which we have a summarized callable
4+
* @kind problem
5+
* @problem.severity recommendation
6+
* @id py/meta/summarized-callable-call-sites
7+
* @tags meta
8+
* @precision very-low
9+
*/
10+
11+
import python
12+
import semmle.python.dataflow.new.DataFlow
13+
import semmle.python.dataflow.new.FlowSummary
14+
import meta.MetaMetrics
15+
16+
from DataFlow::Node useSite, SummarizedCallable target, string kind
17+
where
18+
(
19+
useSite = target.getACall() and kind = "Call"
20+
or
21+
useSite = target.getACallback() and kind = "Callback"
22+
) and
23+
not useSite.getLocation().getFile() instanceof IgnoredFile
24+
select useSite, kind + " to " + target

0 commit comments

Comments
 (0)