Branch Coverage

blib/lib/AnyEvent/RipeRedis/Cluster.pm
Criterion Covered Total %
branch 99 140 70.7


line true false branch
95 1 9 unless (defined $params{'startup_nodes'})
98 1 8 unless (ref $params{'startup_nodes'} eq 'ARRAY')
101 1 7 unless (@{$params{'startup_nodes'};})
119 32 3 unless defined $params{$name}
128 4 1 unless ($self->{'lazy'})
162 0 4 unless defined $self->{'_slots'}
165 2 2 if (defined $key)
171 0 4 unless defined $nodes
175 4 0 wantarray ? :
181 11 3 if (@_)
184 7 4 if (defined $seconds) { }
185 4 3 if (not &looks_like_number($seconds) or $seconds < 0)
201 7 3 if (@_)
204 2 5 if (defined $on_error) { }
221 0 12 unless (utf8::downgrade($data, 1))
237 2 9 if ($hashtag =~ /\{([^}]*?)\}/)
238 1 1 if (length $1 > 0)
258 0 2 if (defined $err)
272 2 0 if ($self->{'refresh_interval'} > 0)
293 0 4 if (defined $self->{'_slots'}) { }
302 12 0 unless (defined $nodes_pool{$hostport})
321 0 2 if (defined $err)
334 0 2 if (defined $err)
339 0 2 unless (@{$slots;})
349 2 0 unless (defined $self->{'_commands'})
391 14 6 unless (defined $nodes_pool{$hostport})
392 6 8 if (defined $nodes_pool_old->{$hostport}) { }
399 8 6 if (++$node_cnt > 1) { }
424 2 0 if ($self->{'allow_slaves'} and @slave_nodes)
446 6 2 if --$reply_cnt > 0
474 0 2 if (defined $err)
484 0 10 if exists $commands{$kwd}
488 4 12 if ($flag eq 'readonly')
535 0 0 if (defined $self->{'on_node_connect'})
549 0 0 if (defined $self->{'on_node_disconnect'})
565 0 0 if (defined $self->{'on_node_error'})
579 1 8 if (ref $args->[-1] eq 'HASH') { }
584 7 1 if (ref $args->[-1] eq 'CODE')
585 0 7 if (exists $SUB_CMDS{$cmd_name}) { }
595 0 9 $cmd_name eq 'eval_cached' ? :
606 1 8 unless (defined $cmd->{'on_reply'})
610 1 0 if (defined $err)
624 2 9 unless ($self->{'_ready'})
625 0 2 if ($self->{'_init_state'} == 1)
638 8 1 if (defined $cmd_info)
639 7 1 if ($cmd_info->{'key_pos'} > 0) { }
0 2 elsif ($cmd_info->{'movablekeys'} and $args->[1] > 0) { }
653 7 2 if (defined $key)
660 0 9 unless (defined $nodes)
682 4 25 defined $node_index ? :
693 4 25 $cmd->{'name'} eq 'cluster_state' ? :
702 2 25 if ($cmd->{'name'} eq 'cluster_state')
703 2 0 unless (defined $err)
704 2 0 if ($reply->{'cluster_state'} eq 'ok') { }
714 8 19 if (defined $err)
718 0 8 if ($err_code == 26 or $err_code == 25)
719 0 0 if ($err_code == 26)
726 0 0 unless (defined $nodes_pool->{$fwd_hostport})
737 4 4 if (defined $on_node_error)
742 4 4 if ($err_code != 5 and ++$fails_cnt < scalar @{$nodes;})
759 0 29 defined $cmd->{'on_message'} ? :
771 9 6 if (defined $slot)
773 0 9 $slot < $_->[0] ? :
9 9 $slot > $_->[1] ? :
777 0 9 unless defined $range
779 6 3 $allow_slaves ? :
786 5 1 $allow_slaves ? :
826 0 0 if (not defined $err and @queued_commands)
831 0 0 if (defined $err)
886 3 5 if (defined $self->{'_input_queue'})