Branch Coverage

blib/lib/Sphinx/Search.pm
Criterion Covered Total %
branch 23 410 5.6


line true false branch
227 22 0 $is_native64 ? :
236 9 0 $is_native64 ? :
258 9 0 if $is_native64
275 6 5 $h & 2147483648 ? :
278 11 0 if ($is_native64)
279 6 5 if $neg
284 0 0 if ($neg)
291 0 0 if $neg
299 3 0 if ($on) { }
401 1 0 if $legal_opts{$opt}
404 3 0 unless $self->{'_log'}
418 0 2 if $self->{'_log'} and defined $msg
445 0 0 if $self->{'_log'} and defined $msg
515 0 0 $encoder ? :
516 0 0 $decoder ? :
542 0 0 unless defined $host
543 0 0 if (substr($host, 0, 1) eq '/') { }
0 0 elsif (substr($host, 0, 7) eq 'unix://') { }
553 0 0 unless $port =~ /^\d+/o
555 0 0 if $port < 0 or $port >= 65536
558 0 0 $port == 0 ? :
578 0 1 unless $timeout =~ /$num_re/
596 0 0 unless $retries =~ /$num_re/
607 0 0 if $self->{'_debug'}
608 0 0 unless (send $fp, $data, 0)
611 0 0 if ($self->{'_socket'})
627 0 1 if ($self->{'_socket'})
629 0 0 if $self->{'_socket'}->connected
635 0 1 $self->{'_path'} ? :
636 0 1 if $debug
643 1 0 if $self->{'_timeout'}
644 0 1 if ($self->{'_path'}) { }
656 1 0 unless ($fp)
665 0 0 unless ($fp->read($buf, 4))
672 0 0 if $debug
673 0 0 if ($v < 1)
679 0 0 if $debug
682 0 0 unless ($self->_Send($fp, "\000\000\000\cA"))
687 0 0 if $debug
689 0 0 if ($self->{'_persistent'})
691 0 0 unless ($self->_Send($fp, $req))
714 0 0 if (not defined $resp or $resp == 0)
722 0 0 unless (defined $len)
731 0 0 if ($rlen < 0)
737 0 0 if $lentotal >= $len
739 0 0 unless $self->{'_socket'}
742 0 0 if (length $response != $len)
743 0 0 $len ? :
750 0 0 if ($status == 3)
755 0 0 if ($status == 1)
759 0 0 if ($status == 2)
763 0 0 if ($status != 0)
769 0 0 if ($ver < $client_ver)
781 0 0 unless $req
785 0 0 unless ($fp)
786 0 0 if $self->IsConnectError
789 0 0 unless $self->_Send($fp, $req)
791 0 0 if $response
793 0 0 if $self->IsConnectError
814 0 0 unless $offset =~ /^\d+$/ and $offset >= 0
815 0 0 unless $limit =~ /^\d+$/ and $limit >= 0
818 0 0 if ($max > 0)
840 0 0 unless $max =~ /^\d+$/ and $max >= 0
888 0 0 unless defined $mode
889 0 0 unless $mode == 0 or $mode == 1 or $mode == 2 or $mode == 3 or $mode == 4 or $mode == 5 or $mode == 6
953 0 0 unless $ranker == 0 or $ranker >= 1 and $ranker < 9
1001 0 0 unless defined $mode
1002 0 0 unless $mode == 0 or $mode == 1 or $mode == 2 or $mode == 3 or $mode == 4 or $mode == 5
1009 0 0 unless $mode == 0 or length $sortby
1035 0 0 unless ref $weights eq 'ARRAY'
1037 0 0 unless $weight =~ /^\d+$/
1061 0 0 unless ref $weights eq 'HASH'
1063 0 0 unless $weights->{$field} =~ /^\d+$/
1082 0 0 unless ref $weights eq 'HASH'
1084 0 0 unless $weights->{$_} =~ /^\d+$/
1107 0 0 unless $min =~ /$num_re/
1108 0 0 unless $max =~ /$num_re/
1109 0 0 unless $min < $max
1135 0 1 unless defined $attribute
1136 0 1 unless ref $values eq 'ARRAY'
1137 0 1 unless scalar @$values
1139 0 1 $exclude ? :
1161 0 0 unless defined $attribute
1162 0 0 unless $value and not ref $value
1164 0 0 $exclude ? :
1191 0 0 unless defined $attribute
1192 0 0 unless $min =~ /$num_re/
1193 0 0 unless $max =~ /$num_re/
1194 0 0 unless $min <= $max
1196 0 0 $exclude ? :
1219 0 0 unless defined $attribute
1220 0 0 unless $min =~ /$num_re/
1221 0 0 unless $max =~ /$num_re/
1222 0 0 unless $min <= $max
1224 0 0 $exclude ? :
1262 0 0 unless defined $attrlat
1263 0 0 unless defined $attrlong
1264 0 0 unless $lat =~ /$num_re/
1265 0 0 unless $long =~ /$num_re/
1363 0 0 unless defined $attribute
1364 0 0 unless $func == 0 or $func == 1 or $func == 2 or $func == 3 or $func == 4 or $func == 5
1389 0 0 unless defined $attribute
1407 0 0 unless $count =~ /^\d+$/o and $count >= 0
1408 0 0 unless $delay =~ /^\d+$/o and $delay >= 0
1433 0 0 unless defined $attrname
1434 0 0 unless $attrtype == 1 or $attrtype == 2 or $attrtype == 4 or $attrtype == 5 or $attrtype == 6
1472 0 0 unless exists $query_flags{$flag_name}
1474 0 0 unless &any(sub { $_ eq $flag_value; } , @{$query_flags{$flag_name};}) or $flag_name eq 'max_predicted_time' and $flag_value =~ /^\d+$/
1477 0 0 if ($flag_name eq 'reverse_scan') { }
0 0 elsif ($flag_name eq 'sort_method') { }
0 0 elsif ($flag_name eq 'max_predicted_time') { }
0 0 elsif ($flag_name eq 'boolean_simplify') { }
0 0 elsif ($flag_name eq 'idf') { }
0 0 elsif ($flag_name eq 'global_idf') { }
1491 0 0 if ($flag_value eq 'normalized' or $flag_value eq 'plain') { }
1514 0 0 unless $orderby and not ref $orderby
1515 0 0 unless $offset =~ /^\d+$/ and $limit =~ /^\d+$/
1658 0 0 unless @{$self->{'_reqs'};} == 0
1661 0 0 unless my $results = $self->RunQueries
1662 0 0 if $results->[0]{'error'}
1663 0 0 if $results->[0]{'warning'}
1664 0 0 if $results->[0]{'status'} and $results->[0]{'status'} == 1
1711 0 0 if ($self->{'_ranker'} == 8)
1730 0 0 if ($t == 0) { }
0 0 elsif ($t == 1) { }
0 0 elsif ($t == 2) { }
0 0 elsif ($t == 3) { }
1755 0 0 if (not defined $self->{'_anchor'}) { }
1785 0 0 unless $id =~ /$num_re/
1787 0 0 unless $v =~ /$num_re/
1789 0 0 if ($entry->{'type'} == 5) { }
0 0 elsif ($entry->{'type'} == 6) { }
1805 0 0 if ($self->{'_predictedtime'} > 0)
1811 0 0 $self->{'_hasouter'} ? :
1848 0 0 unless (@{$self->{'_reqs'};})
1861 0 0 unless $response
1880 0 0 if ($status != 0)
1883 0 0 if ($status == 3) { }
1920 0 0 if ($id64) { }
1929 0 0 if ($attrs{$attr} == 6)
1933 0 0 if ($attrs{$attr} == 5)
1939 0 0 if ($attrs{$attr} == 1073741825) { }
0 0 elsif ($attrs{$attr} == 1073741826) { }
0 0 elsif ($attrs{$attr} == 7) { }
0 0 elsif ($attrs{$attr} == 1001) { }
2009 0 0 unless $response
2020 0 0 if $p == $max
2021 0 0 if $p > $max
2026 0 0 if $packet_len == 0
2031 0 0 if ($packet_len == 5 and $peek_byte == 254) { }
0 0 elsif ($peek_byte == 255) { }
2058 0 0 if (my $e = $@)
2079 0 0 unless ($is_eof)
2102 0 0 if ($row) { }
2117 0 0 if ($is_eof)
2124 0 0 if ($col->{'column_type'} == 254) { }
2140 0 0 if ($prefix < 251)
2143 0 0 if ($prefix == 252)
2147 0 0 if ($prefix == 252)
2152 0 0 if ($prefix == 254)
2165 0 0 if $decode
2273 0 0 unless ref $docs eq 'ARRAY' and defined $index and defined $words and ref $opts eq 'HASH'
2310 0 0 if $opts->{'exact_phrase'}
2311 0 0 if $opts->{'single_passage'}
2312 0 0 if $opts->{'use_boundaries'}
2313 0 0 if $opts->{'weight_order'}
2314 0 0 if $opts->{'query_mode'}
2315 0 0 if $opts->{'force_all_words'}
2316 0 0 if $opts->{'load_files'}
2317 0 0 if $opts->{'allow_empty'}
2318 0 0 if $opts->{'emit_zones'}
2319 0 0 if $opts->{'load_files_scattered'}
2339 0 0 unless $doc
2349 0 0 unless $response
2357 0 0 if ($pos + $len > $rlen)
2413 0 0 unless $response
2428 0 0 $len ? :
2431 0 0 $len ? :
2434 0 0 if ($hits)
2441 0 0 if ($p > $rlen)
2508 0 0 unless defined $index
2509 0 0 unless ref $attrs eq 'ARRAY'
2511 0 0 unless defined $attr
2513 0 0 unless ref $values eq 'HASH'
2517 0 0 unless $id =~ /$num_re/
2518 0 0 unless ref $entry eq 'ARRAY'
2519 0 0 unless @$entry == @$attrs
2521 0 0 if ($mva) { }
2522 0 0 unless ref $v eq 'ARRAY'
2524 0 0 unless $vv =~ /^(\d+)$/o
2528 0 0 unless $v =~ /^(\d+)$/o
2537 0 0 $ignorenonexistent ? :
2539 0 0 $mva ? :
2546 0 0 if ($mva) { }
2566 0 0 unless $response
2590 0 0 if ($self->{'_socket'})
2594 0 0 unless my $fp = $self->_Connect
2612 0 0 unless ($self->{'_socket'})
2638 0 0 $session ? :
2641 0 0 unless $response
2646 0 0 unless $rows and $cols
2652 0 0 $len ? :
2654 0 0 if ($cols <= 2) { }
2674 0 0 unless $response
2677 0 0 if (length $response == 4) { }