I'm just looking for an accurate symbol table to be exported in something like ctags format for code navigation. I've seen tools that capture somewhere between about 1% and 9% of large projects. [1]
I know it's a hard problem that can't be solved with static analysis like in C, indeed! I know people could do
var x = "do", y = "something", z[x + y] = function() {};
...
z[x + y] = (some other function now)
Contextual reassignments, various forms of composability, yep!
This thing is still important. The goal is to reduce the "Wtf is going on here" phase of diving into existing code. I have had to honestly abandon projects and back out of jobs with good friends because I couldn't get to that answer fast enough.
You can do so many cryptic layered indirect things with javascript, it makes unraveling it really quite hard - especially if there's a language barrier (as there was in the one I'm thinking of where I had to resign after 6 weeks in shame for a guy I had worked with for 2 years on a previous company).
I tried to build this claimed introspection tool myself in vain over the course of about 2 weeks, but diminishing returns hit and things got pretty hard. Javascript can be beautiful and simple - but it can also have cascading chains of action-at-a-distance with layers of framework scaffolding obscuring the business logic code so that the caller and the callee are not 1 frame, but 10 or 15 frames apart. [2]
My campaign to encourage people to write code in the plain in a way that hopefully any future junior developer will understand is a lifetime project.
Until I get there, tools like this would be truly invaluable. Back in the C/C++ days, it saved my butt daily.
---
[1] Excuse me for not finger pointing to specific projects. I don't find it courteous or productive. I aggressively surveyed [probably] all of them, including those offered by IDEs, in 2015.
[2] This leads to two easier tools which are
(1) the "stack and step collapser" - essentially a way to tell the debugger to ignore entire directories of code when stepping through code or printing stackdumps. Having to go through stack traces that can be literally over 100 levels with only 1 or 2 being your code is certainly a system we can improve on.
(2) a stack of stacks ... so that if an error is caught, the stack isn't smashed and replaced, but preserved in a second dimensional stack so when an error is just "some error occurred in these 1,000 lines" you can still see the previous stack.
I've often just seen stack dumps be the frameworks error handler (or the error handler erroring) and have no indication as to the actual source of the error. It's crazy how useless it can be. A stack of stacks would solve this (again, as would not coding silly things like this in the first place).
I can't imagine I'm the only person who has to deal with these problems on a daily basis. They waste so much time and leave me so flabbergasted as to how to address problems sometimes.