See D17967. We currently can not detect code like this:
$variable = do_expensive_thing(); // $variable is never used
Sometimes this is a performance issue, sometimes it's a typo, sometimes it's just an unused variable that could be removed.
We may need to fix T8049 before we can do this, to avoid false positives when $variable is used in a string literal.