Branch Coverage

blib/lib/Mail/Mbox/MessageParser.pm
Criterion Covered Total %
branch 104 190 54.7


line true false branch
43 5749 0 unless $Mail::Mbox::MessageParser::_DEBUG
65 0 404 unless defined $options->{'file_name'} or defined $options->{'file_handle'}
68 0 404 unless (defined $options->{'file_name'})
75 0 404 if defined $options->{'debug'}
82 0 0 if (defined $error and not $error eq 'Not a mailbox' && $options->{'force_processing'} and not $error =~ /Found a mix of unix and Windows line endings/ && $options->{'force_processing'})
89 0 0 if $error eq 'Not a mailbox' or $error =~ /Found a mix of unix and Windows line endings/
95 81 311 if _IS_COMPRESSED_TYPE($file_type)
97 0 392 unless defined $options->{'enable_cache'}
98 0 392 unless defined $options->{'enable_grep'}
102 257 135 if ($options->{'enable_cache'})
106 0 257 unless (ref $self)
112 257 0 if ($Mail::Mbox::MessageParser::UPDATING_CACHE)
120 15 377 if (not defined $self and $options->{'enable_grep'})
124 15 0 unless (ref $self)
126 15 0 if ($self =~ /not installed/) { }
138 392 0 unless (defined $self)
142 0 392 unless ref $self
146 0 392 unless defined $self
180 24 368 if $self->{'need_to_close_filehandle'}
198 380 24 if (defined $file_handle) { }
201 267 113 unless UNIVERSAL::isa($file_handle, 'FileHandle::Unget')
210 90 290 if (_IS_COMPRESSED_TYPE($file_type)) { }
215 0 78 unless defined $decompressed_file_handle
218 0 78 if _GET_FILE_TYPE(\$decompressed_file_handle) ne 'mailbox'
232 0 290 if not eof $file_handle and $file_type ne 'mailbox'
246 0 24 unless defined $opened_file_handle
252 3 21 if (_IS_COMPRESSED_TYPE($file_type)) { }
254 0 3 if _GET_FILE_TYPE(\$opened_file_handle) ne 'mailbox'
261 0 21 if $file_type ne 'mailbox'
281 21 3 unless (_IS_COMPRESSED_TYPE($file_type))
284 0 21 unless defined $file_handle
295 0 3 unless defined $Mail::Mbox::MessageParser::Config{'programs'}{$file_type}
302 0 3 unless open $oldstderr, '>&STDERR'
303 0 3 unless open STDERR, '>' . 'File::Spec'->devnull
308 0 3 unless defined $file_handle
313 0 3 unless open STDERR, '>&', $oldstderr
315 0 3 if (eof $file_handle)
336 24 461 if (ref $file_name_or_handle_ref eq 'SCALAR') { }
339 0 24 unless defined $temp
359 0 499 unless defined $readResult and $readResult != 0
361 93 406 if _IS_BINARY_MAILBOX(\$test_chars)
363 0 406 if (CORE::length $test_chars > $Mail::Mbox::MessageParser::Config{'max_testchar_buffer_size'})
366 0 0 if (index($test_chars, "\n\n") == -1 and index($test_chars, "\r\n\r\n") == -1)
377 24 461 if ($need_to_close_filehandle) { }
386 0 485 unless defined $readResult and $readResult != 0
389 392 93 unless (_IS_BINARY_MAILBOX(\$test_chars))
391 392 0 if _IS_MAILBOX(\$test_chars)
396 47 46 if substr($test_chars, 0, 3) eq 'BZh'
397 0 46 if substr($test_chars, 0, 2) eq 'BZ'
398 15 31 if substr($test_chars, 1, 4) eq '7zXZ'
399 0 31 if substr($test_chars, 0, 4) eq 'LZIP'
402 31 0 if ord substr($test_chars, 0, 1) == 31 and ord substr($test_chars, 1, 1) == 139
404 0 0 if ord substr($test_chars, 0, 1) == 31 and ord substr($test_chars, 1, 1) == 157
422 0 392 if (ref $file_name_or_handle_ref eq 'SCALAR') { }
425 0 0 unless defined $temp
445 0 392 unless defined $readResult and $readResult != 0
447 0 392 if _IS_BINARY_MAILBOX(\$test_chars)
449 0 392 if (CORE::length $test_chars > $Mail::Mbox::MessageParser::Config{'max_testchar_buffer_size'})
452 0 0 if (index($test_chars, "\n") == -1 and index($test_chars, "\r\n") == -1)
463 0 392 if ($need_to_close_filehandle) { }
472 0 392 unless defined $readResult and $readResult != 0
474 0 392 if _IS_BINARY_MAILBOX(\$test_chars)
493 32 360 if ($windows_count > 0 and $unix_count == 0) { }
360 0 elsif ($windows_count == 0 and $unix_count > 0) { }
503 0 0 $windows_count > $unix_count ? :
0 0 $windows_count > $unix_count ? :
533 0 90 unless pipe $parent, $child
536 0 90 unless defined $pid
538 78 12 if ($pid) { }
545 0 12 unless open STDOUT, '>&=' . fileno($child)
559 0 0 unless defined $Mail::Mbox::MessageParser::Config{'programs'}{$file_type}
593 0 90 unless defined $Mail::Mbox::MessageParser::Config{'programs'}{$file_type}
603 0 90 unless (defined $pid)
614 12 78 unless ($pid)
616 0 12 unless open my $front_of_pipe, "|$filter_command 2>" . 'File::Spec'->devnull
623 0 12 unless $file_handle->close
647 0 90 if ($^O eq 'MSWin32') { }
678 356 1412 if ($data_length == -1)
691 228 1540 if $data_length == -1
710 392 0 if ($$test_characters =~ /$Mail::Mbox::MessageParser::Config{'from_pattern'}/im and $$test_characters =~ /^(Received[ :]|Date:|Subject:|X-Status:|Status:|To:)/ms) { }
727 0 40 if (_IS_A_PIPE($self->{'file_handle'})) { }
775 392 0 unless $Mail::Mbox::MessageParser::_DEBUG
784 0 0 if (defined $value) { }
786 0 0 unless ref \$value eq 'SCALAR'
806 0 0 if eof $self->{'file_handle'}
863 1381 883 if ($Mail::Mbox::MessageParser::UPDATING_CACHE)
882 253 1128 if ($self->end_of_file)
910 0 60 unless ref $email_header
914 0 60 if $] >= 5.006 and $] < 5.008
916 0 60 if ($header_name =~ /^From$/i and $$email_header =~ /^((?:From\s|X-From-Line:|X-Draft-From:).*$endline(\s.*$endline)*)/im)
919 0 0 wantarray ? :
924 30 30 if (@matches)
926 0 30 wantarray ? :
929 0 30 if (lc $header_name eq 'from ' and $$email_header =~ /^(From\s.*$endline(\s.*$endline)*)/im)
932 0 0 wantarray ? :