Branch Coverage

blib/lib/HTML/KTemplate.pm
Criterion Covered Total %
branch 184 226 81.4


line true false branch
90 1 35 if @_ == 1
91 0 36 if @_ % 2 != 0
96 34 2 unless exists $$self{'config'}{'root'}
99 0 36 if $$self{'config'}{'blind_cache'}
114 1 58 if (@_ % 2 != 0 and @_ >= 3)
122 25 34 defined $$self{'block'} ? :
125 3 56 if (ref $_[0] eq 'HASH') { }
134 1 58 if $block
150 5 41 unless (defined $_[0] and length $_[0])
163 9 31 if (ref $$root{$key} eq 'HASH') { }
22 9 elsif (ref $$root{$key} eq 'ARRAY' and ref $$root{$key}[$#{$$root{$key};}] eq 'HASH') { }
180 26 15 if (ref $$root{$last_key} eq 'ARRAY') { }
200 0 41 unless defined $_
216 1 68 if ($$self{'config'}{'no_includes'} and scalar @{$$self{'files'};} != 0)
217 1 0 if $$self{'config'}{'strict'}
224 1 67 if scalar @{$$self{'files'};} > $$self{'config'}{'max_includes'}
229 62 5 if defined $filepath
236 44 5 if defined $filepath
255 2 65 if (ref $filename eq 'SCALAR')
257 2 0 defined $$filename ? :
261 1 64 if (ref $filename eq 'ARRAY')
266 1 63 if (ref $filename eq 'GLOB')
268 0 1 unless defined $filedata
273 1 62 if (ref \$filename eq 'GLOB')
275 0 1 unless defined $filedata
281 0 62 unless defined $filepath
284 0 62 if ($$self{'config'}{'cache'})
288 0 0 if $$self{'config'}{'blind_cache'} and defined $filedata
290 0 0 if defined $filedata and $$filedata[1] == $mtime
294 0 62 unless open TEMPLATE, '<' . $filepath
302 0 62 if $$self{'config'}{'cache'}
320 3 59 defined $$self{'config'}{'root'} ? :
324 0 62 if $$self{'config'}{'blind_cache'} and defined $$HTML::KTemplate::CACHE{$filepath}
326 39 23 if -e $filepath
329 23 0 if (defined $$self{'files'}[0][1])
336 0 23 if $$self{'config'}{'blind_cache'} and defined $$HTML::KTemplate::CACHE{$filepath}
338 21 2 if -e $filepath
341 2 0 if ($$self{'config'}{'include_vars'})
343 0 2 if $$self{'config'}{'blind_cache'} and defined $$HTML::KTemplate::CACHE{$filepath}
345 2 0 if -e $filepath
372 63 4 $HTML::KTemplate::BLOCK_START_TAG eq $HTML::KTemplate::INCLUDE_START_TAG && $HTML::KTemplate::BLOCK_END_TAG eq $HTML::KTemplate::INCLUDE_END_TAG ? :
452 25 15 defined $9 ? :
4 40 defined $8 ? :
4 44 defined $7 ? :
169 48 defined $5 ? :
60 217 defined $3 ? :
458 277 0 if ($HTML::KTemplate::CHOMP)
460 150 8 $space ? :
158 119 if $block
463 170 107 $type && !($type =~ /^[Ii]/) ? :
467 162 115 if $block and $text =~ s/\r?\n[ \t]*\z/ /
473 277 0 if defined $text
475 60 217 if (not defined $type) { }
47 170 elsif ($type =~ /^[Bb]/) { }
86 84 elsif ($type =~ /^[Ee][Nn]/) { }
14 70 elsif ($type =~ /^[Ii][Ff]/) { }
14 56 elsif ($type =~ /^[Uu]/) { }
12 44 elsif ($type =~ /^[Ee]/) { }
33 11 elsif ($type =~ /^[Ii]/) { }
11 0 elsif ($type =~ /^[Ll]/) { }
481 0 47 unless length $ident
497 0 86 if scalar @idents == 0
500 0 78 if defined $ident and uc $ident eq 'BEGIN' || uc $ident ne $idents[0][0] and $ident ne $idents[0][1]
509 0 14 unless length $ident
518 0 14 unless length $ident
527 0 12 if scalar @idents == 0
530 0 12 if defined $ident and $ident ne $idents[0][1]
539 0 33 unless length $ident
546 0 11 unless length $ident
561 12 55 if $HTML::KTemplate::CHOMP and $block
564 0 67 if @idents > 0
579 12 0 $$line[0] == 5 ? :
14 12 $$line[0] == 6 ? :
29 26 $$line[0] == 7 ? :
13 55 $$line[0] == 4 ? :
135 68 $$line[0] == 2 ? :
28 203 $$line[0] == 3 ? :
479 231 $$line[0] == 0 ? :
92 710 $$line[0] == 1 ? :
598 7 88 unless (defined $value)
599 1 6 if $$self{'config'}{'strict'}
607 1 87 if (ref $value)
608 1 0 if ref $value eq 'CODE'
609 0 1 if not defined $value or ref $value
612 5 83 if ($$self{'config'}{'parse_vars'})
635 135 68 if ($mode == 2) { }
29 39 elsif ($mode == 7) { }
13 26 elsif ($mode == 4) { }
14 12 elsif ($mode == 6) { }
12 0 elsif ($mode == 5) { }
638 77 58 unless defined $data
642 33 25 if (not ref $data eq 'ARRAY') { }
643 29 4 $data ? :
646 2 23 unless @$data
653 16 13 unless defined $data
654 6 7 unless ref $data eq 'ARRAY'
655 1 6 unless @$data
661 1 12 unless defined $data
662 6 6 $data ? :
667 9 5 if $data
672 0 12 if $ident
680 53 66 ref $vars eq 'HASH' ? :
683 15 104 if ($loop_vars) { }
690 6 3 $loop_count == @$data ? :
6 9 $loop_count == 1 ? :
0 15 @$data == 1 ? :
706 53 66 !$skip ? :
725 15 36 if $$self{'config'}{'loop_vars'} and @ident == 0 and exists $$self{'loop'}[0]{$last_key}
734 160 267 if @ident == 0 and exists $$hash{$last_key}
741 28 2 if (ref $root eq 'HASH') { }
753 265 2 if (not $skip) { }
754 16 249 if exists $$root{$last_key}
773 0 0 ref $fh eq 'GLOB' || ref \$fh eq 'GLOB' ? :