Branch Coverage

lib/Sisimai/Fact.pm
Criterion Covered Total %
branch 127 148 85.8


line true false branch
62 0 3513 unless ref $argvs eq "HASH"
68 0 3471 unless $mesg1->{'ds'}
69 0 3471 unless $mesg1->{'rfc822'}
79 0 3658 if length $e->{'recipient'} < 5
80 12 3646 if not $argvs->{'delivered'} and index($e->{'status'}, "2.") == 0
81 21 3625 if not $argvs->{'vacation'} and $e->{'reason'} eq "vacation"
108 2093 3379 unless exists $rfc822data->{$f}
109 0 3379 unless $rfc822data->{$f}
121 0 3625 unless $piece->{'addresser'}
127 1898 1727 if $e->{'date'}
132 11315 3185 unless $rfc822data->{$f}
137 1841 1784 if scalar @datevalues < 2
143 3625 0 if ($datestring =~ /\A(.+)[ ]+([-+]\d{4})\z/u)
149 3625 0 if $datestring
158 0 3625 unless defined $piece->{'timestamp'}
163 1675 1950 unless ($piece->{'rhost'})
166 416 1259 if "Sisimai::RFC1123"->is_internethost($ir)
168 1259 416 unless ($piece->{'rhost'})
173 444 1529 if $piece->{'rhost'}
175 418 1111 unless "Sisimai::RFC1123"->is_internethost($cv)
180 286 3339 if $piece->{'lhost'} eq $piece->{'rhost'}
182 1588 2037 unless ($piece->{'lhost'})
187 594 1187 unless "Sisimai::RFC1123"->is_internethost($cv)
194 549 6701 unless length $piece->{$v}
195 0 6701 if (index($piece->{$v}, "\@") != -1)
201 77 6624 if (index($piece->{$v}, " ") != -1)
207 0 77 if "Sisimai::RFC791"->is_ipv4address($w)
210 0 77 if index($piece->{$v}, " ") > 0
212 54 6647 if substr($piece->{$v}, -1, 1) eq "."
220 3093 532 if ('Sisimai::String'->aligned(\$rfc822data->{'message-id'}, ['<', '@', '>'])) { }
232 27 3598 if ('Sisimai::String'->aligned(\$rfc822data->{'list-id'}, ['<', '.', '>'])) { }
247 10 3615 unless length $piece->{'diagnosticcode'}
250 0 3615 if substr($piece->{'diagnosticcode'}, -1, 1) eq "\r"
256 2600 1015 if (length $cr == 3)
260 207 2393 if (index($piece->{'diagnosticcode'}, $cr . '-') != -1)
293 0 207 if (index($piece->{'diagnosticcode'}, $cr) > 1)
304 22 3593 if $p1 > 0 and $p2 > 0
310 0 3625 if $piece->{'reason'} eq "mailererror"
311 3509 116 unless grep {$piece->{'reason'} eq $_;} "feedback", "vacation"
316 0 3625 if substr($piece->{'subject'}, -1, 1) eq "\r"
322 1945 1680 unless "Sisimai::SMTP::Command"->test($piece->{'command'})
323 13 3612 if index($piece->{'diagnosticcode'}, "RCPT first") != -1
356 2949 676 if length $thing->{'alias'} == 0 or $thing->{'recipient'}->address ne $thing->{'alias'}
357 0 676 unless exists $rfc822data->{'received'}
358 73 603 unless scalar @{$rfc822data->{'received'}}
362 302 791 unless index($er, " for ") > 1
365 0 791 if scalar @$or == 0 or length $or->[5] == 0
366 0 791 if "Sisimai::Address"->is_emailaddress($or->[5]) == 0
367 758 33 if $thing->{'recipient'}->address eq $or->[5]
373 643 2982 if $thing->{'alias'} eq $thing->{'recipient'}{'address'}
377 3360 265 if ($thing->{'reason'} eq "" or exists $$retryindex{$thing->{'reason'}})
381 32 3328 if ($cr->is_explicit($or))
382 833 2495 if ($cr->is_explicit($or))
383 2453 42 if ($cr->is_explicit($or))
384 32 10 $thing->{'diagnosticcode'} ? :
390 120 3505 if ($thing->{'reason'} eq 'delivered' or $thing->{'reason'} eq 'feedback' or $thing->{'reason'} eq 'vacation') { }
392 116 4 unless $thing->{'reason'} eq "delivered"
397 10 3495 if length $smtperrors < 4
404 2829 796 if $thing->{'deliverystatus'}
407 10 786 if length $smtperrors < 4
410 517 279 $permanent0 . $temporary0 eq '00' ? :
417 940 2685 if ($cx->[0] ne $cx->[1])
420 10 930 index($cx->[1], $cx->[0]) == 0 ? :
423 1685 1940 unless (exists $$actionlist{$thing->{'action'}})
425 1685 0 if (my $ox = "Sisimai::RFC1894"->field('Action: ' . $thing->{'action'}))
434 4 3621 if $thing->{'reason'} eq "delivered"
435 249 3376 if $thing->{'reason'} eq "expired"
436 3505 120 if $cx->[0] eq 4 or $cx->[0] eq 5
440 2579 1046 if ($thing->{'replycode'} ne "")
443 334 2245 if (scalar @$cv > 0)
444 5 329 if $cv->[0] ne "" and $thing->{'command'} eq ""
445 0 334 if $cv->[1] ne "" and "Sisimai::SMTP::Status"->is_explicit($thing->{'deliverystatus'}) == 0
446 10 324 if $cv->[2] ne "" and "Sisimai::Reason"->is_explicit($thing->{'reason'}) == 0
506 38 1493 unless $type =~ /\A(?:json|yaml)\z/u