When I use C# or Perl, there are some useful tools like StyleCop, FxCop, Perl::Critic and Perltidy. They can check or format my code automatically. Then, are there any equiv
There's some style checkers listed at in the Ruby toolbox at https://www.ruby-toolbox.com/categories/code_metrics .
Also, turning on warnings can check for some kinds of bad code. Do so with $VERBOSE = true or by one of the ways listed here.
$VERBOSE = true