Skip to content
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

Useless dependencies option #51

Open
soullivaneuh opened this issue Jan 24, 2018 · 6 comments
Open

Useless dependencies option #51

soullivaneuh opened this issue Jan 24, 2018 · 6 comments

Comments

@soullivaneuh
Copy link

It would be a great addition to be able to list useless dependencies. I mean an required dependency with no symbol usage at all.

Of course, it should be optional and the configuration file should accept packages to ignore.

Some packages could just provide configuration file or whatever not related to PHP directly, but used. This case would be a false positive.

@Ocramius
Copy link
Collaborator

This is problematic due to how composer dependencies work, as sometimes you have to require a dependency, and then a third-party package performs a lookup to see if a certain HTTP client or extension is available, then looks for polyfills and so on.

This means that the useless packages would be filled with potentially dangerous false-positives.

@mindplay-dk
Copy link

This means that the useless packages would be filled with potentially dangerous false-positives.

That fact makes it perhaps not useful for automation, but yhere could still be an option to request this check on demand - usually the maintainer is going to be able to tell false positives from real ones, so this check could definitely be useful in my opinion.

For example, after a large refactoring, such as splitting off certain members to a separate package - it's often hard to keep track of the dependency changes in that situation.

@soullivaneuh
Copy link
Author

This means that the useless packages would be filled with potentially dangerous false-positives.

@mindplay-dk Well explained what I think about that.

This is also why I said the configuration file should accept packages to ignore.

@MidnightDesign
Copy link
Contributor

Duplicate of #14?

@bobvandevijver
Copy link
Contributor

@soullivaneuh Would https://github.com/composer-unused/composer-unused help for your case?

@SvenRtbg
Copy link
Contributor

SvenRtbg commented May 4, 2021

Would https://github.com/composer-unused/composer-unused help for your case?

I'd recommend that tool, too, even though it is only just starting and has some issues, errors and unresolved edge cases.

I have them both running in an automated job, so using one or two tools is no big deal. And I can imagine that these two tools have way different approaches due to their different nature. Keeping them separate will probably reduce overall complexity. ;)

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

No branches or pull requests

6 participants