7

I've inherited a website that seems to import every JS and CSS framework my predecessor could think of. Is there an easy way to analyze the site and determine which ones are actually being used? Or do I have to manually check every page on the site?

5

JavaScript

Use a JavaScript code coverage tool such as JSCover. It returns a coverage chart like this one showing what percentage of functions in each linked JavaScript file are used.

JSCover coverage report

CSS

Download the site and recreate it locally, then use a CSS scanning tool such as Helium. It requires a line-separated list of URLs to parse.

  • Is JSCover not used to test how much of the code your unit tests cover? Without a comprehensive accompanying suite of unit tests I don't see that JSCover will tell you much at all. – danwellman Sep 17 '15 at 14:50
  • @danwellman JSCover doesn't check unit-tests, but browser test coverage. it loads the site to be tested into the browser and tracks what code is executed by the browser. how it is executed is up to you. either from a test framework that instruments the browser or manual testing by clicking on things. – eMBee Nov 22 '16 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.