Branch Coverage

blib/lib/Redis/ClusterRider.pm
Criterion Covered Total %
branch 87 110 79.0


line true false branch
78 1 11 unless (defined $params{'startup_nodes'})
81 1 10 unless (ref $params{'startup_nodes'} eq "ARRAY")
84 1 9 unless (@{$params{'startup_nodes'};})
88 0 9 if ($params{'fallback'})
89 0 0 if ($params{'lazy'})
94 0 0 unless eval { do { $node->cluster_info; 1 } }
109 43 6 unless defined $params{$name}
121 5 2 unless ($self->{'lazy'})
140 0 4 unless (defined $self->{'_slots'})
145 2 2 if (defined $key)
153 4 0 wantarray ? :
159 13 3 if (@_)
162 10 3 if (defined $seconds) { }
163 4 6 if (not &looks_like_number($seconds) or $seconds < 0)
179 0 11 unless (utf8::downgrade($data, 1))
197 1 9 if ($key =~ /\{([^}]*?)\}/)
198 1 0 if (length $1 > 0)
211 6 1 if ($self->{'refresh_interval'} > 0)
223 1 6 if (defined $self->{'_slots'}) { }
230 18 0 unless (defined $nodes_pool{$hostport})
242 0 7 unless (@{$slots;})
248 6 1 unless (defined $self->{'_commands'})
275 49 21 unless (defined $nodes_pool{$hostport})
276 25 24 if (defined $nodes_pool_old->{$hostport}) { }
283 21 28 if ($is_master)
316 0 30 if exists $commands{$kwd}
320 12 36 if ($flag eq "readonly")
361 14 29 if ($self->{'allow_slaves'})
365 0 43 if (defined $self->{'on_node_connect'})
376 1 9 if (not defined $self->{'_slots'} or $self->{'refresh_interval'} > 0 and Time::HiRes::tv_interval($self->{'_refresh_timestamp'}) > $self->{'refresh_interval'})
388 8 2 if (defined $cmd_info)
389 7 1 if ($cmd_info->{'key_pos'} > 0) { }
0 2 elsif ($cmd_info->{'movablekeys'} and $args->[1] > 0) { }
403 7 3 if (defined $key)
410 0 10 unless (defined $nodes)
430 7 24 $cmd_name eq 'cluster_state' ? :
447 7 25 if ($cmd_name eq 'cluster_state') { }
1 24 elsif ($wantarray) { }
452 7 0 if ($reply->{'cluster_state'} eq 'ok') { }
467 3 29 if ($@)
472 3 29 if ($err_msg)
474 3 0 if ($err_msg =~ /^(?:\[\w+\]\s+)?([A-Z]{3,})/)
478 1 2 if ($err_code eq "MOVED" or $err_code eq "ASK")
479 1 0 if ($err_code eq "MOVED")
486 1 0 unless (defined $nodes_pool->{$fwd_hostport})
493 0 2 if (defined $self->{'on_node_error'})
497 1 1 if (++$fails_cnt < $nodes_num)
498 1 0 if (++$node_index == $nodes_num)
508 1 28 $wantarray ? :
517 9 12 if (defined $slot)
519 0 9 $slot < $_->[0] ? :
9 9 $slot > $_->[1] ? :
523 0 9 unless defined $range
525 5 4 $allow_slaves ? :
532 6 6 $allow_slaves ? :