There can be cases when one javascript file is used for multiple html pages, we need to read only those functions that are going to used by the Html page being analyzed.
And how will you know what those functions are?
To me, we'd have to look at an entire web app, know whether a DOM element with the id existed anywhere, and whether that Javascript function is referenced anywhere.
There can be cases when one javascript file is used for multiple html pages, we need to read only those functions that are going to used by the Html page being analyzed.