could a plugin do this?
I think it should be possible at least for simple cases:
when a method calls itself and has no (other) exit points
it's an infinite recursion.
And IDEA is able to parse exit points, as I can see when
extract-method fails because of "multiple exit points".
IDEA could highlight sth. like this just as it does
for "silly assignment".