Problem/Motivation
longwave commented that they tested a dead code detector. I then tried shipmonk/dead-code-detector on Admin. It doesn't understand hooks but did find things that can be cleaned up.
The errors from the detector can be seen in the results from the issue to add this dectector to core, https://git.drupalcode.org/project/drupal/-/jobs/9083937
Steps to reproduce
Proposed resolution
Fix errors detected by the dead code detector
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3582178
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3582178-remove-dead-code
changes, plain diff MR !15277
Comments
Comment #2
quietone commentedThis also has renames for several hook methods, that is probably out of scope here.
Comment #4
quietone commentedComment #5
longwaveI think these are all good changes. Not injecting all those services might make every admin page a tiny bit faster. The method renames also make the intent a bit clearer.
Comment #6
amateescu commentedCommitted and pushed d09bf682dc3 to main and 1031e2c5693 to 11.x. Thanks!