Say I have a controller
public function someAction(){
$something = Helper::something();
}
And I have a test to check Helper::something()
returns/does whatever it should.
Down the line I refactor someAction()
to not need that method anymore (and for arguments sake it's not used elsewhere). When I run tests/coverage, Helper::something()
will show up as covered/used code, despite it only ever being used in a test.
Are there any techniques to tell if the code/method is actually used?
I'm not wondering how long it would take to find dead code, just wondering if there are any techniques, tools etc to help identify it automatically.
Helper::something()
. Maybe you should be testingsomeAction()
.