4

I must to refactor the project in which thousands of lines of js-code. Is there a tool to search for dependencies of global variables and functions in the project javascript-files? It would be desirable that the tool could construct a graph.

1
  • 1
    You should add some more info, e.g. if this is JS code written for nodejs (if so, try the web-stats-graph module), or javascript slapped into <script> tags inside .html files (If so, you are out of luck). Or is it a mess of jQuery methods chained together ...?
    – knb
    Commented Oct 8, 2018 at 8:50

1 Answer 1

0

You can run doxygen on your project with the options set to include undocumented functions and to map dependencies (ideally with graphviz also installed) and it will give you, in a variety of formats, all of the functions and globals with where they are used.

  • Free, Gratis & Open Source
  • Cross Platform
  • Works for multiple languages:
    • Java
    • C, C++, C#
    • Python
    • Fortan
    • IDL
    • VHDL

Update

For JavaScript the doxygen site has the following to say:

For those working with JavaScript it may be good to know that Jörg Schaible has written a perl script to let doxygen deal with it. Unfortunately his site at berlios.de has been removed. If you google for js2doxy.pl you can still find copies of the script however.

This may or may not be of some help to you.

7
  • 2
    OP specifically asked for "JavaScript". I don't see that in the list.
    – Ira Baxter
    Commented Aug 1, 2016 at 7:46
  • 1
    Sorry for the wait, we had some difficulty at work, which distracted me. Your decision looks complicated, I would prefer the NPM module. But in any case I will try to use it in the next week.
    – qodunpob
    Commented Aug 5, 2016 at 2:54
  • 1
    That was 7 months ago - how did it work out?
    – Mawg
    Commented Mar 30, 2017 at 10:15
  • 1
    @Mawg - More than 4 years since OP was seen on the site so don't hold your breath. Commented Sep 25 at 18:31
  • 1
    I know. I checked. Before commenting :-( I feel somewhat frustrated when people don't come back to award an answer. I feel much more frustrated when the algorithm thows such questions to the front
    – Mawg
    Commented Sep 26 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.