Using something like uglify's parse-js.js [1] that gives you back the AST might be the right way to go about it. Just count the calls to each $ method in your code.
[1] https://github.com/mishoo/UglifyJS/blob/master/lib/parse-js....
[1] https://github.com/mishoo/UglifyJS/blob/master/lib/parse-js....
No comments yet.