Branch Coverage

blib/lib/Net/IMAP/Simple.pm
Criterion Covered Total %
branch 2 324 0.6


line true false branch
32 0 0 $opts{'use_v6'} ? :
33 0 0 $opts{'use_ssl'} ? :
35 0 0 unless ($opts{'shutup_about_v6ssl'})
37 0 0 if $opts{'use_v6'} and $opts{'use_ssl'}
40 0 0 if ($opts{'ssl_version'})
45 0 0 if $opts{'find_ssl_defaults'}
47 0 0 if ($opts{'use_ssl'})
48 0 0 unless eval { do { require IO::Socket::SSL; 'IO::Socket::SSL'->import; 'true' } }
56 0 0 if $opts{'ssl_options'} and not @{$self->{'ssl_options'};}
58 0 0 unless (@{$self->{'ssl_options'};})
59 0 0 if ($opts{'find_ssl_defaults'}) { }
69 0 0 if (-f $_) { }
0 0 elsif (-d $_) { }
81 0 0 if ($nothing)
92 0 0 if ($opts{'use_v6'})
93 0 0 unless eval { do { require IO::Socket::INET6; 'IO::Socket::INET6'->import; 'true' } }
101 0 0 if ($server =~ /cmd:(.+)/) { }
105 0 0 if (($self->{'server'}, $self->{'port'}) = $server =~ /^(\d{1,3}(?:\.\d{1,3}){3})(?::(\d+))?\z/) { }
0 0 elsif (($self->{'server'}, $self->{'port'}) = $server =~ /^\[([a-fA-F0-9:]+)\]:(\d+)\z/) { }
0 0 elsif (($self->{'server'}, $self->{'port'}) = $server =~ /^([a-fA-F0-9:]+)\z/) { }
0 0 elsif (($self->{'server'}, $self->{'port'}) = $server =~ /^([^:]+):(\d+)\z/) { }
118 0 0 unless defined $self->{'port'}
121 0 0 $opts{'timeout'} ? :
122 0 0 defined $opts{'retry'} ? :
123 0 0 defined $opts{'retry_delay'} ? :
133 0 0 if ($sock = $self->{'sock'} = $self->_connect) { }
0 0 elsif ($i < $self->{'retry'}) { }
146 0 0 unless ($c)
152 0 0 unless $sock
156 0 0 if $self->{'debug'}
159 0 0 if ($select->can_read($self->{'timeout'})) { }
160 0 0 if $self->{'debug'}
161 0 0 if (my $line = $sock->getline) { }
165 0 0 if $self->{'debug'}
166 0 0 if $line =~ /^\*\s+(?:OK|PREAUTH)/i
170 0 0 if $line =~ /^\*\s+(?:NO|BAD)(?:\s+(.+))?/i
173 0 0 if $self->{'debug'}
181 0 0 if $self->{'debug'}
184 0 0 unless $greeting_ok
192 0 0 if ($self->{'cmd'}) { }
193 0 0 if $self->{'debug'}
197 0 0 if $self->{'debug'}
205 0 0 $self->{'bindaddr'} ? :
0 0 $_[0]{'ssl_version'} ? :
0 0 $_[0]{'use_ssl'} ? :
209 0 0 if $self->{'debug'}
213 0 0 $_[0]{'use_ssl'} ? :
216 0 0 unless exists $_[0]{'last'}
220 0 0 $_[0]{'use_ssl'} ? :
0 0 $_[0]{'use_v6'} ? :
244 0 0 unless ($startres)
248 0 0 if $self->{'debug'}
284 0 0 if $cb and not @_
285 0 0 unless @_
337 0 0 @_ ? :
350 0 0 if (my($status) = $_[0] =~ /\* STATUS.+?$mbox.+?\((.+?)\)/i)
353 0 0 if $status =~ /$_\s+(\S+|"[^"]+"|'[^']+')/i
366 0 0 $examine_mode ? :
367 0 0 unless exists $self->{'examine_mode'}
369 0 0 unless $mbox
371 0 0 if ($examine_mode == $self->{'examine_mode'})
372 0 0 if ($self->{'use_select_cache'} and time - $self->{'BOXES'}{$mbox}{'proc_time'} <= $self->{'select_cache_ttl'})
379 0 0 $examine_mode ? :
389 0 0 $nm ? :
392 0 0 if ($_[0] =~ /^\*\s+(\d+)\s+EXISTS/i) { }
0 0 elsif ($_[0] =~ /^\*\s+FLAGS\s+\((.*?)\)/i) { }
0 0 elsif ($_[0] =~ /^\*\s+(\d+)\s+RECENT/i) { }
0 0 elsif ($_[0] =~ /^\*\s+OK\s+\[(.*?)\s+(.*?)\]/i) { }
404 0 0 if ($value =~ /\((.*?)\)/) { }
433 0 0 unless $self->{'BOXES'}{$self->current_box}{'flags'}
449 0 0 if (exists $oflags->{'UNSEEN'})
463 0 0 $self->{'working_box'} ? :
503 0 0 if @lines
507 0 0 wantarray ? :
510 0 0 if $_[0] =~ /\*\s+\d+\s+FETCH/i
512 0 0 if (not @lines or $_[0] =~ /^[!-9;-~]+:/) { }
526 0 0 if $self->waserr
527 0 0 if grep {$_ eq '\\Seen';} @flags
535 0 0 if $self->waserr
536 0 0 if grep {$_ eq '\\Deleted';} @flags
543 3 0 /(\d+):(\d+)/ ? :
559 3 0 $e > 0 ? :
576 0 0 if $messages eq '1:0'
580 0 0 $number ? :
582 0 0 if ($_[0] =~ /^\*\s+(\d+).*RFC822.SIZE\s+(\d+)/i)
595 0 0 $uidm ? :
600 0 0 if ($sort)
602 0 0 $uidm ? :
609 0 0 wantarray ? :
610 0 0 if (my($msgs) = $_[0] =~ /^\*\s+(?:SEARCH|SORT)\s+(.*)/i)
637 0 0 if (eval 'use Date::Manip (); 1') { }
638 0 0 if (my $pd = Date::Manip::ParseDate($d))
678 0 0 $part ? :
693 0 0 if ($fetching)
694 0 0 if ($fetching > 0)
702 0 0 if length $message > $fetching
705 0 0 wantarray ? :
708 0 0 if (defined $fetching and $fetching == 0)
720 0 0 if ($_[0] =~ /^\*\s+\d+\s+FETCH\s+\(.+?\{(\d+)\}/) { }
0 0 elsif ($_[0] =~ /^\*\s+\d+\s+FETCH\s+\(.+?\"(.*)\"\s*\)/) { }
0 0 elsif ($fetching) { }
751 0 0 unless defined $msg and defined $mailbox_name
754 0 0 if (ref $msg eq 'ARRAY')
765 0 0 if ($_[0] =~ /^\+\s+/)
766 0 0 if ($size)
768 0 0 if (ref $msg eq 'ARRAY') { }
790 0 0 unless defined $msg and defined $mailbox_name
793 0 0 if (ref $msg eq 'ARRAY')
801 0 0 if $date ne ''
808 0 0 if ($_[0] =~ /^\+\s+/)
809 0 0 if ($size)
811 0 0 if (ref $msg eq 'ARRAY') { }
842 0 0 if $self->{'_waserr'}
843 0 0 wantarray ? :
846 0 0 if ($_[0] =~ /\* $number FETCH \(FLAGS \(([^()]*?)\)\)/i)
864 0 0 if (not $_[0] =~ /^\* \d+ FETCH/)
865 0 0 if defined $buffer
882 0 0 if (not $hq) { }
898 0 0 if $self->{'working_box'}
907 0 0 unless (defined $last)
908 0 0 unless $self->select
919 0 0 unless @flags
932 0 0 unless @flags
967 0 0 if $self->{'debug'}
970 0 0 if ($line =~ /^\*\s+(LIST|LSUB).*\s+\{\d+\}\s*$/i) { }
0 0 elsif ($line =~ /^\*\s+(LIST|LSUB).*\s+(\".*?\")\s*$/i or $line =~ /^\*\s+(LIST|LSUB).*\s+(\S+)\s*$/i) { }
977 0 0 if $self->{'debug'}
991 0 0 unless (defined $box)
1016 0 0 unless (defined $box)
1048 0 0 unless $self->select($box)
1062 0 0 if wantarray
1063 0 0 unless @expunged
1067 0 0 if ($_[0] =~ /^\s*\*\s+(\d+)\s+EXPUNGE[\r\n]*$/i)
1173 0 0 $value ? :
1175 0 0 if $self->{'debug'}
1186 0 0 if $self->{'debug'}
1188 0 0 if ($res =~ /^$id\s+OK/i) { }
0 0 elsif ($res =~ /^$id\s+(?:NO|BAD)(?:\s+(.+))?/i) { }
0 0 elsif ($res =~ /^\*\s+/) { }
1211 0 0 if (defined(my $line = $sock->getline)) { }
1221 0 0 if ($list and not $lines[-1] =~ /\)[\x0d\x0a\s]*$/)
1222 0 0 if $self->{'debug'}
1227 0 0 if (defined(my $line = $sock->getline)) { }
1229 0 0 if $line =~ /\)[\x0d\x0a\s]*$/
1239 0 0 if ($self->{'debug'})
1254 0 0 unless ref $args{'process'} eq 'CODE'
1255 0 0 unless ref $args{'final'} eq 'CODE'
1261 0 0 if $cb
1262 0 0 if $self->{'debug'}
1264 0 0 if ($res =~ /^\*.*\{(\d+)\}[\r\n]*$/) { }
1268 0 0 if $res =~ /\(/
1272 0 0 if $cb
1278 0 0 if (defined $ok and $ok == 1) { }
0 0 elsif (defined $ok and not $ok) { }
1297 0 0 if $self->{'debug'}
1304 0 0 if (@_)
1322 0 0 $flen > $shortness ? :
1326 0 0 if (exists $self->{'debug'} and defined $self->{'debug'})
1328 0 0 if (ref $self->{'debug'} eq 'GLOB') { }
0 0 elsif ($self->{'debug'} eq 'warn') { }
0 0 elsif ($self->{'debug'} =~ /^file:(.+)/) { }
1335 0 0 unless open my $out, '>>', $1