blib/lib/Egg/View/Mail/Plugin/Lot.pm

filter: Statementstmt 40.7% 11 / 27 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 50.0% 3 / 6 Podpod 100% 1 / 1 totaltotal 27.2% 15 / 55 CC 9 SCAR 40.7
CC
9
Cov
26%
send
90.0
__ANON__
2.0
__ANON__
2.0
CRAP 58.4
« blib/lib/Egg/View/Mail/Mailer/SMTP.pm ↑ Summary blib/lib/Egg/View/Mail.pm »
1 package Egg::View::Mail::Plugin::Lot;
2 #
3 # Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
4 #
5 # $Id: Lot.pm 285 2008-02-28 04:20:55Z lushe $
6 #
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Carp qw/ croak /;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 our $VERSION = '0.01';
12  
13 0 ▶sub send {
Subroutine send: not called CC=9 SCAR=45.0
Pod documented
14 0 my $self= shift;
15 0 my $attr= { %{$self->config},
16 0 ▶ %{ $_[0] ? ($_[1] ? {@_}: $_[0]) : croak q{I want mail data.} },
Branch: 2 branches
BranchTrueFalseTotal
$_[0] ? : 0 0 0
$_[1] ? : 0 0 0
17 };
18 0 ▶ my $toadder= $attr->{to} || croak q{I want to address.};
Condition0%0/2
$attr->{'to'} || croak('I want to address.')
l!l
00
MC/DC0%0/1
$attr->{'to'} || croak('I want to address.')
$attr->{'to'}
Truth table0%0/2
A
A= $attr->{'to'}
Aresult
11
00
19 0 ▶ my $start_hook= $attr->{start_hook} || sub {};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$attr->{'start_hook'} || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$attr->{'start_hook'} || sub { }
$attr->{'start_hook'} sub { }
Truth table0%0/3
A || B
A= $attr->{'start_hook'}B= sub { }
ABresult
1X1
011
000
20 0 ▶ my $end_hook = $attr->{end_hook} || sub {};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$attr->{'end_hook'} || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$attr->{'end_hook'} || sub { }
$attr->{'end_hook'} sub { }
Truth table0%0/3
A || B
A= $attr->{'end_hook'}B= sub { }
ABresult
1X1
011
000
21 0 my $count;
22 0 ▶ for (ref($toadder) eq 'ARRAY' ? @$toadder : $toadder) {
Branch: 1 branch
BranchTrueFalseTotal
ref $toadder eq 'ARRAY' ? : 0 0 0
23 0 ++$count;
24 0 my %data= ( %$attr, to=> $_ );
25 0 $data{body}= $self->create_mail_body(\%data);
26 0 $start_hook->($count, \%data);
27 0 $self->mail_send(\%data);
28 0 $end_hook->($count, \%data);
29 }
30 0 ▶ $count || 0;
Branch: 1 branch
BranchTrueFalseTotal
$count or 0 0 0 0
31 }
32  
33 2 1;
34  
35 __END__
« blib/lib/Egg/View/Mail/Mailer/SMTP.pm ↑ Summary blib/lib/Egg/View/Mail.pm »