Branch Coverage

blib/lib/Mail/SpamAssassin/Message/Node.pm
Criterion Covered Total %
branch 97 212 45.7


line true false branch
49 41 0 if (eval {
52 0 41 if (eval {
110 0 256 unless defined $re and $re ne ""
112 0 256 unless defined $onlyleaves
115 0 256 if (defined $recursive and $recursive == 0)
126 271 18 if ($part->{'type'} =~ /$re/ and !$onlyleaves || $amialeaf)
130 19 0 if (not $amialeaf and !defined($depth) || $depth > 0)
131 0 19 if defined $depth
164 0 5663 unless defined $rawkey
173 909 4754 if (@_)
175 0 909 unless defined $raw_value
178 835 74 unless (exists $self->{'headers'}{$key})
194 4441 313 if (wantarray) { }
195 3439 1002 unless exists $self->{'headers'}{$key}
199 265 48 unless exists $self->{'headers'}{$key}
229 633 0 if (wantarray) { }
230 494 139 unless exists $self->{'raw_headers'}{$key}
234 0 0 unless exists $self->{'raw_headers'}{$key}
280 0 0 if (ref $self->{'raw'} eq "GLOB")
282 0 0 unless seek $fd, 0, 0
287 0 0 unless defined $nread
290 0 0 if $raw_str eq ""
309 146 108 unless (exists $self->{'decoded'})
312 0 146 unless exists $self->{'raw'}
317 4 142 if (ref $self->{'raw'} eq 'GLOB') { }
319 0 4 unless seek $fd, 0, 0
324 0 4 unless defined $nread
326 0 4 if $raw eq ""
335 6 140 if ($encoding eq 'quoted-printable') { }
5 135 elsif ($encoding eq 'base64') { }
345 0 5 if ($bytes) { }
353 1 4 if ($self->{'type'} =~ m[^(?:text|message)\b/]i)
359 33 102 if ($encoding) { }
369 250 4 if (not defined $bytes or $bytes)
370 250 0 if (not defined $bytes) { }
400 0 0 if ($check_char =~ /20 00/)
404 0 0 if ($check_char =~ /00 20/)
411 0 0 if $sum_h_e + $sum_l_e > ($sum_h_o + $sum_l_o) * 4
414 0 0 if ($sum_h_o + $sum_l_o) * 4 > $sum_h_e + $sum_l_e
416 0 0 if ($utf16le_clues > $utf16be_clues) { }
0 0 elsif ($utf16le_clues > $utf16be_clues) { }
435 0 0 if ($_[0] =~ /^(.{0,18}?<(?:body|head|html|img|pre|table|title)(?:\s.{0,18}?)?>)/is)
454 0 10 if utf8::is_utf8($_[0])
460 0 10 if (not defined $charset_declared or $charset_declared eq "")
467 0 10 if (not $cnt_8bits and $charset_declared =~ /^(?: (?:US-)?ASCII | ANSI[_ ]? X3\.4- (?:1986|1968) |
476 8 2 if (not $cnt_8bits and $charset_declared =~ /^(?: ISO[ -]?8859 (?: - \d{1,2} )? | Windows-\d{4} |
489 0 2 if ($charset_declared =~ /^UTF-?8\z/i) { }
0 2 elsif ($charset_declared =~ /^UTF[ -]?16/i) { }
0 2 elsif ($cnt_8bits and eval {
0 2 elsif ($charset_declared =~ /^(?:US-)?ASCII\z/i) { }
491 0 0 if (eval {
493 0 0 unless $return_decoded
498 0 0 if ($@)
511 0 0 if (eval {
513 0 0 unless $return_decoded
518 0 0 if ($@)
528 0 0 unless $return_decoded
554 0 2 if ($charset_declared =~ /^(?: ISO-?8859-1 | Windows-1252 | CP1252 )\z/xi) { }
558 0 2 if (not $decoder and $chset =~ /^GB[ -]?18030(?:-20\d\d)?\z/i)
560 0 0 if $decoder
564 0 2 if (not $decoder) { }
570 0 2 if ($@)
574 2 0 if (lc $chset eq lc $charset_declared) { }
575 2 0 defined $rv ? :
578 0 0 defined $rv ? :
591 0 2 if (not defined $rv || $cnt_8bits) { }
0 2 elsif (not defined $rv and $enc_w1252 and not $_[0] =~ tr/\000-\177\202\204\205\221-\227\231\240\251\255\300-\326\330-\336\340-\366\370-\376/\200\201\203\206-\220\230\232-\237\241-\250\252-\254\256-\277\327\337\367\377/c) { }
607 0 0 if ($@)
612 0 0 defined $rv ? :
620 2 0 if (defined $rv) { }
0 0 elsif (not $have_encode_detector) { }
627 0 0 if ($charset_detected and lc $charset_detected ne lc $charset_declared)
629 0 0 if (not $decoder and $charset_detected =~ /^GB[ -]?18030(?:-20\d\d)?\z/i)
631 0 0 if $decoder
634 0 0 if (not $decoder) { }
640 0 0 if ($@)
644 0 0 defined $rv ? :
651 0 2 unless (defined $rv)
655 0 0 if ($@)
659 0 0 defined $rv ? :
664 0 2 unless (defined $rv)
668 2 0 unless ($return_decoded)
689 127 16 unless (exists $self->{'rendered'})
694 0 127 unless $self->{'type'} =~ m[^text/(?:plain|html)$]i
700 8 119 if ($text ne '' and $self->{'type'} =~ m[^text/html$]i) { }
706 0 8 if ($self->{'normalize'} and $enc_utf8) { }
7 1 elsif (not defined $self->{'charset'} or $self->{'charset'} =~ /^(?:US-ASCII|UTF-8)\z/i) { }
744 8 0 if $text_len
748 0 0 if ($self->{'normalize'} and $enc_utf8)
772 0 0 if not defined $type and defined $text
776 0 0 defined $text ? :
817 11 2 if (exists $self->{'body_parts'})
827 11 34 if (exists $part->{'body_parts'})
857 2 8 if ($cte eq 'B') { }
8 0 elsif ($cte eq 'Q') { }
881 50 859 unless defined $header_field_body and $header_field_body ne ""
887 336 523 if ($header_field_name =~ /^ (?: Received | (?:Resent-)? (?: Message-ID | Date ) |
945 0 4078 if ($raw) { }
946 0 0 if (@hdrs = $self->raw_header($hdr))
951 834 3244 if (@hdrs = $self->header($hdr))
956 3528 550 if (wantarray) { }
960 132 418 @hdrs ? :
1005 0 520 if ($size > 65536)
1014 0 45 if $self->{'truncated_header'}
1016 0 10 if $include_mbox and exists $self->{'mbox_sep'}
1018 16 29 wantarray ? :