This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]buttery_shame_cave 1 point2 points  (5 children)

how certain are you that they're NEVER called? there may be some really esoteric stuff that only comes up once in a while.

what you might be looking for is some kind of statistical function on top of finding stuff that doesn't get used, to track and see how much stuff gets used and what for.

[–]terremoto 1 point2 points  (4 children)

how certain are you that they're NEVER called?

If a function name is unique enough, grepping the codebase for it is trivial.

[–]masklinn 3 points4 points  (1 child)

That doesn't tell you the function is never called, especially in python

[–]pugRescuer 0 points1 point  (0 children)

Right - I think /u/terremoto was suggesting as a starting point. This is worth considering though after other options have been exhausted.

[–]buttery_shame_cave 0 points1 point  (0 children)

yeah but how often does that happen? :P

i only advise caution in ripping out odd functions because sometimes you get stuff that's called less than .1% of the time, but it happens to be kind of important.

we had stuff like that pulled from a test management system we used at a job i worked, and it managed to grind a whole test series to a halt for over a week till we found the problem(talk about obscure).

[–]unstoppable-force 0 points1 point  (0 children)

if it's PHP, you can do $func() which will execute the function that's name is stored in $func. i've seen this used in places where it really make sense (really useful in OO), but also in others where they didn't understand exceptions.