Fix rubocop issues

Rewrote part of the check raid plugin to make it pass rubocop
Fix var issue