3 ms·
PHPStorm/IntelliJ has this feature where it marks any unused functions as gray. If you want to find where used functions are used, simply hit Ctrl-G and it'll
by pascalxus 9y ago
PHPStorm/IntelliJ has this feature where it marks any unused functions as gray. If you want to find where used functions are used, simply hit Ctrl-G and it'll show you all the places.
- Terr_ 9y agoAt least in PHP it depends on making sure the rest of your code-ecosystem has good annotations/type-hints. Especially if you have any code doing stuff like: return new $className();
- cassowary 9y agoWell, privates that are unused or only used by something like $method = 'get' . $command; $this->$method; are marked in grey. Which means some methods that you need to keep are grey. Not necessarily helpful. And other methods you want to deleted are not grey. (The solution to that is "write code that doesn't suck", but alas, dead code tends to be a bigger problem in code that you didn't write.) But as others have said, the unused code that keeps me busy is the stuff that says: if($this->option->isTurnedOn()) { $this->doStuff(); } else { $this->doThat(); } Sometimes it turns out that everyone uses it in the non-default state. Then there's the cases where everyone wants to use it in the non-default state, they just don't know the option can be toggled.