[Rt-commit] rt branch, 3.8/perlcritic, updated. rt-3.8.10-37-gf0e0be5

Thomas Sibley trs at bestpractical.com
Thu Jun 30 18:12:25 EDT 2011


The branch, 3.8/perlcritic has been updated
       via  f0e0be521cd7f90a5ed8008757e7ff875fb4e787 (commit)
       via  4d20250df46d6388568ec68f0d82c342741d399c (commit)
      from  772c1c5ce838db885bc723bca79403b5f8cd60bf (commit)

Summary of changes:
 etc/upgrade/upgrade-mysql-schema.pl |    2 +-
 lib/RT.pm.in                        |   11 -----------
 lib/RT/Approval/Rule/NewPending.pm  |   14 --------------
 lib/RT/Shredder/Plugin/Summary.pm   |    1 -
 4 files changed, 1 insertions(+), 27 deletions(-)

- Log -----------------------------------------------------------------
commit 4d20250df46d6388568ec68f0d82c342741d399c
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Jun 30 18:04:58 2011 -0400

    Remove unreachable code after unconditional return statements

diff --git a/lib/RT.pm.in b/lib/RT.pm.in
index 623de66..d6dfda7 100755
--- a/lib/RT.pm.in
+++ b/lib/RT.pm.in
@@ -290,17 +290,6 @@ sub InitLogging {
             require Devel::StackTrace;
             my $trace = Devel::StackTrace->new( ignore_class => [ 'Log::Dispatch', 'Log::Dispatch::Base' ] );
             return $p{'message'} . $trace->as_string;
-
-            # skip calling of the Log::* subroutins
-            my $frame = 0;
-            $frame++ while caller($frame) && caller($frame) =~ /^Log::/;
-            $frame++ while caller($frame) && (caller($frame))[3] =~ /^Log::/;
-
-            $p{'message'} .= "\nStack trace:\n";
-            while( my ($package, $filename, $line, $sub) = caller($frame++) ) {
-                $p{'message'} .= "\t$sub(...) called at $filename:$line\n";
-            }
-            return $p{'message'};
         };
 
         if ( $Config->Get('LogToFile') ) {
diff --git a/lib/RT/Approval/Rule/NewPending.pm b/lib/RT/Approval/Rule/NewPending.pm
index 6d93d82..11214ef 100644
--- a/lib/RT/Approval/Rule/NewPending.pm
+++ b/lib/RT/Approval/Rule/NewPending.pm
@@ -78,20 +78,6 @@ sub Commit {
     $self->RunScripAction('Notify Owner', 'New Pending Approval', @_);
 
     return;
-
-    # this generates more correct content of the message, but not sure
-    # if ccmessageto is the right way to do this.
-    my $template = $self->GetTemplate('New Pending Approval',
-                                      TicketObj => $top,
-                                      TransactionObj => $to)
-        or return;
-
-    my ( $result, $msg ) = $template->Parse(
-        TicketObj => $top,
-    );
-    $self->TicketObj->Comment( CcMessageTo => $self->TicketObj->OwnerObj->EmailAddress,
-                               MIMEObj => $template->MIMEObj );
-
 }
 
 1;
diff --git a/lib/RT/Shredder/Plugin/Summary.pm b/lib/RT/Shredder/Plugin/Summary.pm
index 95f6d8f..9c9567a 100644
--- a/lib/RT/Shredder/Plugin/Summary.pm
+++ b/lib/RT/Shredder/Plugin/Summary.pm
@@ -76,7 +76,6 @@ sub Run
     my $method = 'WriteDown'. $class;
     $method = 'WriteDownDefault' unless $self->can($method);
     return $self->$method( %args );
-    return 1;
 }
 
 my %skip_refs_to = ();

commit f0e0be521cd7f90a5ed8008757e7ff875fb4e787
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Jun 30 18:06:46 2011 -0400

    Avoid critic's incorrect unreachable code policy by moving the variable declaration before the exit

diff --git a/etc/upgrade/upgrade-mysql-schema.pl b/etc/upgrade/upgrade-mysql-schema.pl
index 4a104b6..703b855 100755
--- a/etc/upgrade/upgrade-mysql-schema.pl
+++ b/etc/upgrade/upgrade-mysql-schema.pl
@@ -256,6 +256,7 @@ my %max_type_length = (
 );
 
 my @sql_commands;
+my %alter_aggregator;
 
 my ($db_datasource, $db_user, $db_pass) = (shift, shift, shift);
 my $dbh = DBI->connect("dbi:mysql:$db_datasource", $db_user, $db_pass, { RaiseError => 1 });
@@ -278,7 +279,6 @@ print STDERR <<ENDREMINDER;
 ENDREMINDER
 exit 0;
 
-my %alter_aggregator;
 sub convert_table {
     my $table = shift;
     @alter_aggregator{'char_to_binary','binary_to_char'} = (['DEFAULT CHARACTER SET utf8'],[]);

-----------------------------------------------------------------------


More information about the Rt-commit mailing list