Currently unused variables are detected with Variables::ProhibitUnusedVariables. But this check is very limited. Olaf Alders did a write up of the various ways of improving this, https://www.olafalders.com/2022/02/22/finding-unused-perl-variables/. I think it makes sense to add Code::TidyAll::Plugin::Test::Vars to the code policy.