
Ask HN: What are the best tools for dead code detection? - wkoszek
I work in some Java and Objective C code, and while the Android Studio&#x2F;XCode don&#x27;t complain, I suspect some ifs and else&#x27;s are hit. Are there any tools that could instrument the code at runtime and say if certain code fragments are hit?
======
HoppedUpMenace
Only one I've come across is Dead Code Detector plugin for Netbeans, which
worked really well for me when looking for unused anything anywhere.

------
shoo
a crude way of looking at it would be to instrument the code to measure code
coverage. some coverage tools support distinguishing which branches were
executed and which were not (at a finer granularity than statement-level
coverage).

this may not be exactly what you want - it would tell you "the branches were
not taken during this run of the program", but not "it is logically impossible
for this branch to be taken for any run of the program"

------
lsiebert
I often use the command line utility ag to see where a particular function or
method might be called.

