Branch Coverage

blib/lib/Mail/Box.pm
Criterion Covered Total %
branch 142 222 63.9


line true false branch
44 0 84 if ($class eq __PACKAGE__)
59 63 20 if $self->{'MB_access'} =~ /r|a/
70 0 84 unless my $foldername = $args->{'folder'} || $ENV{'MAIL'}
76 0 84 exists $args->{'remove_when_empty'} ? :
77 8 76 exists $args->{'save_on_exit'} ? :
87 0 50 !defined($folderdir) ? :
34 50 substr($foldername, 0, 1) eq '=' ? :
0 84 exists $args->{'trusted'} ? :
91 39 45 if (exists $args->{'manager'})
111 18 0 if defined $size
48 2 $extract =~ /\D/ ? :
0 50 $extract eq 'NEVER' ? :
23 50 $extract eq 'LAZY' ? :
11 73 $extract eq 'ALWAYS' ? :
0 84 ref $extract eq 'CODE' ? :
133 84 112 if (@_) { }
181 0 142 unless my $message = shift()
184 0 142 if $message->can("folder") and defined $message->folder
191 142 0 unless ($coerced->head->isDelayed)
195 142 0 unless ($self->{'MB_keep_dups'})
196 5 137 if (my $found = $self->messageId($msgid))
221 4 0 exists $args{'subfolders'} ? :
224 0 0 $can_recurse ? :
2 0 !$subfolders ? :
1 2 $subfolders eq 'RECURSE' ? :
1 3 $subfolders eq 'FLATTEN' ? :
242 0 10 unless $to->writable
250 0 87 unless $msg->copyTo($to, "share", $share)
253 0 87 if $delete
256 2 8 unless $flatten or $recurse
265 3 3 if ($flatten) { }
266 0 3 unless ($subfolder->_copy_to($to, @options))
273 0 3 unless ($subfolder->_copy_to($subto, @options))
293 2 88 if $self->{'MB_is_closed'}
299 34 54 if defined $manager and not $args{'close_by_manager'}
302 29 0 $when eq 'NEVER' ? :
1 29 $when eq 'ALWAYS' ? :
58 30 $when eq 'MODIFIED' ? :
309 0 20 if ($write and not $force and not $self->writable)
311 0 0 if $locker
319 83 5 if $locker
327 0 21 exists $args{'recursive'} ? :
330 0 21 unless ($self->writable)
337 21 0 if ($recurse)
340 14 0 if defined $sub
358 0 252 if (@_) { }
363 4 38 unless @_
366 8 30 if $self->{'MB_modified'} = shift()
376 22 61 if $self->{'MB_modified'}
379 19 1466 if $msg->isDeleted or $msg->isModified
391 0 541 if (@_) { }
398 2 2022 if ($msgid =~ /\<([^>]+)\>/s)
401 0 2 unless index($msgid, "\@") != -1
405 287 1737 unless @_
410 55 1682 unless ($message)
416 0 1682 if (defined $double and not $self->{'MB_keep_dups'})
427 0 0 if $subj1 eq $subj2 and $to1 eq $to2
446 0 1 if ($msgid =~ /\<([^>]*)\>/s) { }
462 464 14 unless @_
464 2 12 if (@_ == 2)
467 0 2 if $begin < 0
468 0 2 if $begin < 0
469 0 2 if $end < 0
470 0 2 if $end >= $nr
471 0 2 $begin > $end ? :
481 0 0 $what =~ s/^\!// ? :
1 0 $what eq 'ALL' ? :
9 1 $what eq 'ACTIVE' ? :
2 10 $what eq 'DELETED' ? :
0 12 ref $what eq 'CODE' ? :
498 1 1 unless (@_)
500 0 1 if exists $self->{'MB_current'}
514 1 0 if (my $previous = $self->{'MB_current'})
527 0 2 ref $msgids ? :
528 0 2 unless keys %search
531 0 2 unless my $nr_messages = $self->messages
534 1 1 defined $startid ? :
538 1 1 if ($window ne "ALL" and defined $startmsg)
540 0 1 if $bound < 0
544 0 2 if defined $bound and $bound > $last
547 0 0 !$startmsg ? :
1 0 $moment =~ /^\d+$/ ? :
1 1 $moment eq 'EVER' ? :
557 0 82 if (delete $search{$msgid})
558 0 0 unless keys %search
561 1 81 if $message->timestamp < $after
575 0 1 defined $msgs ? :
0 0 defined $msgs ? :
1 0 !defined($set) || $set ? :
588 19 8 $self->{'MB_manager'} ? :
602 4 0 ref $thing ? :
0 4 @_ ? :
603 4 0 defined $parent ? :
626 0 63 unless $self->readMessages("trusted", $self->{'MB_trusted'}, "head_type", $self->{'MB_head_type'}, "field_type", $self->{'MB_field_type'}, "message_type", $self->{'MB_message_type'}, "body_delayed_type", $self->{'MB_body_delayed_type'}, "head_delayed_type", $self->{'MB_head_delayed_type'}, @_)
628 0 63 if $self->{'MB_modified'}
636 0 31 unless $args{'force'} or $self->writable
640 0 31 if ($args{'save_deleted'}) { }
645 28 936 if ($msg->isDeleted) { }
653 1 30 unless @destroy or $self->isModified
670 614 1014 if $self->{'MB_lazy_permitted'} and not $message->isPart and not $self->{'MB_extract'}->($self, $head)
673 1044 0 ref $bodytype ? :
679 440 0 defined $size ? :
701 0 0 unless @_
704 0 0 if exists $seps{$sep}
719 0 142 $message->isa($mmtype) ? :
737 1104 578 unless my $manager = $self->{'MB_manager'}
745 55 0 unless my $manager = $self->{'MB_manager'}
754 0 3 unless $_[1] =~ /^\s*(\d+\.?\d*|\.\d+)\s*(hour|day|week)s?\s*$/
757 3 0 $2 eq 'day' ? :
0 3 if ($2 eq 'hour') { }
767 19 69 unless &in_global_destruction() or $self->{'MB_is_closed'}