Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7248021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:04:59+00:00 2026-05-28T22:04:59+00:00

Is there any tool out there which could tell the useless files in the

  • 0

Is there any tool out there which could tell the useless files in the code base?

We have a big code base (PHP, HTML, CSS, JS files) and I want to be able to remove the not needed files. Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:05:00+00:00Added an answer on May 28, 2026 at 10:05 pm

    I’m guessing deleting files and running your phpunit tests is a none starter.

    If your files are not already in a version-control system – add them. Having the files in a version control system (such as svn or git) is crucial to allow you to recover from deleting any files that you thought were not being used but you later find out were.

    Then, you can delete anything you think may not be being used, and if it doesn’t affect the running of your application you can conclude that the files aren’t used. If adverse effects show up – you can restore them from your repository with ease.

    The above is most appropriate (probably) for frontend files (css, js, images). Any files you delete that are requested will show up in your webserver error log giving you a quick reference for files that nolonger exist that you need to restore.

    For your php files, that’s quite a bit more tricky, How did you arrive at a position where you have php files which you aren’t using? Anyway you could for example:

    • Use xdebug
    • Enable profiling
    • Use append mode (one profile)
    • Use all the functions of your application

    and you would then have a profile which includes all files you loaded. Scanning the generated profile for each php file in your codebase will give you some indication of which files you didn’t use.

    If you are only looking for unused files, don’t be tempted to use code coverage analysis – it is very intensive and not the level of detail you’re asking for.

    A slightly less risky way would be to log whenever a file is loaded. e.g. put this at line one of each file:

    <?php file_put_contents('/some/location/fileaccess.log', __FILE__, FILE_APPEND); ?>
    

    and simply leave your application to be used for a while (days, weeks). Thereafter just scan that log, for any file that is named – remove the above line of code. For any that are not – delete (preferably after looking for the filename in your whole sourcecode and confirming it’s nowhere).

    OR: you could use a shutdown function which dumps the response of get_included_files() to a log file. This would allow you to achieve the same without editing all php files in your source tree.

    Caveat: Be careful deleting your php files. Whereas a missing css/js/image will probably mean your application still works, a missing php file of course will have rather more impact :).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if there is any tool out there which could be easily
I know we have ILdasm, but is there any tool out there that will
Are there any scripts out there, or have any of you built a tool,
Hi is there any tool to find out the execution time of a method?
is there any tool or utility(mapper assembly) to construct business objects from entities(which are
Is any tool / extension out there that helps me generating the CSS signature
Is there any tool that can parse a valid C program and generate a
Is there any tool that enables you to hot swap JavaScript contents while executing
Is there any tool, other than KCacheGrind, being able to view callgrind results? Preferably
Is there any tool to generate test data based on specific requirements? e.g. Size,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.