Branch Coverage

blib/lib/CHI/Driver.pm
Criterion Covered Total %
branch 139 170 81.7


line true false branch
206 0 998 if $Build_Depth > $self->max_build_depth
220 6 992 if ($stats->enabled)
257 8 11938 unless defined $key
265 11938 0 if $measure_time
266 11592 346 unless $params{'obj'}
267 11938 0 if $measure_time
268 4 11934 if (my $error = $@)
269 0 4 if defined $ns_stats
273 1689 10245 unless (defined $obj)
274 2 1687 if defined $ns_stats
276 1689 0 if $log_is_debug
281 643 9602 if (defined(my $obj_ref = $params{'obj_ref'}))
290 4025 6220 if ($is_expired)
291 0 4025 if defined $ns_stats
293 4025 0 if $log_is_debug
299 9 4016 if (defined(my $busy_lock = $params{'busy_lock'}))
310 1 6219 if defined $ns_stats
311 6220 0 if $log_is_debug
331 8 14538 unless defined $key
334 3049 11485 unless my $data = $self->fetch($key)
341 8 80 unless defined $key
343 72 8 if (my $obj = $self->get_object($key)) { }
353 8 16 unless defined $key
355 16 0 if (my $obj = $self->get_object($key)) { }
365 8 72 unless defined $key
367 40 32 if (my $obj = $self->get_object($key)) { }
386 8 4253 unless defined $key
388 0 4253 unless defined $value
392 3846 407 if (not defined $options) { }
396 78 329 unless (ref $options)
397 9 69 if ($options eq 'never') { }
0 69 elsif ($options eq 'now') { }
410 364 43 if (exists $options->{'expires_at'} or exists $options->{'expires_in'}) { }
438 87 4166 defined $options->{'expires_in'} ? :
443 3862 188 $expires_at == 4294967295 ? :
203 4050 defined $options->{'early_expires_at'} ? :
451 16 4237 if (defined(my $obj_ref = $options->{'obj_ref'}))
454 4253 0 if $measure_time
455 4247 3 if ($self->set_object($key, $obj))
456 4247 0 if $measure_time
461 2 4245 if (defined $ns_stats)
467 4247 0 if ($log_is_debug)
480 2 4461 $expires_on_backend && $obj->expires_at < 4294967295 ? :
486 6 4457 if (my $error = $@)
487 0 6 if defined $self->{'ns_stats'}
503 0 0 if @_
510 8 201 unless defined $key
513 201 0 if (defined(my $obj = $self->get_object($key)))
527 16 40 ref $_[0] eq 'CODE' ? :
530 8 48 unless defined $key and defined $code
534 48 0 ref $options eq 'HASH' ? :
538 48 0 ref $options eq 'HASH' ? :
542 40 8 unless (defined $value)
545 0 40 if defined $ns_stats
546 8 32 $wantarray ? :
547 0 40 if defined $ns_stats
550 0 40 if (defined $ns_stats)
555 16 32 $wantarray ? :
562 0 0 if (my $obj = $self->get_object($key))
563 0 0 if ($obj->is_expired)
575 416 0 if (defined(my $value = $self->get($key)))
596 16 8 if (not $self->is_valid($key))
604 6 12 unless my $current = $self->fetch($key)
613 8 8 if ($self->is_valid($key))
634 346 198 defined $data ? :
643 8 112 unless defined $keys
652 346 198 $obj ? :
659 8 28 unless defined $keys
673 8 88 unless defined $key_values
682 8 16 unless defined $keys
704 769 21369 if (ref $key) { }
267 42204 elsif (&Encode::is_utf8($key) and $key =~ /[^\x00-\xFF]/) { }
710 79 22059 if (length $key > $self->max_key_length)
740 0 20072 unless $escapes{$1}
747 3216 0 if defined $key
799 2 8 if (ref $_ eq "CODE")
801 2 8 if (/^log$/)
802 2 8 if (/^ignore$/)
803 0 10 if (/^warn$/)
804 4 6 if (/^die$/)
812 11934 4 defined $elapsed_time ? :
11934 4 defined $elapsed_time ? :
821 3996 257 $obj->expires_at == 4294967295 ? :
832 4247 6 defined $elapsed_time ? :
4247 6 defined $elapsed_time ? :