Branch Coverage

blib/lib/PDF/Table.pm
Criterion Covered Total %
branch 168 264 63.6


line true false branch
110 0 7 if (defined $page and ref $page ne "PDF::API2::Page" and ref $page ne "PDF::Builder::Page")
113 0 0 if (ref $self->{'pdf'} eq 'PDF::API2' or ref $self->{'pdf'} eq 'PDF::Builder') { }
156 0 13 unless ($pdf and $page and $data)
162 1 12 unless ref $pdf eq "PDF::API2" or ref $pdf eq "PDF::Builder"
165 1 11 unless ref $page eq "PDF::API2::Page" or ref $page eq "PDF::Builder::Page"
168 1 10 unless ref $data eq "ARRAY" and scalar @$data
170 0 10 unless scalar keys %arg
176 0 10 if defined $arg{'compatibility'}
253 0 90 if $key =~ s/^-//
256 0 90 unless exists $valid_settings_key{$key}
269 0 10 unless ($xbase > 0)
273 0 10 unless ($ybase > 0)
277 0 10 unless ($width > 0)
281 0 10 unless ($height > 0)
291 0 10 if (ref $data ne "ARRAY")
315 1 9 if (defined $arg{'header_props'} and ref $arg{'header_props'} eq "HASH")
323 1 0 if $header_props->{'repeat'}
328 1 9 if $do_headers
354 0 10 if ($leading < $fnt_size)
360 3 7 defined $arg{'border_w'} ? :
421 27 23 unless defined $col_min_width->[$col_idx]
422 27 23 unless defined $col_max_content->[$col_idx]
424 3 47 if (not $row_idx and $do_headers) { }
496 22 28 if ($cell_font_size == 0)
497 0 22 if ($is_header_row) { }
525 0 50 if (defined $cell_max_w and defined $cell_min_w)
557 50 0 if ($cell_leading <= 0) { }
562 0 0 if ($cell_leading < $cell_font_size)
581 48 2 if ($cell_max_word_len > 0 and $data->[$row_idx][$col_idx])
593 48 2 if $data->[$row_idx][$col_idx]
609 58 2 unless (exists $word_widths->{$_})
618 12 48 if ($max_col_w) { }
637 0 50 if defined $cell_min_w
645 27 23 unless (defined $max_w->[$col_idx])
646 0 50 if defined $cell_max_w
655 1 18 if not $row_idx and $do_headers
664 0 10 if (defined $size) { }
690 10 1 if ($pg_cnt == 1) { }
696 0 10 if ($bot_margin < 0)
704 0 1 if (ref $arg{'new_page_func'}) { }
712 0 1 unless (defined $next_y)
717 0 1 unless (defined $next_h)
727 0 1 if ($bot_margin < 0)
734 0 1 if ($do_headers == 2)
766 1 0 if $do_headers && $pg_cnt == 1 || $do_headers == 2 && $pg_cnt > 1 and defined $rows_height->[1]
769 0 11 if ($min_height >= $table_top_y - $bot_margin)
772 0 0 if ($delta > $bot_margin) { }
778 0 0 if ($pg_cnt == 1) { }
799 8 3 if ($h_border_w)
800 8 0 if ($next_top_border == 0) { }
0 0 elsif ($next_top_border == 1) { }
852 1 49 if $colspanned{$row_idx . "_" . $col_idx}
861 3 46 if ($first_row and $do_headers) { }
926 21 28 if ($cell_font_size == 0)
927 0 21 if ($is_header_row) { }
935 49 0 if ($cell_leading <= 0)
959 0 49 if (defined $cell_max_w and defined $cell_min_w)
971 3 46 if ($is_header_row) { }
1007 49 0 if ($oddeven_default) { }
1008 31 18 unless (defined $bg_color)
1009 7 24 $row_is_odd ? :
1011 37 12 unless (defined $fg_color)
1012 9 28 $row_is_odd ? :
1016 0 0 unless (defined $bg_color)
1017 0 0 $row_idx % 2 ? :
1019 0 0 unless (defined $fg_color)
1020 0 0 $row_idx % 2 ? :
1076 1 48 if ($c_cell_props and $c_cell_props->{'colspan'} and $c_cell_props->{'colspan'} > 1)
1079 1 0 if $$calc_column_widths[$col_idx + $offset]
1088 0 49 if ($cell_underline)
1096 0 49 if $content eq ""
1098 46 3 if (not $content =~ /(.\n.)/ and $data_row_widths->[$col_idx] and $data_row_widths->[$col_idx] <= $actual_column_widths[$row_idx][$col_idx]) { }
1105 5 41 if ($cell_justify eq 'right') { }
6 35 elsif ($cell_justify eq 'center') { }
1153 0 3 if ($left_over_text)
1160 9 40 if (ref $arg{'cell_render_hook'} eq "CODE")
1182 0 19 if ($do_leftovers)
1190 19 0 if ($oddeven_default)
1191 18 1 unless ($first_row and $do_headers)
1215 18 32 if (defined $bg_color and not $colspanned{$row_idx . "_" . $col_idx})
1224 23 13 if ($gfx and $cell_v_rule_w and $col_idx and not $colspanned{$row_idx . "_" . $col_idx})
1229 9 14 $row_idx ? :
1236 15 21 if ($gfx and $cell_h_rule_w and scalar @{$data;} and $cur_y - $actual_row_height - $current_min_rh > $bot_margin)
1250 0 19 if ($do_leftovers) { }
1264 10 1 unless (scalar @{$data;})
1265 8 3 if ($gfx and $h_border_w)
1266 8 0 if ($next_top_border == 0) { }
0 0 elsif ($next_top_border == 1) { }
1285 11 0 if ($gfx)
1286 8 3 if ($v_border_w)
1323 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"))
1334 1764 0 unless defined $cell_val
1336 688 1076 if not defined $cell_val and $fallback ne ""
1338 1760 4 unless defined $cell_val
1340 675 1089 if not defined $cell_val and $fallback ne ""
1342 1696 68 unless defined $cell_val
1344 675 1089 if not defined $cell_val and $fallback ne ""
1346 1696 68 unless defined $cell_val
1348 675 1089 if not defined $cell_val and $fallback ne ""
1352 1663 101 unless (defined $cell_val)
1406 0 24 if ($newkey =~ s/^-//)
1420 0 3 unless ($xbase > 0)
1424 0 3 unless ($ybase > 0)
1428 0 3 unless ($width > 0)
1432 0 3 unless ($height > 0)
1440 0 3 unless (defined $text and length $text > 0)
1456 3 0 defined $arg{'leading'} && $arg{'leading'} > 0 ? :
1459 0 3 if $font_size > $line_space
1466 0 13 if exists $word_width{$_}
1486 3 4 unless (@paragraph)
1488 3 0 unless scalar @paragraphs
1494 0 0 if $arg{'parspace'} and $paragraph_number > 1
1496 0 0 unless $ypos >= $bottom_border
1506 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) { }
1517 0 0 if $paragraph_number == 1
1543 4 10 if (not @line) { }
1548 4 0 if ($text_object->advancewidth($paragraph[0]) + $line_width <= $width + 0.01) { }
1551 2 2 if @paragraph
1559 9 1 if ($text_object->advancewidth(join(" ", @line) . " " . $paragraph[0]) + $line_width <= $width)
1562 8 1 if @paragraph
1571 0 4 if ($align eq 'fulljustify' or $align eq 'justify' and @paragraph) { }
1573 0 0 if scalar @line == 1
1574 0 0 if (scalar @line > 1) { }
1582 0 4 if $align eq "justify"
1588 0 4 if ($align eq 'justify') { }
1592 0 0 if @line
1604 0 4 if ($align eq 'right') { }
0 4 elsif ($align eq 'center') { }
1619 0 3 if scalar @paragraph