Branch Coverage

blib/lib/Perl/Tidy/HtmlWriter.pm
Criterion Covered Total %
branch 64 292 21.9


line true false branch
46 0 39 unless (eval {
47 0 0 $Perl::Tidy::HtmlWriter::EVAL_ERROR ? :
51 0 39 if (not eval {
52 0 0 $Perl::Tidy::HtmlWriter::EVAL_ERROR ? :
62 0 0 if $AUTOLOAD =~ /\bDESTROY$/
105 0 1 unless ($html_fh)
111 0 1 if (not $input_file or $input_file eq "-" or ref $input_file)
121 0 1 if ($rOpts->{'html-pre-only'}) { }
140 1 0 if ($rOpts->{'pod2html'})
141 0 1 if ($rOpts->{'html-pre-only'}) { }
147 0 1 if ($missing_pod_html) { }
161 0 1 if ($rOpts->{'frames'})
162 0 0 if (not $extension) { }
182 1 0 unless ($title)
232 0 0 if (${$rin_toc_package;})
241 0 0 if (${$rin_toc_package;})
251 1 0 unless (${$rtoc_item_count;})
255 1 0 if $type eq "EOF"
267 0 0 if ($type eq "package")
271 0 0 if (my $count = $$rtoc_name_count{lc $unique_name}++)
277 0 0 if ($rOpts->{'pod2html'})
280 0 0 if ($type eq "sub")
282 0 0 unless ($package)
286 0 0 if (${$rin_toc_package;} and ${$rin_toc_package;} ne $package)
291 0 0 unless (${$rin_toc_package;})
297 0 0 if ($type eq 'package') { }
0 0 elsif ($type eq 'sub') { }
312 0 0 if ($type eq "EOF")
558 0 1 if (defined $rOpts->{'stylesheet'})
565 0 1 if (defined $rOpts->{'html-linked-style-sheet'})
567 0 0 if ($css_linkname =~ /^-/)
573 0 0 if ($css_linkname and $rOpts->{'nohtml-style-sheets'})
580 0 1 if ($css_linkname)
588 0 0 unless (-e $css_linkname)
600 0 0 unless ($fh)
604 0 0 if ($fh->can("close") and $filename ne "-" and not ref $filename)
605 0 0 unless $fh->close
622 1 0 unless $pre_bg_color
638 12 6 if (length $short_name == 1)
640 5 13 unless (defined $color)
643 4 14 if ($html_bold{$short_name})
647 2 16 if ($html_italic{$short_name})
659 0 14 if ($rOpts->{$key})
669 0 14 if ($color =~ /^[0-9a-fA-F]{6,6}$/)
679 0 12 defined $rOpts->{$key} ? :
681 0 12 defined $rOpts->{$key} ? :
697 1 0 unless ($pod_string)
703 0 0 unless ($fh_tmp)
718 0 0 unless ($fh_tmp->close)
738 0 0 if ($rOpts->{$kw})
745 0 0 if ($rOpts->{$kw}) { }
0 0 elsif (defined $rOpts->{$kw}) { }
757 0 0 if ($rOpts->{$kw})
762 0 0 if -e $tmpfile
769 0 0 unless ($fh_tmp)
786 0 0 unless $no_print
787 0 0 if ($in_toc)
797 0 0 if ($rOpts->{'timestamp'})
803 0 0 if ($line =~ /^\s*<html>\s*$/i) { }
0 0 elsif ($line =~ /^\s*<body.*>\s*$/i) { }
0 0 elsif ($line =~ /^\s*<!-- INDEX BEGIN -->\s*$/i) { }
0 0 elsif ($line =~ /^\s*<ul\s+id="index">/i) { }
0 0 elsif ($line =~ /^\s*<!-- INDEX END -->\s*$/i) { }
0 0 elsif ($line =~ /\s*<ul>\s*$/i and $in_toc eq 'UL') { }
0 0 elsif ($line =~ m[\s*</ul>]i and $in_toc eq 'UL') { }
0 0 elsif ($line =~ /^(.*)<!-- pERLTIDY sECTION -->(.*)$/) { }
0 0 elsif ($line =~ m[^\s*</body>\s*$]i) { }
813 0 0 if $css_string
837 0 0 if $rOpts->{'frames'}
854 0 0 if $rOpts->{'frames'}
864 0 0 if ($toc_string)
865 0 0 if $rOpts->{'frames'}
887 0 0 if ($ul_level <= 0)
889 0 0 if ($toc_string)
890 0 0 if $rOpts->{'frames'}
905 0 0 if $1
908 0 0 if ($self->{'_pod_cut_count'} > 1) { }
910 0 0 if (${$rpre_string;}) { }
932 0 0 unless $line =~ /^\s*<hr>\s*$/i
939 0 0 if (@{$rpre_string_stack;})
940 0 0 if ($self->{'_pod_cut_count'} <= 1)
957 0 0 unless ($saw_body)
961 0 0 unless ($saw_body_end)
965 0 0 unless ($saw_index)
970 0 0 if ($html_fh->can("close"))
976 0 0 if (-e $tmpfile)
977 0 0 unless (unlink $tmpfile)
984 0 0 if ($success_flag and $rOpts->{'frames'})
1025 0 0 unless rename $html_filename, $src_filename
1041 0 0 unless my $fh = "IO::File"->new($toc_filename, "w")
1072 0 0 unless my $fh = "IO::File"->new($frame_filename, "w")
1086 0 0 if ($top_basename) { }
1133 0 0 if ($line =~ /^(.*)<a(.*)href\s*=\s*"([^#]*)#([^"]+)"[^>]*>(.*)$/i)
1139 0 0 unless ($first_anchor)
1147 0 1 unless $self->{'_html_file_opened'}
1157 0 1 if ($rOpts->{'html-pre-only'})
1161 0 0 if $html_fh->can("close")
1174 0 1 if ($rOpts->{'pod2html'} and $self->{'_pod_cut_count'} >= 1 and $rOpts->{'html-color-background'} eq "#FFFFFF")
1186 0 1 if ($rOpts->{'html-linked-style-sheet'}) { }
0 1 elsif ($rOpts->{'nohtml-style-sheets'}) { }
1213 1 0 if ($rOpts->{'pod2html'})
1217 0 1 if $self->pod_to_html(${$rpod_string;}, $css_string, ${$rtoc_string;}, $rpre_string_stack)
1227 0 1 if ($rOpts->{'timestamp'})
1241 1 0 if ($css_string) { }
1262 0 0 if (${$rtoc_string;} and not $rOpts->{'frames'} and $rOpts->{'html-table-of-contents'})
1288 0 1 if $html_fh->can("close")
1291 0 1 if ($rOpts->{'frames'})
1309 0 46 if $level < 0
1316 3 43 if ($level > ${$rlast_level;}) { }
3 40 elsif ($level < ${$rlast_level;}) { }
1317 1 2 unless ($$rpackage_stack[$level - 1])
1324 0 3 unless ($package)
1328 0 3 if ($package ne $$rpackage_stack[$level + 1])
1343 0 46 if ($type eq "S" and $token =~ /^(\w+\s+)(\w.*)$/)
1352 0 0 unless ($signature =~ /^i;/)
1365 0 46 if ($type eq "P" and $token =~ /^(\w+\s+)(\w.*)$/)
1383 21 25 if $type eq "b"
1384 0 25 if $token =~ /^\s*$/
1389 4 21 unless (defined $short_name)
1394 25 0 if (not $rOpts->{'nohtml-style-sheets'}) { }
1395 21 4 if ($short_name ne "pu")
1404 0 0 if ($color and $color ne $rOpts->{'html-color-punctuation'})
1407 0 0 if ($html_italic{$short_name})
1408 0 0 if ($html_bold{$short_name})
1416 0 26 if ($missing_html_entities or not $rOpts_html_entities) { }
1439 0 2 unless $self->{'_html_file_opened'}
1448 2 0 if ($line_type eq 'CODE') { }
1453 2 0 if ($input_line =~ /(^\s*)/) { }
1467 0 0 if ($line_type eq 'HERE') { }
0 0 elsif ($line_type eq 'HERE_END') { }
0 0 elsif ($line_type eq 'FORMAT') { }
0 0 elsif ($line_type eq 'FORMAT_END') { }
0 0 elsif ($line_type eq 'SKIP') { }
0 0 elsif ($line_type eq 'SKIP_END') { }
0 0 elsif ($line_type eq 'SYSTEM') { }
0 0 elsif ($line_type eq 'END_START') { }
0 0 elsif ($line_type eq 'DATA_START') { }
0 0 elsif ($line_type =~ /^POD/) { }
1487 0 0 if ($rOpts->{'pod2html'})
1489 0 0 if ($line_type eq "POD_START")
1497 0 0 if (${$rpre_string;} =~ /\S/) { }
1524 0 0 if ($line_type eq "POD_END")
1536 0 2 if ($rOpts->{'html-line-numbers'})
1537 0 0 $line_number < 1000 ? :
0 0 $line_number < 100 ? :
0 0 $line_number < 10 ? :