Branch Coverage

blib/lib/Perl/Tidy/HtmlWriter.pm
Criterion Covered Total %
branch 63 280 22.5


line true false branch
46 0 38 unless (eval {
47 0 0 $Perl::Tidy::HtmlWriter::EVAL_ERROR ? :
51 0 38 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 ($extension) { }
182 1 0 unless ($title)
240 0 0 if (${$rin_toc_package;})
249 0 0 if (${$rin_toc_package;})
259 1 0 unless (${$rtoc_item_count;})
263 1 0 if $type eq "EOF"
275 0 0 if ($type eq "package")
279 0 0 if (my $count = $$rtoc_name_count{lc $unique_name}++)
285 0 0 if ($rOpts->{'pod2html'})
288 0 0 if ($type eq "sub")
290 0 0 unless ($package)
294 0 0 if (${$rin_toc_package;} and ${$rin_toc_package;} ne $package)
299 0 0 unless (${$rin_toc_package;})
305 0 0 if ($type eq 'package') { }
0 0 elsif ($type eq 'sub') { }
320 0 0 if ($type eq "EOF")
563 0 1 if (defined $rOpts->{'stylesheet'})
570 0 1 if (defined $rOpts->{'html-linked-style-sheet'})
572 0 0 if ($css_linkname =~ /^-/)
578 0 0 if ($css_linkname and $rOpts->{'nohtml-style-sheets'})
585 0 1 if ($css_linkname)
593 0 0 unless (-e $css_linkname)
605 0 0 unless ($fh = "IO::File"->new("> $filename"))
623 1 0 unless $pre_bg_color
639 12 6 if (length $short_name == 1)
641 5 13 unless (defined $color)
644 4 14 if ($html_bold{$short_name})
648 2 16 if ($html_italic{$short_name})
660 0 14 if ($rOpts->{$key})
670 0 14 if ($color =~ /^[0-9a-fA-F]{6,6}$/)
680 0 12 defined $rOpts->{$key} ? :
682 0 12 defined $rOpts->{$key} ? :
698 1 0 unless ($pod_string)
704 0 0 unless ($fh_tmp)
734 0 0 if ($rOpts->{$kw})
741 0 0 if ($rOpts->{$kw}) { }
0 0 elsif (defined $rOpts->{$kw}) { }
750 0 0 if ($rOpts->{$kw})
755 0 0 if -e $tmpfile
762 0 0 unless ($fh_tmp)
779 0 0 unless $no_print
780 0 0 if ($in_toc)
790 0 0 if ($rOpts->{'timestamp'})
796 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) { }
806 0 0 if $css_string
830 0 0 if $rOpts->{'frames'}
847 0 0 if $rOpts->{'frames'}
857 0 0 if ($toc_string)
858 0 0 if $rOpts->{'frames'}
880 0 0 if ($ul_level <= 0)
882 0 0 if ($toc_string)
883 0 0 if $rOpts->{'frames'}
898 0 0 if $1
901 0 0 if ($self->{'_pod_cut_count'} > 1) { }
903 0 0 if (${$rpre_string;}) { }
925 0 0 unless $line =~ /^\s*<hr>\s*$/i
932 0 0 if (@{$rpre_string_stack;})
933 0 0 unless ($self->{'_pod_cut_count'} > 1)
950 0 0 unless ($saw_body)
954 0 0 unless ($saw_body_end)
958 0 0 unless ($saw_index)
967 0 0 if (-e $tmpfile)
968 0 0 unless (unlink $tmpfile)
975 0 0 if ($success_flag and $rOpts->{'frames'})
1016 0 0 unless rename $html_filename, $src_filename
1032 0 0 unless my $fh = "IO::File"->new($toc_filename, "w")
1063 0 0 unless my $fh = "IO::File"->new($frame_filename, "w")
1077 0 0 if ($top_basename) { }
1124 0 0 if ($line =~ /^(.*)<a(.*)href\s*=\s*"([^#]*)#([^"]+)"[^>]*>(.*)$/i)
1130 0 0 unless ($first_anchor)
1138 0 1 unless $self->{'_html_file_opened'}
1148 0 1 if ($rOpts->{'html-pre-only'})
1164 0 1 if ($rOpts->{'pod2html'} and $self->{'_pod_cut_count'} >= 1 and $rOpts->{'html-color-background'} eq "#FFFFFF")
1176 0 1 if ($rOpts->{'html-linked-style-sheet'}) { }
1 0 elsif (not $rOpts->{'nohtml-style-sheets'}) { }
1198 1 0 if ($rOpts->{'pod2html'})
1202 0 1 if $self->pod_to_html(${$rpod_string;}, $css_string, ${$rtoc_string;}, $rpre_string_stack)
1212 0 1 if ($rOpts->{'timestamp'})
1226 1 0 if ($css_string) { }
1247 0 0 if (${$rtoc_string;} and not $rOpts->{'frames'} and $rOpts->{'html-table-of-contents'})
1275 0 1 if ($rOpts->{'frames'})
1293 0 46 if $level < 0
1300 3 43 if ($level > ${$rlast_level;}) { }
3 40 elsif ($level < ${$rlast_level;}) { }
1301 1 2 unless ($$rpackage_stack[$level - 1])
1308 0 3 unless ($package)
1312 0 3 if ($package ne $$rpackage_stack[$level + 1])
1323 0 46 if ($type eq "i" and $token =~ /^(sub\s+)(\w.*)$/)
1332 0 0 unless ($signature =~ /^i;/)
1344 0 46 if ($type eq "i" and $token =~ /^(package\s+)(\w.*)$/)
1362 21 25 if $type eq "b"
1363 0 25 if $token =~ /^\s*$/
1368 4 21 unless (defined $short_name)
1373 25 0 if (not $rOpts->{'nohtml-style-sheets'}) { }
1374 21 4 if ($short_name ne "pu")
1383 0 0 if ($color and $color ne $rOpts->{'html-color-punctuation'})
1386 0 0 if ($html_italic{$short_name})
1387 0 0 if ($html_bold{$short_name})
1395 0 26 if ($missing_html_entities or not $rOpts_html_entities) { }
1418 0 2 unless $self->{'_html_file_opened'}
1427 2 0 if ($line_type eq 'CODE') { }
1432 2 0 if ($input_line =~ /(^\s*)/) { }
1446 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/) { }
1463 0 0 if ($rOpts->{'pod2html'})
1465 0 0 if ($line_type eq "POD_START")
1473 0 0 if (${$rpre_string;} =~ /\S/) { }
1500 0 0 if ($line_type eq "POD_END")
1512 0 2 if ($rOpts->{'html-line-numbers'})
1513 0 0 $line_number < 1000 ? :
0 0 $line_number < 100 ? :
0 0 $line_number < 10 ? :