4

Are there any tools out there which are able to scan all your server files or your www folder (localhost) and tell you:

  • which CSS ids and/or classes aren't used
  • which JS functions are not called, ever
  • same thing, but for PHP methods or variables
  • which images or even html files are not linked to

Is there anything that does this? Or at least some of the above?

7
  • You could run xenu and compare to a directory dump Commented Nov 17, 2012 at 18:43
  • 1
    This is impossible, due to the dynamic nature of JavaScript. Arbitrary code can be executed, and you cannot know what functions are in use, and where. It's impossible to determine which resources are not linked to, as you might have links to them outside your site. If you can limit the scope of your problem, you will have more success. Commented Nov 17, 2012 at 18:45
  • He is asking for methods and variables not used, not only files not used. Good question, I dont think it is possible (think about variable valiables and variable functions), but who knows. Commented Nov 17, 2012 at 18:46
  • Obviously it would be impossible for such a tool to identify with an accuracy of 100%, due to the dynamic aspects you've mentioned. But I was referring to something like, if it finds a method, and no reference to that method, then flag it. And regarding the resources, scan the code in a "static way" and flag the resources that are not linked directly and then let me interpret if they are or are not. There MUST be SOMETHING out there :( isn't there? Commented Nov 17, 2012 at 18:50
  • YSlow is telling you what css classes are not used, but that is always based on the current page. For Javascript a possible but non totally valid way might be writing testcases for each feature on your page. Everything not highlighted in codecoverage might at least be worth to look over Commented Nov 17, 2012 at 18:51

1 Answer 1

1

There's an addin for Firefox called CSS Usage which will list the selectors used. I haven't used it for a while, but I think it also lists unused selectors.

I don't know of anything that will fulfil the remainder of your requirements.

Sign up to request clarification or add additional context in comments.

2 Comments

@AndreiBogdan Would you like to post the answer?
Sorry, I was talking about the comment previous to that regarding the Firefox extension :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.