Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 31093
Status: rejected
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: mods [...] hank.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.080
Fixed in: (no value)



Use 'eq' or hash instead of fixed-pattern regexps at line 130, column 41. See pages 271,272 of PBP. (Severity: 2) ( RegularExpressions::ProhibitFixedStringMatches ) Maybe it's the "1" and the regexp match on the same line? return 1 if $c->action->name =~ /^(?:create|group)$/; Found "!=" in condition for an "unless" at line 413, column 9. See page 99 of PBP. (Severity: 3) ( ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditi ons ) return unless $this && $that != $foo;
From: ELLIOTJS [...] cpan.org
On Fri Nov 30 01:56:20 2007, HANK wrote: Show quoted text
> Use 'eq' or hash instead of fixed-pattern regexps at line 130, column > 41. See pages > 271,272 of PBP. (Severity: 2) ( > RegularExpressions::ProhibitFixedStringMatches ) > > Maybe it's the "1" and the regexp match on the same line? > > return 1 if $c->action->name =~ /^(?:create|group)$/;
No, it's the fact that you're looking for a fixed set of values. Just use an "eq" comparison against 'create' and 'group': my $action_name = $c->action()->name(); return 1 if $action_name eq 'create'; return 1 if $action_name eq 'group'; Show quoted text
> Found "!=" in condition for an "unless" at line 413, column 9. See page > 99 of PBP. > (Severity: 3) ( > ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditi > ons ) > > return unless $this && $that != $foo;
"unless" is a negating operator and you've got a negative expression in it. You could rewrite this as return if ! $this || $that == $foo;
Unless I misunderstand, I don't see a bug here. So I'm rejecting this ticket for now.