Branch Coverage

lib/Redis/CappedCollection.pm
Criterion Covered Total %
branch 0 386 0.0


line true false branch
1512 0 0 unless my $class = &_CLASSISA(shift(), 'Redis::CappedCollection')
1520 0 0 if (&_INSTANCE($redis, 'Redis')) { }
0 0 elsif (&_INSTANCE($redis, 'Test::RedisServer')) { }
0 0 elsif (&_INSTANCE($redis, 'Redis::CappedCollection')) { }
1528 0 0 unless exists $conf->{'server'}
1538 0 0 unless exists $redis->{'reconnect'}
1539 0 0 unless exists $redis->{'every'}
1540 0 0 unless exists $redis->{'conservative_reconnect'}
1541 0 0 unless exists $redis->{'cnx_timeout'}
1542 0 0 unless exists $redis->{'read_timeout'}
1543 0 0 unless exists $redis->{'write_timeout'}
1552 0 0 if ($self->_create_from_naked_new) { }
1555 0 0 if not $self->_create_from_open and $self->collection_exists('name', $self->name)
1560 0 0 if ($self->_check_maxmemory) { }
1562 0 0 unless defined &_NONNEGINT($maxmemory)
1570 0 0 if ($major < 2 or $major == 2 and $minor < 8)
1575 0 0 unless $self->_maxmemory_policy_ok
1579 0 0 if $self->_maxmemory
1587 0 0 unless $self->_create_from_open
1653 0 0 unless my $class = &_CLASSISA(shift(), 'Redis::CappedCollection')
1658 0 0 unless exists $params{'redis'}
1659 0 0 unless exists $params{'name'}
1664 0 0 if (collection_exists('redis', $redis, 'name', $name)) { }
1666 0 0 unless $info->{'data_version'} == $DATA_VERSION
1741 0 0 if scalar @_ == 2 and not defined $timeout || defined $old_timeout
1743 0 0 if (my $redis = $self->_redis)
1744 0 0 unless my $socket = &_INSTANCE($redis->{'sock'}, 'IO::Socket')
1769 0 0 if scalar @_ == 2 and not defined $timeout || defined $old_timeout
1771 0 0 if (my $redis = $self->_redis)
1772 0 0 unless my $socket = &_INSTANCE($redis->{'sock'}, 'IO::Socket')
1776 0 0 if (defined $timeout) { }
1978 0 0 unless defined &_STRING($data) or $data eq ''
1980 0 0 if $list_id =~ /:/
1981 0 0 unless defined &_STRING($data_id)
1982 0 0 unless defined &_NUMBER($data_time) and $data_time > 0
1985 0 0 unless $data_len <= $self->max_datasize
2003 0 0 if (scalar @ret == 4 and exists $ERROR{$error} and defined &_NONNEGINT($_last_cleanup_items)) { }
2004 0 0 if ($error == $E_NO_ERROR) { }
0 0 elsif ($error == $E_COLLECTION_DELETED) { }
0 0 elsif ($error == $E_DATA_ID_EXISTS or $error == $E_OLDER_THAN_ALLOWED) { }
2021 0 0 wantarray ? :
2079 0 0 unless defined &_STRING($data) or $data eq ''
2081 0 0 unless defined &_STRING($data_id)
2084 0 0 if (@_)
2086 0 0 unless defined &_NUMBER($new_data_time) and $new_data_time > 0
2090 0 0 unless $data_len <= $self->max_datasize
2108 0 0 if (scalar @ret == 4 and exists $ERROR{$error} and defined &_NONNEGINT($_last_cleanup_items)) { }
2109 0 0 if ($error == $E_NO_ERROR) { }
0 0 elsif ($error == $E_NONEXISTENT_DATA_ID) { }
0 0 elsif ($error == $E_COLLECTION_DELETED or $error == $E_DATA_ID_EXISTS or $error == $E_OLDER_THAN_ALLOWED) { }
2110 0 0 wantarray ? :
2154 0 0 unless defined &_STRING($data) or $data eq ''
2156 0 0 if $list_id =~ /:/
2157 0 0 unless defined &_STRING($data_id)
2158 0 0 unless not defined $data_time or defined &_NUMBER($data_time) and $data_time > 0
2161 0 0 unless $data_len <= $self->max_datasize
2180 0 0 if (scalar @ret == 4 and exists $ERROR{$error} and defined &_NONNEGINT($cleanings)) { }
2181 0 0 if ($error == $E_NO_ERROR) { }
0 0 elsif ($error == $E_COLLECTION_DELETED) { }
0 0 elsif ($error == $E_DATA_ID_EXISTS or $error == $E_OLDER_THAN_ALLOWED) { }
0 0 elsif ($error == $E_NONEXISTENT_DATA_ID) { }
2200 0 0 wantarray ? :
2255 0 0 unless $self->list_exists($list_id)
2257 0 0 if (defined $data_id and $data_id ne '') { }
2268 0 0 if (wantarray) { }
2269 0 0 defined $data_id ? :
2323 0 0 if (exists $ERROR{$error}) { }
2324 0 0 if $error == $E_COLLECTION_DELETED
2325 0 0 if $error != $E_NO_ERROR
2330 0 0 if ($queue_exist) { }
2473 0 0 if (@_ and &_INSTANCE($_[0], 'Redis::CappedCollection')) { }
2490 0 0 if (exists $ERROR{$error}) { }
2491 0 0 if $error == $E_COLLECTION_DELETED
2492 0 0 if $error != $E_NO_ERROR
2497 0 0 if &_CLASSISA($_[0], 'Redis::CappedCollection')
2502 0 0 unless defined $arguments{'redis'}
2503 0 0 unless defined $arguments{'name'}
2508 0 0 if %arguments
2520 0 0 if (exists $ERROR{$error}) { }
2521 0 0 if $error != $E_NO_ERROR
2529 0 0 unless not $oldest_time or defined &_NUMBER($oldest_time)
2582 0 0 if (exists $ERROR{$error}) { }
2583 0 0 if $error == $E_COLLECTION_DELETED
2584 0 0 if $error != $E_NO_ERROR
2590 0 0 unless not $oldest_time or defined &_NUMBER($oldest_time)
2625 0 0 if (exists $ERROR{$error}) { }
2626 0 0 if $error == $E_COLLECTION_DELETED
2627 0 0 if $error != $E_NO_ERROR
2633 0 0 unless not $oldest_time or defined &_NUMBER($oldest_time)
2691 0 0 if (@_ and &_INSTANCE($_[0], 'Redis::CappedCollection')) { }
2696 0 0 if &_CLASSISA($_[0], 'Redis::CappedCollection')
2702 0 0 unless ($self)
2703 0 0 unless defined $arguments{'redis'}
2704 0 0 unless defined $arguments{'name'}
2707 0 0 unless $self
2708 0 0 if exists $arguments{'name'}
2710 0 0 if ($self) { }
2772 0 0 unless $self->last_errorcode == $E_REDIS_DID_NOT_RETURN_DATA
2809 0 0 if (@_ and &_INSTANCE($_[0], 'Redis::CappedCollection')) { }
2814 0 0 if &_CLASSISA($_[0], 'Redis::CappedCollection')
2820 0 0 unless ($self)
2821 0 0 unless defined $arguments{'redis'}
2822 0 0 unless defined $arguments{'name'}
2825 0 0 unless $self
2826 0 0 if $arguments{'name'}
2830 0 0 if exists $arguments{$parameter}
2832 0 0 unless ($requested_changes)
2834 0 0 if ($self) { }
2843 0 0 if (exists $arguments{$parameter})
2844 0 0 if ($parameter eq 'cleanup_bytes' or $parameter eq 'cleanup_items') { }
0 0 elsif ($parameter eq 'memory_reserve') { }
0 0 elsif ($parameter eq 'older_allowed') { }
2846 0 0 unless &_NONNEGINT($arguments{$parameter})
2849 0 0 unless &_NUMBER($memory_reserve) and $memory_reserve >= $MIN_MEMORY_RESERVE and $memory_reserve <= $MAX_MEMORY_RESERVE
2852 0 0 $arguments{$parameter} ? :
2857 0 0 if ($self) { }
2863 0 0 if ($ret == 0) { }
2864 0 0 if ($self)
2865 0 0 if ($parameter eq 'cleanup_bytes') { }
0 0 elsif ($parameter eq 'cleanup_items') { }
0 0 elsif ($parameter eq 'memory_reserve') { }
2878 0 0 if ($self) { }
2924 0 0 if (@_ and &_INSTANCE($_[0], 'Redis::CappedCollection')) { }
2941 0 0 if &_CLASSISA($_[0], 'Redis::CappedCollection')
2946 0 0 unless defined $arguments{'redis'}
2947 0 0 unless defined $arguments{'name'}
2998 0 0 if (exists $ERROR{$error}) { }
2999 0 0 if $error == $E_COLLECTION_DELETED
3000 0 0 if $error != $E_NO_ERROR
3073 0 0 ($ret // '') eq 'PONG' ? :
3091 0 0 if $] >= 5.14 and ${^GLOBAL_PHASE} eq 'DESTRUCT'
3095 0 0 unless ($self->_use_external_connection)
3186 0 0 unless exists $legal_arguments{$argument}
3189 0 0 if @unlegal_arguments
3196 0 0 if (@_ and &_INSTANCE($_[0], 'Redis::CappedCollection')) { }
3200 0 0 if &_CLASSISA($_[0], 'Redis::CappedCollection')
3207 0 0 if ($self) { }
3211 0 0 unless defined $redis_argument
3221 0 0 unless &_ARRAY($keys) and &_ARRAY0($vals) and scalar @$keys >= scalar @$vals
3236 0 0 $self->reconnect_on_error ? :
3248 0 0 if ($DEBUG) { }
3273 0 0 unless &_INSTANCE($redis, 'Redis')
3287 0 0 $return_as_insert ? :
3296 0 0 if ($return_as_insert) { }
3297 0 0 if (scalar @ret == 1 and exists $ERROR{$error}) { }
3298 0 0 if ($error == $E_NO_ERROR) { }
0 0 elsif ($error == $E_COLLECTION_DELETED) { }
0 0 elsif ($error == $E_DATA_ID_EXISTS or $error == $E_OLDER_THAN_ALLOWED) { }
3315 0 0 if (scalar @ret == 3 and exists $ERROR{$error} and $ret[2] eq '_long_term_operation') { }
3316 0 0 if ($error == $E_NO_ERROR) { }
3346 0 0 $self->older_allowed ? :
3356 0 0 if ($status_exist)
3357 0 0 unless $self->cleanup_bytes
3358 0 0 unless $self->cleanup_items
3359 0 0 unless $older_allowed == $self->older_allowed
3360 0 0 unless $cleanup_bytes == $self->cleanup_bytes
3361 0 0 unless $cleanup_items == $self->cleanup_items
3362 0 0 unless $memory_reserve == $self->memory_reserve
3363 0 0 unless $data_version == $DATA_VERSION
3373 0 0 if (not $err or $err != $E_MISMATCH_ARG and $err != $E_DATA_TOO_LARGE and $err != $E_MAXMEMORY_LIMIT and $err != $E_MAXMEMORY_POLICY)
3389 0 0 if ($err_msg)
3390 0 0 $msg ? :
0 0 defined $msg ? :
3401 0 0 if $self->reconnect_on_error
3403 0 0 if (exists $ERROR{$err}) { }
3405 0 0 $prefix ? :
3408 0 0 $prefix ? :
3417 0 0 if (&_INSTANCE($_[0], 'Redis::CappedCollection')) { }
3428 0 0 unless ($sha1)
3431 0 0 if ($self) { }
3436 0 0 unless $ret
3444 0 0 if &_INSTANCE($_[0], 'Redis::CappedCollection')
3448 0 0 if ($self) { }
3450 0 0 if ($error =~ /^Could not connect to Redis server at / or $error =~ /^Can't close socket: / or $error =~ /^Not connected to any server/ or $error =~ /^Error while reading from Redis server: / or $error =~ /^Redis server closed connection/) { }
0 0 elsif ($error =~ /^\[[^]]+\]\s+-?\Q$REDIS_MEMORY_ERROR_MSG\E/i or $error =~ /^\[[^]]+\]\s+-?\Q$REDIS_ERROR_CODE $ERROR{$E_MAXMEMORY_LIMIT}\E/i or $error =~ /^\[[^]]+\]\s+-NOSCRIPT No matching script. Please use EVAL./) { }
0 0 elsif ($error =~ /^\[[^]]+\]\s+BUSY Redis is busy running a script/) { }
3461 0 0 if $self->reconnect_on_error
3479 0 0 if $self->reconnect_on_error
3485 0 0 if ($error =~ /\] ERR Error (?:running|compiling) script/)
3495 0 0 if $self->_redis
3500 0 0 if (@_ and &_INSTANCE($_[0], 'Redis::CappedCollection')) { }
3504 0 0 if (&_HASH0($redis_parameters)) { }
3516 0 0 unless $redis_parameters = &_HASH0(shift())
3532 0 0 if defined $parameters_hash{'password'}
3544 0 0 if (&_INSTANCE($_[0], 'Redis::CappedCollection')) { }
3547 0 0 if ($self->reconnect_on_error and not $self->ping)
3549 0 0 if $err_msg
3558 0 0 if $self
3563 0 0 ref $_ ? :
3566 0 0 if ($self) { }
3573 0 0 unless (scalar @return)
3574 0 0 if $self
3579 0 0 wantarray ? :