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:
Low/Low
Queue:

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

BugTracker
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.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.