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

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

Bug Information
Severity: Wishlist
Broken in: 1.093_001
Fixed in: (no value)



Subject: [patch] Report subroutine name when violating ProhibitExcessComplexity
With this patch the subroutine name is reported that violates maxmccabe. Up to now only the line number was reported which looks like a programmer was a bit lazy:) --- lib/Perl/Critic/Policy/Subroutines/ProhibitExcessComplexity.pm~ 2008-07-22 16:17:30.000000000 +0200 +++ lib/Perl/Critic/Policy/Subroutines/ProhibitExcessComplexity.pm 2008-10-15 14:42:17.000000000 +0200 @@ -50,8 +50,9 @@ # Is it too complex? return if $score <= $self->{_max_mccabe}; + my $name = $elem->name; - my $desc = qq{Subroutine with high complexity score ($score)}; + my $desc = qq{Subroutine ($name) with high complexity score ($score)}; return $self->violation( $desc, $EXPL, $elem ); } Thanks!
Subject: Re: [rt.cpan.org #40070] [patch] Report subroutine name when violating ProhibitExcessComplexity
Date: Wed, 15 Oct 2008 19:52:43 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Andreas Koenig via RT wrote: Show quoted text
> With this patch the subroutine name is reported that violates maxmccabe. > Up to now only the line number was reported which looks like a > programmer was a bit lazy:)
Equivalent applied. It'll be in the next release. Thanks!