blib/lib/Email/MIME/MobileJP/Template.pm

filter: Statementstmt 51.6% 16 / 31 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 37.5% 21 / 56 SCAR 27.0
CC
6
Cov
37%
render
42.0
new
2.0
BEGIN
1.0
CRAP 14.9
↑ Summary blib/lib/Email/MIME/MobileJP/Parser.pm »
1 package Email::MIME::MobileJP::Template;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Tiffany;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Email::MIME::MobileJP::Creator;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub new {
10 0 ▶ my ( $class, $name, $args ) = @_;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
11 0 my $tiffany = Tiffany->load( $name, $args );
12 0 return bless { tiffany => $tiffany }, $class;
13 }
14  
15 sub render {
16 0 ▶ my ( $self, $to, $tmpl, @args ) = @_;
Subroutine render: not called CC=6 SCAR=37.4
Pod undocumented
17 0 ▶ Carp::croak('Usage: $tmpl->render($to, $tmpl[, @args])') unless defined $tmpl;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $tmpl 0 0 0
18  
19 0 my $creator = Email::MIME::MobileJP::Creator->new($to);
20  
21 0 my @lines = split /\n/, $self->{tiffany}->render( $tmpl, @args );
22 0 ▶ while ( @lines > 0 && $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@lines > 0 and $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/) 0 0 0
Condition0%0/3
@lines > 0 and $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
!ll&&!rl&&r
000
MC/DC0%0/2
@lines > 0 and $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
@lines > 0 $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
Truth table0%0/3
A and B
A= @lines > 0B= $lines[0] =~ /^([A-Z][A-Za-z_-]+)\s*:\s*(.+?)$/
ABresult
0X0
100
111
23 0 my ( $key, $val ) = ( $1, $2 );
24 0 $creator->header($key, $val);
25 0 shift @lines;
26 }
27 0 ▶ if ( @lines > 0 && $lines[0] =~ /^\s*$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@lines > 0 and $lines[0] =~ /^\s*$/) 0 0 0
Condition0%0/3
@lines > 0 and $lines[0] =~ /^\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
@lines > 0 and $lines[0] =~ /^\s*$/
@lines > 0 $lines[0] =~ /^\s*$/
Truth table0%0/3
A and B
A= @lines > 0B= $lines[0] =~ /^\s*$/
ABresult
0X0
100
111
28 0 shift @lines;
29 }
30 0 $creator->body( join( "\n", @lines) );
31  
32 0 return $creator->finalize();
33 }
34  
35 1 1;
36 __END__
↑ Summary blib/lib/Email/MIME/MobileJP/Parser.pm »