Critic

Beatnik on 2006-09-06T12:39:14

A short list of critic so far (up to severity 3). I'm still not grasping some of the problems.. Others, I can just live with... some are just false :) I'll probably produce an updated list with statistics (even though this might get embarrasing):

  • Variable declared in conditional statement
  • Expression form of "eval"
  • AUTOLOAD method declared
  • @ISA used instead of "use base"
  • "warn" used instead of "carp"
  • "die" used instead of "croak"
  • Bareword file handle opened
  • Symbols are exported by default
  • Ambiguous name for variable or subroutine
  • Capture variable used outside conditional
  • Regular expression without "/x" flag
  • Subroutine name is a homonym for builtin function
  • Subroutine with high complexity score (X)
  • Subroutine does not end with "return"
  • Warnings disabled
  • Pragma "constant" used
  • Mixed high and low-precedence booleans
  • Heredoc terminator must be quoted
  • Loop iterator is not lexical


File bugs please

jjore on 2006-09-06T13:12:42

Perl::Critic is hardly bug free. I've been committing failing tests as I've been delinting my own source and finding both false positives and negatives.

I started from the other end.

jk2addict on 2006-09-06T14:10:23

I set my test severity to 1, then disabled policies I didn't agree with n a custom rc file. I figure that way, when a new policy comes out, it will be on by default, until I either disagree/disable it, or fix code.

So far so good.