Git Product home page Git Product logo

callgraph's People

Contributors

gaborantal avatar gunar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

callgraph's Issues

Remove duplicates

Every function call is also being treated as a function reference. Hence, there's a duplicate.

Possible solutions:

  • ....?
  • Show only "references" (but this breaks possibility of #10. no good.)

TypeError: Cannot read property 'expression' of null

TypeError: Cannot read property 'expression' of null
    at TreeWalker.visit (/usr/local/lib/node_modules/callgraph/parser.js:50:41)
    at TreeWalker._visit (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:1339:24)
    at AST_Var._walk (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:929:24)
    at AST_ForIn.eval (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:654:23)
    at TreeWalker._visit (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:1343:21)
    at AST_ForIn._walk (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:653:24)
    at walk_body (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:530:17)
    at AST_BlockStatement.eval (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:541:13)
    at TreeWalker._visit (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:1343:21)
    at AST_BlockStatement._walk (eval at <anonymous> (/usr/local/lib/node_modules/callgraph/node_modules/uglify-js/tools/node.js:27:1), <anonymous>:540:24)

Using npm install -g gunar/callgraph

Take module.exports in consideration

Currently we're just parsing whole files for function declarations.

We should only try and use functions that are exported.
Also, functions may be exported with a different name!!

  • parse module.exports
  • take different names in consideration

ES6 support would be great

Great idea for a tool, really missing that right now.

Why not use Babel? (I read the comment, but can't imagine that this parser misses what is needed to create a call-graph, but I may be wrong ...)

Couldn't find preset "es2015"

This seems like the furthest along project for JavaScript call graph visualization. If there is another one you recommend over this, please let me know. Otherwise, I am running it on some source code that I am analyzing, and I am seeing this error.

$ callgraph index.js
Processing index.js
[Error: Couldn't find preset "es2015" relative to directory "/Users/my-name/my-project/lib"]
[TypeError: S.input is not a function]
Success! Check callgraph.png

And although the success message was displayed, and although the file callgraph.png has been generated, it is blank.

Support for .prototype method calls?

First off, this is a great start! and a tool I've been searching for for a long time.

It appears that .prototype method calls on custom class/functions aren't graphed?

Is this something you plan on adding? Or am I missing something obvious?

Thanks again for sharing such a cool package. I might try to dig into the source code a bit if I can find the time.

Export as binary

Like babel-cli does, having it in node_modules/.bin/callgraph

callgraph index.js#function ?

Hi,
It would be great to let specify a function in a JS file as an entry. As a workaround, I put the targeted function alone, with it's dependencies in one file, in order to omit other functions, but this is tedious.

Context:
Optional. It could be easier to track a single function as an entry, if file contains many many functions.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.