Condition Coverage

blib/lib/Redis/LeaderBoardMulti.pm
Criterion Covered Total %
condition 9 69 13.0


and 3 conditions

line !l l&&!r l&&r condition
472 0 0 0 defined $rank and defined $packed_score
575 2 1 1 $scores[$i + 1] >= 0 and $scores[$i] != 0
1 1 1 $scores[$i + 1] < 0 and $scores[$i] != -1

or 2 conditions

line l !l condition
134 0 0 $scores ||= [1]
166 0 0 $old_scores[$i] || 0
0 0 $scores->[$i] || 0
169 0 0 $old_packed_score || ''
185 0 0 $old_scores[$i] || 0
0 0 $scores->[$i] || 0
205 0 0 $old_scores[$i] || 0
0 0 $scores->[$i] || 0
219 0 0 $scores ||= [1]

or 3 conditions

line l !l&&r !l&&!r condition
25 0 70 0 $self->{'hash_key'} ||= $self->{'key'} . ':score'
67 0 0 0 $self->{'_set_score_hash_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('HGET',KEYS[2],ARGV[1])\nif s then\nredis.call('ZREM',KEYS[1],s..ARGV[1])\nend\nredis.call('ZADD',KEYS[1],0,ARGV[2]..ARGV[1])\nredis.call('HSET',KEYS[2],ARGV[1],ARGV[2])\n")
92 0 0 0 $self->{'_set_score_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('GET',KEYS[2])\nif s then\nredis.call('ZREM',KEYS[1],s..ARGV[1])\nend\nredis.call('ZADD',KEYS[1],0,ARGV[2]..ARGV[1])\nredis.call('SET',KEYS[2],ARGV[2])\n")
144 0 0 0 $self->{'_incr_score_hash_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('HGET',KEYS[2],ARGV[1]) or ''\nif s~=ARGV[3] then\nreturn 0\nend\nif s~='' then\nredis.call('ZREM',KEYS[1],s..ARGV[1])\nend\nredis.call('ZADD',KEYS[1],0,ARGV[2]..ARGV[1])\nredis.call('HSET',KEYS[2],ARGV[1],ARGV[2])\nreturn 1\n")
258 0 0 0 $self->{'_limit_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local k=KEYS[1]\nlocal l=ARGV[1]\nlocal s=redis.call('ZRANGE',k,l,-1)\nif #s==0 then\nreturn\nend\nfor i=1,#s do\ns[i]=string.sub(s[i],ARGV[2])\nend\nredis.call('HDEL',KEYS[2],unpack(s))\nredis.call('ZREMRANGEBYRANK',k,l,-1)\n")
287 0 0 0 $self->{'_limit_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', qq[local k=KEYS[1]\nlocal l=ARGV[1]\nlocal s=redis.call('ZRANGE',k,l,-1)\nif #s==0 then\nreturn\nend\nfor i=1,#s do\ns[i]=k..":"..string.sub(s[i],ARGV[2])\nend\nredis.call('DEL',unpack(s))\nredis.call('ZREMRANGEBYRANK',k,l,-1)\n])
325 0 0 0 $self->{'_remove_hash_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('HGET',KEYS[2],ARGV[1])\nif s then\nredis.call('ZREM',KEYS[1],s..ARGV[1])\nredis.call('HDEL',KEYS[2],ARGV[1])\nend\n")
350 0 0 0 $self->{'_remove_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('GET',KEYS[2])\nif s then\nredis.call('ZREM',KEYS[1],s..ARGV[1])\nredis.call('DEL',KEYS[2])\nend\n")
384 0 0 0 $self->{'_get_sort_order_hash_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('HGET',KEYS[2],ARGV[1])\nreturn redis.call('ZRANK',KEYS[1],s..ARGV[1])\n")
399 0 0 0 $self->{'_get_sort_order_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('GET',KEYS[2])\nreturn redis.call('ZRANK',KEYS[1],s..ARGV[1])\n")
436 0 0 0 $self->{'_get_rank_with_score_hash_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('HGET',KEYS[2],ARGV[1])\nif not s then\nreturn {nil, nil}\nend\nreturn {s,redis.call('ZLEXCOUNT',KEYS[1],'-','('..s)}\n")
454 0 0 0 $self->{'_get_rank_with_score_script'} ||= 'Redis::Script'->new('use_evalsha', $self->{'use_evalsha'}, 'script', "local s=redis.call('GET',KEYS[2])\nif not s then\nreturn {nil, nil}\nend\nreturn {s,redis.call('ZLEXCOUNT',KEYS[1],'-','('..s)}\n")
490 0 0 0 $from || $to
575 1 0 3 $scores[$i + 1] >= 0 and $scores[$i] != 0 or $scores[$i + 1] < 0 and $scores[$i] != -1