Branch Coverage

lib/Sisimai/Lhost/AmazonSES.pm
Criterion Covered Total %
branch 72 94 76.6


line true false branch
30 25 506 if (index($$mbody, '{') == 0) { }
32 0 25 unless exists $mhead->{'x-amz-sns-message-id'}
33 0 25 unless $mhead->{'x-amz-sns-message-id'}
52 20 110 unless length $e
53 20 90 if $e eq "--"
55 15 75 if $foldedline
58 15 75 if (substr($e, -1, 1) eq "!")
71 5 20 if (exists $jsonobject->{'Message'}) { }
80 0 25 if ($@)
85 0 25 unless exists $sespayload->{'notificationType'}
95 15 10 if ($p->{'notificationType'} eq 'Bounce' or $p->{'notificationType'} eq 'Complaint') { }
10 0 elsif ($p->{'notificationType'} eq 'Delivery') { }
103 0 15 unless "Sisimai::RFC5322"->is_emailaddress($e->{'emailAddress'})
106 0 15 if ($v->{'recipient'})
114 10 5 if ($p->{'notificationType'} eq 'Bounce') { }
124 10 0 if ($e->{'diagnosticCode'} =~ /\A(.+?);[ ]*(.+)\z/) { }
134 10 0 if $o->{'reportingMTA'} =~ /\Adsn;[ ](.+)\z/
136 10 0 if (exists $$bouncetype{$o->{'bounceType'}} and exists $$bouncetype{$o->{'bounceType'}}{$o->{'bounceSubType'}})
167 0 10 unless "Sisimai::RFC5322"->is_emailaddress($e)
170 0 10 if ($v->{'recipient'})
190 0 25 unless $recipients
192 25 0 if (exists $p->{'mail'}{'headers'})
197 75 75 unless $e->{'name'} =~ /\A(?:From|To|Subject|Message-ID|Date)\z/
202 25 0 unless ($rfc822head->{'message-id'})
205 25 0 if $p->{'mail'}{'messageId'}
214 36 470 if index($xmail, "Amazon WorkMail") > -1
221 16 454 if $mhead->{'x-aws-outgoing'}
222 113 357 if $mhead->{'x-ses-outgoing'}
223 341 129 unless $match
235 2298 3125 unless ($readcursor)
237 82 2216 if (index($e, $startingof->{'message'}[0]) == 0 or index($e, $startingof->{'message'}[1]) == 0)
243 2216 3125 unless $readcursor & $indicators->{'deliverystatus'}
244 618 2507 unless length $e
246 426 2081 if (my $f = 'Sisimai::RFC1894'->match($e)) { }
248 0 426 unless my $o = "Sisimai::RFC1894"->field($e)
251 82 344 if ($o->[-1] eq 'addr') { }
82 262 elsif ($o->[-1] eq 'code') { }
254 82 0 if ($o->[0] eq 'final-recipient') { }
256 0 82 if ($v->{'recipient'})
275 0 262 unless exists $$fieldtable{$o->[0]}
278 180 82 unless $f == 1
283 2071 10 unless index($p, "Diagnostic-Code:") == 0
284 0 10 unless $e =~ /\A[ \t]+(.+)\z/
291 47 82 unless $recipients
300 22 60 if ($e->{'status'} =~ /\A[45][.][01][.]0\z/)
304 11 11 if $e->{'diagnosis'} =~ /["'](\d[.]\d[.]\d.+)['"]/
310 82 0 unless grep {index($e->{'diagnosis'}, $_) > -1;} @{$$messagesof{$r};}