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: 72980
Status: open
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.116
Fixed in: (no value)



Subject: ProhibitMagicNumbers false positive with capture variables
Download (untitled) / with headers
text/plain 257b
Test program: $_ = 'xxxxxxxxxxxxxxxxxxxx'; /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)/; my $x = $13; print $x; Checking with --single-policy ValuesAndExpressions::ProhibitMagicNumbers gives the message 3 is not one of the allowed literal values (0, 1, 2).
Subject: Re: [rt.cpan.org #72980] ProhibitMagicNumbers false positive with capture variables
Date: Mon, 05 Dec 2011 20:17:34 -0600
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Download (untitled) / with headers
text/plain 409b
PPI bug: ppidump 'my $x = $13;' PPI::Document PPI::Statement::Variable [ 1, 1, 1 ] PPI::Token::Word 'my' [ 1, 4, 4 ] PPI::Token::Symbol '$x' [ 1, 7, 7 ] PPI::Token::Operator '=' [ 1, 9, 9 ] PPI::Token::Magic '$1' [ 1, 11, 11 ] PPI::Token::Number '3' [ 1, 12, 12 ] PPI::Token::Structure ';'
A fix for this has been released with PPI 1.220 on CPAN. So this should be ok now.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

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