How to write query to get Call Graph in JS? #9458
              
                Unanswered
              
          
                  
                    
                      kal-purush
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment 1 reply
-
| This is not what you'd call an official feature, but I think something like this query ought to work: import javascript
query predicate nodes(Function func, string key, string value) {
  key = "semmle.label" and value = func.getName()
}
from DataFlow::InvokeNode call, Function caller, Function callee
where caller = call.getEnclosingExpr().getEnclosingFunction()
  and callee = call.getACallee()
select caller, calleeYou then need to run it with and after that run you can convert it to Dot with  | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
is it possible to get a call graph for a codebase, preferably in dot format? I have found a few examples in other languages, so my guess is it should be possible but I can not figure it out.
Beta Was this translation helpful? Give feedback.
All reactions