Closed staabm closed 1 month ago
Honestly, I never did any comparison with this library. I'd try that in our huge codebase (where our tool work well), but seeing its readme, I dont really see any entrypoint configuration so I'm not sure where I should place our huge list of all the symfony/doctrine/... methods which are "dead" by design. I cannot really imagine how that might work without that :D
Currently, whitelisting dead methods (ignoring those that are currently dead in the project) is not implemented at all. You can always mark those as "entrypoint" as shown in readme (which is what we currently do).
But I think PHPStan's error identifiers (since 1.11) will be much better option, as those has native backchecking functionality (reports that it is not dead anymore once used).
But, all this is more suitable for applications, not libraries. Libraries typically need something like @api
that theoretically may serve as ignorelist. And I'd say, you can use EntrypointProvider
for that very easily in current implementation.
In recent weeks, I made quite major improvements and did the comparison with unused-public. It is now mentioned in readme: https://github.com/shipmonk-rnd/dead-code-detector?tab=readme-ov-file#comparison-with-tomasvotrubaunused-public
first let me say thank you for this repo... dead code is a major problem, a lot of people miss :-).
we are currently using https://github.com/TomasVotruba/unused-public which is pretty similar. it would be great to see if there is a major difference between this 2 libs...?
one thing I saw by reading the docs: you are using a NEON based whitelist, while
unused-public
allows whitelisting by adding a@api
annotation at class and/or method level. maybe thats something useful for you as well