Pipemailer/DieHandler.pm

filter: Statementstmt 45.0% 9 / 20 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 40.0% 2 / 5 Podpod n/a totaltotal 25.0% 11 / 44 SCAR 32.8
CC
7
Cov
26%
import
30.0
__ANON__
12.0
__ANON__
2.0
CRAP 26.5
↑ Summary Pipemailer.pm »
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Email::Pipemailer::DieHandler;
4 {
5 2 $Email::Pipemailer::DieHandler::VERSION = '1.001';
6 }
7 # ABSTRACT: do not die embarassingly if you screw up your pipemailer
8  
9  
10 sub import {
11 0 ▶ my ($self, $install, $arg) = @_;
Subroutine import: not called CC=5 SCAR=34.0
12 0 ▶ return unless $install and $install eq '-install';
Branch: 1 branch
BranchTrueFalseTotal
unless $install and $install eq "-install" 0 0 0
Condition0%0/3
$install and $install eq "-install"
!ll&&!rl&&r
000
MC/DC0%0/2
$install and $install eq "-install"
$install $install eq "-install"
Truth table0%0/3
A and B
A= $installB= $install eq "-install"
ABresult
0X0
100
111
13  
14 0 ▶ $arg ||= {};
Condition0%0/2
$arg ||= {}
l!l
00
MC/DC0%0/1
$arg ||= {}
$arg
Truth table0%0/2
A
A= $arg
Aresult
11
00
15 0 ▶ my $logger = $arg->{logger} || sub {};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$arg->{'logger'} || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$arg->{'logger'} || sub { }
$arg->{'logger'} sub { }
Truth table0%0/3
A || B
A= $arg->{'logger'}B= sub { }
ABresult
1X1
011
000
16  
17 $SIG{__DIE__} = sub {
18 0 ▶ return if $^S; # don't interfere with evals
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
if $^S 0 0 0
19 0 my ($e) = @_;
20 0 ▶ defined $^S and eval { $logger->($e); };
Branch: 1 branch
BranchTrueFalseTotal
defined $^S and eval { do { &$logger($e) } } 0 0 0
21 0 $! = 75;
22 0 die $e;
23 0 };
24 }
25  
26 2 1;
27  
28 __END__
↑ Summary Pipemailer.pm »