Branch Coverage

blib/lib/Redis/ClusterRider.pm
Criterion Covered Total %
branch 86 104 82.6


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'};})
100 43 6 unless defined $params{$name}
112 5 2 unless ($self->{'lazy'})
131 0 4 unless (defined $self->{'_slots'})
136 2 2 if (defined $key)
144 4 0 wantarray ? :
150 13 3 if (@_)
153 10 3 if (defined $seconds) { }
154 4 6 if (not &looks_like_number($seconds) or $seconds < 0)
170 0 11 unless (utf8::downgrade($data, 1))
188 1 9 if ($key =~ /\{([^}]*?)\}/)
189 1 0 if (length $1 > 0)
202 6 1 if ($self->{'refresh_interval'} > 0)
214 1 6 if (defined $self->{'_slots'}) { }
221 18 0 unless (defined $nodes_pool{$hostport})
233 0 7 unless (@{$slots;})
239 6 1 unless (defined $self->{'_commands'})
266 49 21 unless (defined $nodes_pool{$hostport})
267 25 24 if (defined $nodes_pool_old->{$hostport}) { }
274 21 28 if ($is_master)
307 0 30 if exists $commands{$kwd}
311 12 36 if ($flag eq 'readonly')
352 14 29 if ($self->{'allow_slaves'})
356 0 43 if (defined $self->{'on_node_connect'})
367 1 9 if (not defined $self->{'_slots'} or $self->{'refresh_interval'} > 0 and Time::HiRes::tv_interval($self->{'_refresh_timestamp'}) > $self->{'refresh_interval'})
379 8 2 if (defined $cmd_info)
380 7 1 if ($cmd_info->{'key_pos'} > 0) { }
0 2 elsif ($cmd_info->{'movablekeys'} and $args->[1] > 0) { }
394 7 3 if (defined $key)
401 0 10 unless (defined $nodes)
421 7 24 $cmd_name eq 'cluster_state' ? :
438 7 25 if ($cmd_name eq 'cluster_state') { }
1 24 elsif ($wantarray) { }
443 7 0 if ($reply->{'cluster_state'} eq 'ok') { }
458 3 29 if ($@)
463 3 29 if ($err_msg)
465 3 0 if ($err_msg =~ /^(?:\[\w+\]\s+)?([A-Z]{3,})/)
469 1 2 if ($err_code eq 'MOVED' or $err_code eq 'ASK')
470 1 0 if ($err_code eq 'MOVED')
477 1 0 unless (defined $nodes_pool->{$fwd_hostport})
484 0 2 if (defined $self->{'on_node_error'})
488 1 1 if (++$fails_cnt < $nodes_num)
489 0 1 if (++$node_index == $nodes_num)
499 1 28 $wantarray ? :
508 9 12 if (defined $slot)
510 0 9 $slot < $_->[0] ? :
9 9 $slot > $_->[1] ? :
514 0 9 unless defined $range
516 5 4 $allow_slaves ? :
523 6 6 $allow_slaves ? :