Branch Coverage

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


line true false branch
49 40 0 if (eval { do { require Encode } })
52 0 40 if (eval { do { require Encode::Detect::Detector } })
110 0 255 unless defined $re and $re ne ''
112 0 255 unless defined $onlyleaves
115 0 255 if (defined $recursive and $recursive == 0)
126 269 17 if ($part->{'type'} =~ /$re/ and !$onlyleaves || $amialeaf)
130 18 0 if (not $amialeaf and !defined($depth) || $depth > 0)
131 0 18 if defined $depth
164 0 5970 unless defined $rawkey
173 898 5072 if (@_)
175 0 898 unless defined $raw_value
178 824 74 unless (exists $self->{'headers'}{$key})
194 4763 309 if (wantarray) { }
195 3756 1007 unless exists $self->{'headers'}{$key}
199 263 46 unless exists $self->{'headers'}{$key}
229 493 0 if (wantarray) { }
230 365 128 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 144 108 unless (exists $self->{'decoded'})
312 0 144 unless exists $self->{'raw'}
317 4 140 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 138 if ($encoding eq 'quoted-printable') { }
5 133 elsif ($encoding eq 'base64') { }
345 0 5 if ($bytes) { }
353 1 4 if ($self->{'type'} =~ m[^(?:text|message)\b/]i)
359 31 102 if ($encoding) { }
369 248 4 if (not defined $bytes or $bytes)
370 248 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) | ISO646-US )\z/six)
476 8 2 if (not $cnt_8bits and $charset_declared =~ /^(?: ISO[ -]?8859 (?: - \d{1,2} )? | Windows-\d{4} | UTF-?8 | (KOI8|EUC)-[A-Z]{1,2} | Big5 | GBK | GB[ -]?18030 (?:-20\d\d)? )\z/six)
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 { do { $rv = $enc_utf8->decode($_[0], 9); defined $rv } }) { }
0 2 elsif ($charset_declared =~ /^(?:US-)?ASCII\z/i) { }
491 0 0 if (eval { do { $rv = $enc_utf8->decode($_[0], 9); defined $rv } }) { }
493 0 0 unless $return_decoded
498 0 0 if ($@)
511 0 0 if (eval { do { $rv = $decoder->decode($_[0], 9); defined $rv } }) { }
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 125 16 unless (exists $self->{'rendered'})
694 0 125 unless $self->{'type'} =~ m[^text/(?:plain|html)$]i
700 7 118 if ($text ne '' and $self->{'type'} =~ m[^text/html$]i) { }
706 0 7 if ($self->{'normalize'} and $enc_utf8) { }
6 1 elsif (not defined $self->{'charset'} or $self->{'charset'} =~ /^(?:US-ASCII|UTF-8)\z/i) { }
744 7 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 848 unless defined $header_field_body and $header_field_body ne ''
887 333 515 if ($header_field_name =~ /^ (?: Received | (?:Resent-)? (?: Message-ID | Date ) | MIME-Version | References | In-Reply-To | List-.* ) \z /six) { }
945 0 4405 if ($raw) { }
946 0 0 if (@hdrs = $self->raw_header($hdr))
951 844 3561 if (@hdrs = $self->header($hdr))
956 3856 549 if (wantarray) { }
960 131 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 ? :