Skip to content

[JavaScript] Find Invocation Nodes without resolved callees that belong to external libraries #18901

Answered by mbg
jghebre asked this question in Q&A

You must be logged in to vote

Does this do the job for you:

import javascript
import semmle.javascript.ApiGraphs

select API::moduleImport(_).getMember(_).getACall()

With your test code, this gets me the three calls to the three external function calls. If you want to additionally check that there's no callee, then you could do something like this:

import javascript
import semmle.javascript.ApiGraphs

from DataFlow::CallNode external
where external = API::moduleImport(_).getMember(_).getACall()
and not exists (external.getACallee(0))
select external

Replies: 1 comment 3 replies

You must be logged in to vote
3 replies
@jghebre

@mbg

mbg Mar 3, 2025
Maintainer

Answer selected by jghebre
@jghebre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants