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.

  • 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 Oct 8 at 8:50

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.

  • 2
    OP specifically asked for "JavaScript". I don't see that in the list. – Ira Baxter Aug 1 '16 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. – Константин Башаркевич Aug 5 '16 at 2:54
  • 1
    That was 7 months ago - how did it work out? – Mawg Mar 30 '17 at 10:15

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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