Branch Coverage

lib/Cache/Static.pm
Criterion Covered Total %
branch 83 166 50.0


line true false branch
55 0 6 if $@
82 6 6 if (ref $CONF{$c}) { }
140 12 18 if $h{$e} == 2
186 6 4 unless defined $ns
187 4 6 if $ns
192 2 8 if open CONF, "$dir/config"
197 0 2 if ($$cr[0] eq 'log_level') { }
198 0 0 if (not $ns or $ns eq 'DEFAULT') { }
204 2 0 $ns ? :
244 8 10 if ($ret) { }
255 0 45 if $namespace =~ m[/] or grep /^$namespace$/, @ILLEGAL_NAMESPACES
268 0 9 if $@
277 0 9 unless open FH, ">$ROOT/$ns/tmp/$tmpf"
278 0 9 unless print FH $content
279 0 9 unless close FH
283 0 9 unless rename "$ROOT/$ns/tmp/$tmpf", "$ROOT/$ns/cache/$key"
286 9 0 if ($deps)
289 0 9 unless open FH, ">$ROOT/$ns/tmp/$tmpf.dep"
290 0 9 unless print FH $frozen_deps
291 0 9 unless close FH
295 0 9 unless rename "$ROOT/$ns/tmp/$tmpf.dep", "$ROOT/$ns/cache/$key.dep"
299 0 9 if ($@) { }
313 0 0 if (ref $val)
314 0 0 if (ref $val eq 'ARRAY') { }
0 0 elsif ($val->isa('XML::Comma::Doc') and _has_timestamp('XML::Comma')) { }
334 0 3 /-+/ ? :
367 0 10 if $#args % 2 == 0
373 3 25 if (lc $c eq 'w') { }
5 20 elsif (lc $c eq 'd') { }
5 15 elsif (lc $c eq 'h') { }
5 10 elsif (lc $c eq 'm') { }
10 0 elsif (lc $c eq 's') { }
395 4 2 if ($bound eq 'M') { }
0 2 elsif ($bound eq 'H') { }
0 2 elsif ($bound eq 'D') { }
2 0 elsif ($bound eq 'W') { }
412 0 6 if ($offset > $interval)
416 3 3 $roffset > $offset ? :
425 0 18 unless ($depsref)
436 18 0 @t ? :
437 0 18 unless $request_modtime
465 0 18 if (defined $modifier)
469 0 18 if ($type =~ /^_/) { }
8 10 elsif ($type eq 'file') { }
10 0 elsif ($type eq 'time') { }
0 0 elsif ($type eq 'HIT') { }
0 0 elsif ($type eq 'MISS') { }
478 0 0 if ($@) { }
0 0 elsif (not $dep_modtime) { }
489 0 10 if ($spec =~ /^[0-9]{10}$/) { }
4 6 elsif ($spec =~ /^$spec_regex$/) { }
6 0 elsif ($spec =~ /^[HMDW]:$spec_regex$/) { }
496 0 4 unless defined $sex
504 0 6 unless defined $sex
507 0 6 unless defined $dep_modtime
518 0 0 $ret ? :
521 0 0 $ret ? :
524 0 18 defined $modifier ? :
526 1 3 $bool ? :
4 14 unless $dep_modtime
527 7 7 if $dep_modtime > $request_modtime
534 4 14 unless defined $CONF{$ns}
546 0 8 unless open FH, "$ROOT/$ns/cache/$key"
564 0 0 if (_get_conf($namespace, 'recursive_unlink'))
566 0 0 unless (opendir DIR, $file)
571 0 0 if @files
573 0 0 unless (rmdir $file)
578 0 0 unless (opendir DIR, $file)
583 0 0 if @files
605 0 0 if $@
608 0 0 unless open FH, ">$file"
609 0 0 if ($output)
612 0 0 unless close FH
614 0 0 if ($@)
621 26 65 unless $severity <= $CONF{'log_level'}
627 65 0 if $CONF{'log_level'} == 3
635 35 30 if ($have_fcntl) { }
639 0 35 unless open LOG, ">>$LOGFILE"
640 0 35 unless flock LOG, 2
644 0 35 unless close LOG
658 3 210 unless (-e $dir_so_far)
659 0 3 unless mkdir $dir_so_far
660 0 3 unless chmod 0777, $dir_so_far