Fix Rubcop errors

This commit fixes all the Rubocop errors with the exception of two ignores for
Method too long and Class too long.

[#78988144]