Branch Coverage

blib/lib/Mail/Box.pm
Criterion Covered Total %
branch 150 232 64.6


line true false branch
41 0 84 if ($class eq "Mail::Box")
54 1 83 unless my $self = $class->SUPER::new(@_, "init_options", \%args)
60 63 20 if $self->{'MB_access'} =~ /r|a/
68 0 84 unless defined $self->SUPER::init($args)
72 0 84 unless ($foldername)
82 0 84 defined $args->{'remove_when_empty'} ? :
85 8 76 defined $args->{'save_on_exit'} ? :
96 0 50 !defined($folderdir) ? :
34 50 substr($foldername, 0, 1) eq '=' ? :
0 84 exists $args->{'trusted'} ? :
100 39 45 if (exists $args->{'manager'})
128 18 0 if defined $size
129 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' ? :
154 84 112 if @_
198 0 142 unless my $message = shift()
201 0 142 if $message->can("folder") and defined $message->folder
210 142 0 unless ($coerced->head->isDelayed)
214 142 0 unless ($self->{'MB_keep_dups'})
215 5 137 if (my $found = $self->messageId($msgid))
240 4 0 exists $args{'subfolders'} ? :
243 0 0 $can_recurse ? :
2 0 !$subfolders ? :
1 2 $subfolders eq 'RECURSE' ? :
1 3 $subfolders eq 'FLATTEN' ? :
261 0 10 unless $to->writable
270 87 0 if ($msg->copyTo($to, 'share', $share)) { }
271 0 87 if $delete
275 2 8 unless $flatten or $recurse
282 0 6 unless defined $subfolder
285 3 3 if ($flatten) { }
286 0 3 unless ($subfolder->_copy_to($to, @options))
293 0 3 unless ($subto)
298 0 3 unless ($subfolder->_copy_to($subto, @options))
318 2 88 if $self->{'MB_is_closed'}
324 34 54 if defined $manager and not $args{'close_by_manager'}
328 27 0 $_ eq 'NEVER' ? :
1 27 $_ eq 'ALWAYS' ? :
60 28 $_ eq 'MODIFIED' ? :
335 2 20 if ($write and not $force and not $self->writable)
338 2 0 if $locker
349 81 5 if $locker
357 0 21 exists $args{'recursive'} ? :
360 0 21 unless ($self->writable)
367 21 0 if ($recurse)
371 14 0 if defined $sub
397 4 38 unless @_
400 8 30 if $self->{'MB_modified'} = shift()
410 22 63 if $self->{'MB_modified'}
413 21 1492 if $_->isDeleted or $_->isModified
425 0 541 @_ ? :
432 2 2022 if ($msgid =~ /\<([^>]+)\>/s)
436 0 2 unless index($msgid, "\@") >= 0
440 287 1737 unless @_
445 55 1682 unless ($message)
451 0 1682 if (defined $double and not $self->{'MB_keep_dups'})
462 0 0 if $subj1 eq $subj2 and $to1 eq $to2
481 0 1 if ($msgid =~ /\<([^>]*)\>/s) { }
491 1 0 unless exists $msgids->{$msgid}
500 460 14 unless @_
503 2 12 if (@_ == 2)
505 0 2 if $begin < 0
506 0 2 if $begin < 0
507 0 2 if $end < 0
508 0 2 if $end >= $nr
510 0 2 if $begin > $end
523 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' ? :
540 1 1 unless (@_)
542 0 1 if exists $self->{'MB_current'}
557 1 0 if (my $previous = $self->{'MB_current'})
570 0 2 ref $msgids ? :
571 0 2 unless keys %search
574 0 2 unless my $nr_messages = $self->messages
577 1 1 defined $startid ? :
581 1 1 if ($window ne "ALL" and defined $startmsg)
583 0 1 if $bound < 0
587 0 2 if defined $bound and $bound > $last
590 0 0 !$startmsg ? :
1 0 $moment =~ /^\d+$/ ? :
1 1 $moment eq 'EVER' ? :
599 0 82 if (delete $search{$msgid})
600 0 0 unless keys %search
603 1 81 if $message->timestamp < $after
615 1 0 if (not defined $set or $set) { }
617 0 1 defined $msgs ? :
621 0 0 defined $msgs ? :
636 19 8 $self->{'MB_manager'} ? :
650 4 0 ref $thing ? :
0 4 @_ ? :
651 4 0 defined $parent ? :
675 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'}, @_)
677 0 63 if ($self->{'MB_modified'})
691 0 31 unless ($args{'force'} or $self->writable)
697 0 31 if ($args{'save_deleted'}) { }
702 28 936 if ($_->isDeleted) { }
710 1 30 unless (@destroy or $self->isModified)
716 0 30 unless ($self->writeMessages(\%args))
734 612 1014 if $self->{'MB_lazy_permitted'} and not $message->isPart and not $self->{'MB_extract'}->($self, $head)
737 1044 0 ref $bodytype ? :
743 440 0 defined $size ? :
765 0 0 unless @_
768 0 0 if exists $seps{$sep}
783 0 142 $message->isa($mmtype) ? :
803 1104 578 unless my $manager = $self->{'MB_manager'}
814 55 0 unless my $manager = $self->{'MB_manager'}
825 3 0 if ($_[1] =~ /^\s*(\d+\.?\d*|\.\d+)\s*(hour|day|week)s?\s*$/) { }
826 3 0 $2 eq 'day' ? :
0 3 $2 eq 'hour' ? :
841 20 68 unless &in_global_destruction() or $self->{'MB_is_closed'}