Possible inspection: Unnecessary middleman

Let's say that I've got the code

This code has an unnecessary middleman (please disregard the feature envy in
this example), and could be transformed into

Would this be possible to detect using an inspection? It would look for a parameter
that is only used to get a single value.

Transforming the code would be almost impossible to do with guaranteed behavior
since we cannot be absolutely sure what getFie() does, but some kind of help could
certainly be provided.


Please sign in to leave a comment.