Branch Coverage

blib/lib/Tie/CacheHash.pm
Criterion Covered Total %
branch 0 292 0.0


line true false branch
40 0 0 if (scalar @args != 1)
47 0 0 if (not ref $ahr or ref $ahr ne 'HASH')
52 0 0 unless defined $$ahr{'min'}
53 0 0 unless defined $$ahr{'min_margin'}
54 0 0 unless defined $$ahr{'max_margin'}
55 0 0 unless defined $$ahr{'max'}
56 0 0 unless defined $$ahr{'sort_func'}
57 0 0 unless defined $$ahr{'sort_rev'}
58 0 0 unless defined $$ahr{'scan_min'}
59 0 0 unless defined $$ahr{'fudge'}
60 0 0 unless defined $$ahr{'sub_hash'}
95 0 0 if ($$ahr{'sub_hash'})
98 0 0 if ($Tie::CacheHash::DEBUG)
101 0 0 if $href
103 0 0 if ($tied)
105 0 0 if $tref
117 0 0 if ($Tie::CacheHash::DEBUG > 2)
118 0 0 defined $_[0]{'h'}{$_[1]} ? :
129 0 0 if defined $$self{'h'}{$key} and $$self{'h'}{$key} eq $value
131 0 0 defined $$self{'h'}{$key} ? :
0 0 if $Tie::CacheHash::DEBUG > 2
133 0 0 if (defined $$self{'h'}{$key})
140 0 0 defined $$self{'h'}{$key} ? :
0 0 if $Tie::CacheHash::DEBUG > 2
154 0 0 if $Tie::CacheHash::DEBUG > 2
155 0 0 if ($$self{'num_keys'} <= $max or not defined $cache_top or $self->cmp($value, $cache_top) <= 0)
160 0 0 if $Tie::CacheHash::DEBUG > 2
161 0 0 if ($Tie::CacheHash::DEBUG and int rand 200 == 0)
165 0 0 defined $cache_top ? :
0 0 if $Tie::CacheHash::DEBUG > 2
170 0 0 unless exists $$self{'h'}{$key}
174 0 0 if $Tie::CacheHash::DEBUG > 2
175 0 0 if (not defined $cache_top or $self->cmp($value, $cache_top) <= 0)
176 0 0 if $Tie::CacheHash::DEBUG > 2
178 0 0 if $Tie::CacheHash::DEBUG > 2
184 0 0 if ($Tie::CacheHash::DEBUG and int rand 200 == 0)
187 0 0 if ($self->cache_too_small)
189 0 0 if $Tie::CacheHash::DEBUG
192 0 0 if ($Tie::CacheHash::DEBUG > 2)
204 0 0 unless @kv
205 0 0 wantarray ? :
0 0 if @kv
211 0 0 unless @kv
212 0 0 wantarray ? :
0 0 if @kv
217 0 0 if $key and exists $$self{'h'}{$key}
238 0 0 if ($$self{'sort_rev'}) { }
249 0 0 if (not defined $Tie::Cache::a) { }
0 0 elsif (not defined $Tie::Cache::b) { }
250 0 0 if (not defined $Tie::Cache::b) { }
259 0 0 if (not defined $sf or $ref_sf and $ref_sf ne 'CODE') { }
262 0 0 if ($ref_sf) { }
0 0 elsif (not ref $sf) { }
265 0 0 if $sf eq '<=>'
283 0 0 if $#$cr < 0
293 0 0 if $min > $#$cr
298 0 0 unless ($cmp)
302 0 0 if ($cmp < 0) { }
0 0 elsif ($cmp > 0) { }
320 0 0 if ($Tie::CacheHash::DEBUG > 2)
321 0 0 $min ? :
322 0 0 $keyleft ? :
324 0 0 $keymin ? :
326 0 0 $keyright ? :
330 0 0 if ($min > 0 and $min < $#$cr and $self->cmp($value, $$self{'h'}{$$cr[$min]}) == 0)
348 0 0 if ($Tie::CacheHash::DEBUG)
353 0 0 if ($min < 0 or $min > $#$cr + 1 or $min != int $min)
356 0 0 if ($#$cr == -1) { }
0 0 elsif ($#$cr == 0) { }
358 0 0 if ($min != 0)
363 0 0 if ($min == 0 and $self->cmp($value, $$self{'h'}{$$cr[0]}) > 0) { }
0 0 elsif ($min == 1 and $self->cmp($$self{'h'}{$$cr[0]}, $value) > 0) { }
0 0 elsif ($min < 0 or $min > 1) { }
371 0 0 if ($min == 0 and $self->cmp($value, $$self{'h'}{$$cr[0]}) > 0) { }
0 0 elsif ($min == $#$cr + 1 and $self->cmp($$self{'h'}{$$cr[$#$cr]}, $value) > 0) { }
0 0 elsif ($min > 0 and $min <= $#$cr) { }
376 0 0 if ($self->cmp($$self{'h'}{$$cr[$min - 1]}, $value) > 0)
381 0 0 if ($self->cmp($value, $$self{'h'}{$$cr[$min]}) > 0)
389 0 0 if $Tie::CacheHash::DEBUG > 2
397 0 0 if $Tie::CacheHash::DEBUG > 2
399 0 0 if $Tie::CacheHash::DEBUG > 2
401 0 0 if $Tie::CacheHash::DEBUG > 2
407 0 0 if $Tie::CacheHash::DEBUG > 2
408 0 0 if ($self->cache_too_large)
409 0 0 if $Tie::CacheHash::DEBUG > 2
413 0 0 if $Tie::CacheHash::DEBUG > 2
425 0 0 if ($cache_pos <= $#$cr and $$cr[$cache_pos] eq $key)
437 0 0 if $field eq 'min'
438 0 0 if ($value =~ /^(\d+(?:\.\d*)?|\.\d+)\%$/)
451 0 0 if $#$cr + 1 < $min
464 0 0 if $small_enuf > $max - 1
465 0 0 if $#$cr <= $small_enuf
478 0 0 if $large_enuf < $min + 1
479 0 0 unless $#$cr >= $large_enuf
495 0 0 if ($Tie::CacheHash::DEBUG > 1)
501 0 0 unless (defined $$self{'num_keys'})
505 0 0 if ($Tie::CacheHash::DEBUG > 1)
508 0 0 if ($#sort_unscanned > 10) { }
520 0 0 if ($$self{'num_keys'} <= $max * (1 + $$self{'fudge'})) { }
529 0 0 if not $$self{'scan_min'} or $$self{'scan_min'} < 10
541 0 0 if $Tie::CacheHash::DEBUG > 1
548 0 0 if $num_to_scan >= $max_num_to_scan - $#scanned
550 0 0 if $num_to_scan > $#unscanned + 1
552 0 0 if ($num_to_scan)
554 0 0 if $Tie::CacheHash::DEBUG > 1
562 0 0 if ($#unscanned >= $num_to_scan)
569 0 0 if $Tie::CacheHash::DEBUG > 1
578 0 0 unless $self->cmp($$self{'h'}{$a}, $$self{'h'}{$b})
584 0 0 if ($#sorted_scanned >= 0)
588 0 0 if $guess_max_key_index == 0
589 0 0 if $guess_max_key_index > $#sorted_scanned
598 0 0 if $Tie::CacheHash::DEBUG > 1
606 0 0 if $self->cmp($$self{'h'}{$key}, $guess_max_value) <= 0
609 0 0 if $self->cmp($$self{'h'}{$key}, $guess_max_value) <= 0
612 0 0 if $Tie::CacheHash::DEBUG > 1
614 0 0 if ($self->cache_may_accept)
618 0 0 if $Tie::CacheHash::DEBUG > 1
622 0 0 unless $self->cmp($$self{'h'}{$a}, $$self{'h'}{$b})
627 0 0 if $#$cr >= $max
629 0 0 if $Tie::CacheHash::DEBUG > 1
636 0 0 unless ($success)
650 0 0 if $fraction_multiplier > 2
651 0 0 if $fraction_multiplier < 1 + $$self{'fudge'}
653 0 0 if ($desired_fraction > 0.8)
657 0 0 if ($#scanned < $$self{'scan_min'} * 1.9)
660 0 0 if $Tie::CacheHash::DEBUG > 1
672 0 0 if ($do_it_the_stupid_way)
678 0 0 unless $self->cmp($$self{'h'}{$a}, $$self{'h'}{$b})
683 0 0 if ($#$cr >= $max)
689 0 0 if ($Tie::CacheHash::DEBUG > 1)
692 0 0 if ($Tie::CacheHash::DEBUG)
695 0 0 if ($Tie::CacheHash::DEBUG > 1)
705 0 0 unless $Tie::CacheHash::DEBUG
706 0 0 unless $info
709 0 0 if ($#$cr > 0)
714 0 0 if (not defined $newval && defined $lastval or $self->cmp($newval, $lastval) < 0)
715 0 0 unless defined $newval
716 0 0 unless defined $lastval
723 0 0 if ($#$cr >= 0 and not $error)
728 0 0 if ($cache{$key}) { }
730 0 0 if ($self->cmp($$self{'h'}{$key}, $pivot_value) > 0)
737 0 0 if ($self->cmp($$self{'h'}{$key}, $pivot_value) < 0)
745 0 0 if ($error)
748 0 0 defined $$cr[$j] ? :
749 0 0 defined $$self{'h'}{$key} ? :
0 0 if $key