Branch Coverage

blib/lib/Cache/Memcached.pm
Criterion Covered Total %
branch 57 272 20.9


line true false branch
68 2 0 unless ref $self
70 2 0 @_ == 1 ? :
112 2 0 if (@{$$self{'servers'};} == 1)
179 1 0 if (my $ipport = $sock_map{$sock})
181 1 0 if $dead_for
194 0 0 if (my $ipport = $sock_map{$sock})
208 0 2 unless defined $timeout
215 2 0 if ($timeout) { }
223 2 0 if (not $ret and $timeout and $! == 115)
228 1 1 if (select(undef, $win, undef, $timeout) > 0)
231 0 1 if not $ret and $! == 106
235 0 2 unless ($timeout)
246 9 0 ref $_[0] ? :
248 6 3 if $cache_sock{$host}
252 3 0 if (defined $ip)
257 1 2 if $host_dead{$host} and $host_dead{$host} > $now
264 2 0 if (index($host, '/') != 0) { }
267 0 2 if ($self and $$self{'pref_ip'}{$ip})
269 0 0 if ($Cache::Memcached::HAVE_SOCKET6 and index($prefip, ':') != -1) { }
281 0 0 if (_connect_sock($sock, $sin, $$self{'connect_timeout'})) { }
284 0 0 if (my $cb = $$self{'cb_connect_fail'})
292 2 0 unless ($connected)
293 0 2 if ($Cache::Memcached::HAVE_SOCKET6 and index($ip, ':') != -1) { }
305 2 0 $self ? :
306 1 1 unless (_connect_sock($sock, $sin, $timeout))
307 1 0 $self ? :
308 0 1 if $cb
316 0 0 $self ? :
317 0 0 unless (_connect_sock($sock, $sin, $timeout))
318 0 0 $self ? :
319 0 0 if $cb
337 2 0 if $$self{'_single_sock'}
338 0 0 unless $$self{'active'}
339 0 0 ref $key ? :
341 0 0 ref $key ? :
346 0 0 if $sock
347 0 0 if $$self{'no_rehash'}
355 0 2 if $$self{'buckets'}
358 0 2 if (ref $v eq 'ARRAY') { }
400 0 7 unless $Cache::Memcached::FLAG_NOSIGNAL
404 21 0 if ($copy_state != $state)
405 7 14 if $state == 2
407 7 7 if $state == 1
408 7 7 if $state == 0
413 0 14 unless $nfound
415 7 7 if (vec $wout, fileno $sock, 1)
418 0 7 if not defined $res and $! == 11
419 0 7 unless ($res > 0)
423 7 0 if ($res == length $line) { }
430 7 7 if (vec $rout, fileno $sock, 1)
433 0 7 if not defined $res and $! == 11
434 0 7 if ($res == 0)
439 7 0 if &$check_complete(\$ret)
443 0 7 unless ($state == 2)
454 0 0 if not $$self{'active'} or $$self{'readonly'}
455 0 0 if $$self{'stat_callback'}
457 0 0 unless $sock
460 0 0 ref $key ? :
461 0 0 $time ? :
465 0 0 if ($$self{'stat_callback'})
498 0 2 if not $$self{'active'} or $$self{'readonly'}
499 0 2 if $$self{'stat_callback'}
501 2 0 unless $sock
505 0 0 $cmdname eq 'append' || $cmdname eq 'prepend' ? :
508 0 0 ref $key ? :
510 0 0 if (ref $val)
511 0 0 if $app_or_prep
516 0 0 unless defined $val
520 0 0 if ($$self{'compress_threshold'} and $Cache::Memcached::HAVE_ZLIB and $$self{'compress_enable'} and $len >= $$self{'compress_threshold'} and not $app_or_prep)
527 0 0 if ($c_len < $len * 0.8)
536 0 0 unless $Cache::Memcached::FLAG_NOSIGNAL
541 0 0 if ($$self{'debug'} and $line)
546 0 0 if ($$self{'stat_callback'})
566 0 0 if not $$self{'active'} or $$self{'readonly'}
567 0 0 if $$self{'stat_callback'}
569 0 0 unless $sock
570 0 0 if ref $key
572 0 0 unless defined $value
577 0 0 if ($$self{'stat_callback'})
582 0 0 unless defined $res and $res =~ /^(\d+)/
592 0 0 ref $key ? :
596 0 0 if &Encode::is_utf8($kval)
603 0 0 unless $$self{'active'}
604 0 0 if $$self{'stat_callback'}
611 0 0 if ($$self{'_single_sock'}) { }
613 0 0 unless ($sock)
617 0 0 ref $key ? :
624 0 0 if ($$self{'buck2sock_generation'} != $socket_cache_generation)
631 0 0 ref $key ? :
645 0 0 if ($sock)
650 0 0 if $tries++ >= 20
661 0 0 unless $Cache::Memcached::FLAG_NOSIGNAL
665 0 0 if ($$self{'debug'})
691 0 0 if $$self{'debug'} >= 2
695 0 0 if (my $p = $parser{$sock})
697 0 0 if $key
700 0 0 if ($$self{'stat_callback'})
713 0 0 unless ref $map
720 0 0 if $Cache::Memcached::HAVE_ZLIB and $flags & 2
722 0 0 if ($flags & 1)
731 0 0 if ($@)
739 0 0 unless my $ipport = $sock_map{$_}
740 0 0 unless my $sock = $cache_sock{$ipport}
741 0 0 if $$self{'debug'} >= 2
743 0 0 if ($$self{'namespace'}) { }
754 0 0 unless my $p = $parser{$sockstr}
756 0 0 if ($rv > 0) { }
0 0 elsif ($rv < 0) { }
772 0 0 if not defined $res and $! == 11
774 0 0 unless ($res > 0)
778 0 0 if ($res == length $buf{$sockstr}) { }
797 0 0 if ($active_changed)
798 0 0 unless %reading or %writing
812 0 0 unless $nfound
819 0 0 if (vec $wout, fileno $_, 1)
820 0 0 if &$write($_)
824 0 0 if (vec $rout, fileno $_, 1)
825 0 0 if &$read($_)
854 6 1 unless scalar @res == 1 and ($res[0] || '') eq "OK\r\n"
864 0 7 unless $sock
870 7 0 if $ret =~ /(?:OK|END|ERROR)\r\n$/
879 0 0 unless $$self{'active'}
880 0 0 unless not ref $types or ref $types eq 'ARRAY'
881 0 0 unless (ref $types)
882 0 0 if (not $types) { }
899 0 0 if (grep /^self$/, @$types)
914 0 0 unless $sock
916 0 0 $typename eq 'misc' ? :
921 0 0 unless ($lines)
935 0 0 if ($typename =~ /^(malloc|sizes|misc)$/) { }
939 0 0 if ($key)
942 0 0 if $typename eq 'misc' and $key and $misc_keys{$key}
944 0 0 if $typename eq 'malloc' and $key
963 0 0 unless $$self{'active'}
967 0 0 unless $sock
969 0 0 unless (defined $ok and $ok eq "RESET\r\n")