Detecting JavaScript Errors and Code Smells with Static Analysis

JavaScript to date has become a popular language in the world and it, more especially in open source ecosystems, has been on the top of the most popular languages on GitHub since 20161). Also, JavaScript has been supposed to be the holy grail of cross-platform languages like developing server, mobile, and desktop applications beyond just websites.

While various and fragmented technologies arise and code bases written in JavaScript are larger, the quality cost for debugging and managing code bases is dramatically increasing. The fact that JavaScript does not have grumbling compilers instantly checking code problems makes this worse. There is research that TypeScript or Flow which supports type checking in JavaScript can prevent 15 percent of the bugs2). Static analysis tools come into play at this stage. Research says the relative cost to repair defects at post-product release is 6 times more than at the coding/unit test stage). Static analysis tools have significantly reduced the quality cost for languages like C, C++, and Java by catching code defects at the earlier stage of the development cycle.

Detecting JavaScript Errors and Code Smells with Static Analysis