Branch Coverage

blib/lib/Mail/Box/Manager.pm
Criterion Covered Total %
branch 88 148 59.4


line true false branch
51 0 13 if (exists $args->{'folder_types'})
54 0 0 ref $args->{'folder_types'}[0] ? :
58 0 13 if (my $basic = $args->{'autodetect'})
59 0 0 ref $basic ? :
70 1 12 if (exists $args->{'folderdir'})
72 0 1 if ref $dirs[0] eq "ARRAY"
76 0 13 if (exists $args->{'folderdirs'})
78 0 0 if ref $dirs[0]
102 0 2 unless my $dirs = +(shift())->{'MBM_folderdirs'}
103 0 2 wantarray ? :
118 0 3 if $name =~ /\:\:/
121 3 2 if $def->[0] eq $name or $def->[1] eq $name
132 8 32 @_ % 2 ? :
136 32 0 defined $args{'folder'} ? :
32 8 unless defined $name
139 0 40 if ($name =~ /^(\w+)\:/ and grep(($_ eq $1), $self->folderTypes)) { }
142 0 0 if (keys %decoded) { }
158 14 26 if (not defined $type) { }
0 26 elsif ($type eq 'pop3' or $type eq 'pop') { }
0 26 elsif ($type eq 'pop3s' or $type eq 'pops') { }
0 26 elsif ($type eq 'imap4' or $type eq 'imap') { }
0 26 elsif ($type eq 'imap4s' or $type eq 'imaps') { }
184 0 40 unless (defined $name and length $name)
190 40 0 if $self->{'MBM_folderdirs'}
194 0 40 if ($args{'create'} and not $args{'access'} =~ /w|a/)
201 1 39 if (my $folder = $self->isOpenFolder($name))
211 26 13 if ($type)
216 26 13 if ($type eq $abbrev or $type eq $class)
222 0 26 unless $folder_type
226 13 26 unless ($folder_type)
229 0 29 unless $_
231 4 25 if $require_failed{$class}
234 4 21 if ($@)
239 12 9 if ($class->foundIn($name, @defaults, %args))
246 1 38 unless ($folder_type)
248 1 0 if (my $type = $self->{'MBM_default_type'})
251 1 0 if ($type eq $abbrev or $type eq $class)
259 0 39 unless ($folder_type)
268 0 39 if $require_failed{$class}
270 0 39 if ($@)
278 1 38 unless (defined $folder)
281 1 0 unless $args{'access'} eq "d"
304 0 37 unless $folder
310 1 36 if @{$self->{'MBM_folders'};} == @remaining
316 3 33 unless $options{'close_by_self'}
338 0 0 unless my $folder = $self->open("folder", $name, "access", "d", %args)
349 2 4 wantarray ? :
355 6 0 if not ref $_[0] or $_[0]->isa("Mail::Box")
364 6 0 unless ref $folder
367 3 3 if (ref $folder)
369 0 3 unless ($folder->isa("Mail::Box"))
376 3 0 unless $_->isa("Mail::Box::Message") and $_->folder
391 0 6 if $require_failed{$class}
393 0 6 if ($@)
398 3 3 if ($class->foundIn($folder, @gen_options, "access", "a"))
406 0 3 if (not $found and $type)
409 0 0 if ($type eq $name or $type eq $class)
417 0 3 unless $found
434 42 0 if not ref $_[0] or $_[0]->isa("Mail::Box")
439 0 42 unless $message->isa("Mail::Box::Message")
447 0 42 exists $args{'share'} ? :
450 0 42 unless ref $folder
453 0 42 unless (ref $folder)
455 0 0 if ($args{'_delete'})
463 0 42 if ($msg->folder eq $folder)
468 1 41 if $args{'_delete'}
493 0 2 ref $folders eq 'ARRAY' ? :
1 2 !$folders ? :
499 0 3 unless @folders
503 0 3 if (ref $type) { }
505 0 0 unless $type->isa($base)
513 0 3 if $@
515 0 3 unless $type->isa($base)
544 1 15 unless my($type, $username, $password, $hostname, $port, $path) = $name =~ m[^(\w+)\: # protocol (?:// (?:([^:\@/]*) # username (?:\:([^\@/]*))? # password \@)? ([\w.-]+)? # hostname (?:\:(\d+))? # port number )? (.*) # foldername ]x