1. A method, comprising: receiving, by a computer, Hypertext Markup Language (HTML) and JavaScript source code instructions, wherein one or more of the JavaScript source code instructions comprise an asynchronous handler, and wherein the HTML comprises a plurality of entry points into the JavaScript source code instructions; performing a static analysis on the received HTML to identify the entry points from the HTML into the JavaScript source code instructions; identifying, starting with each of the entry points in the HTML, respective control flows and data flows for the JavaScript source code instructions; generating, based on the static analysis, a graph including the control flows and the data flows identified for each of the entry points; analyzing the control and the data flows in the graph to identify an anti-pattern comprising one or more JavaScript source code instructions that result in inefficient or poor behavior while executing the application; and replacing, by the computer, the anti-pattern with alternative JavaScript source code instructions that are functionally equivalent and more efficient than the anti-pattern.