fixes #7660: fixes first bunch of rubocop warnings

Variable shadowing cop wasn't happy.