Esprima may help you. It is a Javascript parser that can help you do static code analysis.
Here's a quick example (http://jsfiddle.net/fyBvT/):
var code = 'function funcA() { funcB(); funcC(); } function funcB(){ funcD(); } function funcC() { funcD(); } function funcD(){ console.log("This function is called by funcC and funcD"); }';
var syntax = esprima.parse(code);
var funcs = [];
_.each(syntax.body, function(i) {
if (i.type == 'FunctionDeclaration') {
var func = {name: i.id.name};
_.each(i.body.body, function(j) {
if (j.type == 'ExpressionStatement' && j.expression.type == 'CallExpression') {
func.calls = func.calls || [];
func.calls.push(j.expression.callee.name);
}
});
funcs.push(func);
}
});
console.log(funcs);
Clearly this needs a lot of help to offer much value, but it might give you some idea of what's possible and where to start.