Branch Coverage

blib/lib/PDF/Table.pm
Criterion Covered Total %
branch 183 318 57.5


line true false branch
115 0 7 if (defined $page and ref $page ne "PDF::API2::Page" and ref $page ne "PDF::Builder::Page")
118 0 0 if (ref $self->{'pdf'} eq 'PDF::API2' or ref $self->{'pdf'} eq 'PDF::Builder') { }
161 0 13 unless ($pdf and $page and $data)
167 1 12 unless ref $pdf eq "PDF::API2" or ref $pdf eq "PDF::Builder"
170 1 11 unless ref $page eq "PDF::API2::Page" or ref $page eq "PDF::Builder::Page"
173 1 10 unless ref $data eq "ARRAY" and scalar @$data
175 0 10 unless scalar keys %arg
181 0 10 if defined $arg{'compatibility'}
187 0 10 if defined $arg{'ink'}
263 0 90 if $key =~ s/^-//
266 0 90 unless exists $valid_settings_key{$key}
279 0 10 unless ($xbase > 0)
283 0 10 unless ($ybase > 0)
287 0 10 unless ($width > 0)
291 0 10 unless ($height > 0)
302 0 10 if (ref $data ne "ARRAY")
315 0 10 unless ($ink)
333 1 9 if (defined $arg{'header_props'} and ref $arg{'header_props'} eq "HASH")
341 1 0 if $header_props->{'repeat'}
346 1 9 if $do_headers
372 0 10 if ($leading < $fnt_size)
378 3 7 defined $arg{'border_w'} ? :
439 27 23 unless defined $col_min_width->[$col_idx]
440 27 23 unless defined $col_max_content->[$col_idx]
445 50 0 if (ref $data->[$row_idx][$col_idx] eq '') { }
0 0 elsif (ref $data->[$row_idx][$col_idx] eq 'ARRAY') { }
452 0 0 if (not defined $data->[$row_idx][$col_idx][0]) { }
458 0 0 if ($cell_markup ne 'none' and $cell_markup ne 'md1' and $cell_markup ne 'html' and $cell_markup ne 'pre') { }
0 0 elsif (defined $data->[$row_idx][$col_idx][1] and ref $data->[$row_idx][$col_idx][1] ne '' and ref $data->[$row_idx][$col_idx][1] ne 'ARRAY') { }
0 0 elsif (defined $data->[$row_idx][$col_idx][2] and ref $data->[$row_idx][$col_idx][2] ne 'HASH') { }
478 0 50 if ($bad_markup ne "")
485 3 47 if (not $row_idx and $do_headers) { }
557 22 28 if ($cell_font_size == 0)
558 0 22 if ($is_header_row) { }
586 0 50 if (defined $cell_max_w and defined $cell_min_w)
618 50 0 if ($cell_leading <= 0) { }
623 0 0 if ($cell_leading < $cell_font_size)
643 48 2 if ($cell_max_word_len > 0 and $data->[$row_idx][$col_idx] and ref $data->[$row_idx][$col_idx] eq "")
656 48 2 if $data->[$row_idx][$col_idx]
672 58 2 unless (exists $word_widths->{$_})
681 12 48 if ($max_col_w) { }
700 0 50 if defined $cell_min_w
708 27 23 unless (defined $max_w->[$col_idx])
709 0 50 if defined $cell_max_w
718 1 18 if not $row_idx and $do_headers
727 0 10 if (defined $size) { }
753 10 1 if ($pg_cnt == 1) { }
759 0 10 if ($bot_margin < 0)
767 0 1 if (ref $arg{'new_page_func'}) { }
775 0 1 unless (defined $next_y)
780 0 1 unless (defined $next_h)
790 0 1 if ($bot_margin < 0)
797 0 1 if ($do_headers == 2)
829 1 0 if $do_headers && $pg_cnt == 1 || $do_headers == 2 && $pg_cnt > 1 and defined $rows_height->[1]
832 0 11 if ($min_height >= $table_top_y - $bot_margin)
835 0 0 if ($delta > $bot_margin) { }
841 0 0 if ($pg_cnt == 1) { }
850 11 0 if $ink
857 11 0 if $ink
858 11 0 if $ink
862 8 3 if ($ink and $h_border_w)
863 8 0 if ($next_top_border == 0) { }
0 0 elsif ($next_top_border == 1) { }
915 1 49 if $colspanned{$row_idx . "_" . $col_idx}
924 3 46 if ($first_row and $do_headers) { }
989 21 28 if ($cell_font_size == 0)
990 0 21 if ($is_header_row) { }
998 49 0 if ($cell_leading <= 0)
1022 0 49 if (defined $cell_max_w and defined $cell_min_w)
1034 3 46 if ($is_header_row) { }
1070 49 0 if ($oddeven_default) { }
1071 31 18 unless (defined $bg_color)
1072 7 24 $row_is_odd ? :
1074 37 12 unless (defined $fg_color)
1075 9 28 $row_is_odd ? :
1079 0 0 unless (defined $bg_color)
1080 0 0 $row_idx % 2 ? :
1082 0 0 unless (defined $fg_color)
1083 0 0 $row_idx % 2 ? :
1131 49 0 if $ink
1139 1 48 if ($c_cell_props and $c_cell_props->{'colspan'} and $c_cell_props->{'colspan'} > 1)
1142 1 0 if $$calc_column_widths[$col_idx + $offset]
1151 0 49 if ($cell_underline)
1159 0 49 if ref $content eq "" and $content eq ""
1162 0 49 if (ref $content eq 'ARRAY') { }
46 3 elsif (not $content =~ /(.\n.)/ and $data_row_widths->[$col_idx] and $data_row_widths->[$col_idx] <= $actual_column_widths[$row_idx][$col_idx]) { }
1181 0 0 if ($rc) { }
1199 0 0 if ($rc)
1212 46 0 if ($ink)
1213 5 41 if ($cell_justify eq 'right') { }
6 35 elsif ($cell_justify eq 'center') { }
1262 0 3 if ($left_over_text)
1269 9 40 if (ref $arg{'cell_render_hook'} eq "CODE")
1291 0 19 if ($do_leftovers)
1299 19 0 if ($oddeven_default)
1300 18 1 unless ($first_row and $do_headers)
1324 50 0 if ($ink)
1325 18 32 if (defined $bg_color and not $colspanned{$row_idx . "_" . $col_idx})
1334 23 13 if ($gfx and $cell_v_rule_w and $col_idx and not $colspanned{$row_idx . "_" . $col_idx})
1339 9 14 $row_idx ? :
1346 15 21 if ($gfx and $cell_h_rule_w and scalar @{$data;} and $cur_y - $actual_row_height - $current_min_rh > $bot_margin)
1360 0 19 unless ($ink)
1361 0 0 if ($first_row and $do_headers) { }
1371 0 19 if ($do_leftovers) { }
1385 10 1 unless (scalar @{$data;})
1386 11 0 if ($ink)
1387 8 3 if ($gfx and $h_border_w)
1388 8 0 if ($next_top_border == 0) { }
0 0 elsif ($next_top_border == 1) { }
1407 11 0 if ($gfx)
1408 8 3 if ($v_border_w)
1426 10 0 if ($ink) { }
1455 0 198 if (not defined $default and ($name ne "underline" and $name ne "bg_color" and $name ne "fg_color" and $name ne "bg_color_even" and $name ne "bg_color_odd" and $name ne "fg_color_even" and $name ne "fg_color_odd" and $name ne "min_w" and $name ne "max_w"))
1466 1764 0 unless defined $cell_val
1468 688 1076 if not defined $cell_val and $fallback ne ""
1470 1760 4 unless defined $cell_val
1472 675 1089 if not defined $cell_val and $fallback ne ""
1474 1696 68 unless defined $cell_val
1476 675 1089 if not defined $cell_val and $fallback ne ""
1478 1696 68 unless defined $cell_val
1480 675 1089 if not defined $cell_val and $fallback ne ""
1484 1663 101 unless (defined $cell_val)
1538 0 24 if ($newkey =~ s/^-//)
1552 0 3 unless ($xbase > 0)
1556 0 3 unless ($ybase > 0)
1560 0 3 unless ($width > 0)
1564 0 3 unless ($height > 0)
1572 0 3 unless (defined $text and length $text > 0)
1588 3 0 defined $arg{'leading'} && $arg{'leading'} > 0 ? :
1591 0 3 if $font_size > $line_space
1598 0 13 if exists $word_width{$_}
1618 3 4 unless (@paragraph)
1620 3 0 unless scalar @paragraphs
1626 0 0 if $arg{'parspace'} and $paragraph_number > 1
1628 0 0 unless $ypos >= $bottom_border
1638 0 4 if ($first_line and exists $arg{'hang'}) { }
0 4 elsif ($first_line and exists $arg{'flindent'} and $arg{'flindent'} > 0) { }
0 4 elsif ($paragraph_number == 1 and exists $arg{'fpindent'} and $arg{'fpindent'} > 0) { }
0 8 elsif (exists $arg{'indent'} and $arg{'indent'} > 0) { }
1644 0 0 if $ink
1645 0 0 if $ink
1649 0 0 if $paragraph_number == 1
1675 4 10 if (not @line) { }
1680 4 0 if ($text_object->advancewidth($paragraph[0]) + $line_width <= $width + 0.01) { }
1683 2 2 if @paragraph
1691 9 1 if ($text_object->advancewidth(join(" ", @line) . " " . $paragraph[0]) + $line_width <= $width)
1694 8 1 if @paragraph
1703 0 4 if ($align eq 'fulljustify' or $align eq 'justify' and @paragraph) { }
1705 0 0 if scalar @line == 1
1706 0 0 if (scalar @line > 1) { }
1714 0 4 if $align eq "justify"
1720 0 4 if ($align eq 'justify') { }
1722 0 0 if $ink
1723 0 0 if $ink
1724 0 0 if @line
1735 4 0 if ($ink)
1737 0 4 if ($align eq 'right') { }
0 4 elsif ($align eq 'center') { }
1753 0 3 if scalar @paragraph