I inherited some website repos that have a lot of files in them that I suspect are not in use and not referenced anywhere. They have names like dashboard-notWorking.php and invoice-old.php.
Are there some tools out there that can scan the code and tell me what files are in use and which ones don't have any references to them?
I tried searching for the names of the suspect files in VSCode, and that seems to work, it will just be tedious to do this for each file in the repo. Hoping to automate this a bit.
If you have access to a bash prompt, you could do something like this:
That should identify all PHP files that have names that don't appear in other PHP files in the same folder.
NB take care with this however, if you've got multiple folders or an autoloader this approach won't work.