Skip to content

Conversation

janedbal
Copy link
Member

@janedbal janedbal commented Oct 17, 2024

This allows to:

  • detect dead cycles
  • detect dead transitive calls

@janedbal janedbal marked this pull request as ready for review October 23, 2024 13:49
@janedbal janedbal merged commit fc01208 into master Oct 24, 2024
12 checks passed
@janedbal janedbal deleted the call-graph branch October 24, 2024 08:20
@staabm
Copy link
Contributor

staabm commented Oct 24, 2024

thanks for working on making dead-code detection even better.

in case you are interessted in edge-cases in which dead code is detected, but might be a false-positive, I would suggest running this tool on phpunit :)

  • git clone phpunit
  • add to phpstan.neon:
includes:
    - vendor/shipmonk/dead-code-detector/rules.neon 
  • run php tools/phpstan

-> 493 errors reported :)

@janedbal
Copy link
Member Author

Thanks, first run is often tricky.

It gave hundreds of errors for phpstan-src too, but with a single @api provider, it came down to ~50 valid reports: phpstan/phpstan-src#3581 And even there, I did not find a single false-positive. Mostly, those are tricky magic things like dealing with DIC (which is really really hard to support properly, so I disabled __construct analysis there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants