-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search for dead code (commented out, not used) #136
Comments
this tool https://github.com/sebastianbergmann/phpcpd might proof usefull for refactoring files as well |
I've tried using the phpdcd and it throws a bunch of errors, but still gives output (with most likely many false positives). I'm going to check those entries and sort out as many false positives as I can, and afterwards you should recheck the updated list. Any complaints about this @pfrischmuth @white-gecko ? Here is the log for reference: phpcdc.txt I've searched for more ways to find dead code, this feature seems to be pretty rare. One other thing i found was https://phpmd.org/ sadly it doesn't search for unused functions right now, but we can find unused variables which is already a useful feature https://github.com/exakat/php-static-analysis-tools lists a lot of more or less useful tools - maybe one of the analysers actually can list dead code as well. I might look into them prior to going through the logfile from phpdcd |
Hi @shinobu, you should exclude the vendor folder in the search, because it only contains foreign software. |
@k00ni iirc I ran it in `library/Erfurt' so the vendor folder was ignored |
@shinobu: according to your phpcdc.txt file you have lines like:
According to that line, it checked the vendor folder too (vendor/sebastian). |
The undefined index is in the vendor path because |
You are right, thanks for the info, my bad. |
This is the Log of the phpmd (as mentioned above mostly unused variables) |
Another thing, as phpdcd versions |
priorize deleting outcommented code snippets, beware to not delete comments afterwards go through the phpdcd results |
Commend out code should be done in #140 . |
The text was updated successfully, but these errors were encountered: