Finding unused or rarely used functions


during the refactoring process, one of the main issues is to find functions/methods f.e. in global function libaries or classes that are not longer or only rarely used.
So it would be nice to have something like a statistic for a file, which tells me how many times each function is used.
Because phpstorm must have somethings like an internal tree, which hold the relations betwenn functions/classses/vars it should be easy to realize, isn't it?
It is clear that theses hits can not be precisely, because function names could be used more the once a time in different files. But the developer should know the structure of the sourcecode and shpuld be able to analyse theses quantitatively evaluation.
In the first step, marking that functions that never be used in the source would help.

Did I miss this kind of function in phpstorm?

1 comment

Hi there,

AFAIK there is no such functionality available in PhpStorm.

You can use PHP Depend (or similar) -- it has lots of metrics and may have what you are looking for:  (e.g. Number of Method or Function Calls)


Please sign in to leave a comment.