Branch Coverage

blib/lib/Spreadsheet/WriteExcel/Workbook.pm
Criterion Covered Total %
branch 179 346 51.7


line true false branch
125 0 61 if (not ref $$self{'_filename'} and $$self{'_filename'} eq '')
135 61 0 if (not ref $$self{'_filename'}) { }
139 0 61 unless (defined $fh)
162 61 0 if $] >= 5.008
195 0 61 if (defined $$self{'_tempdir'}) { }
199 0 0 if $@
207 0 0 unless $fh
214 0 61 unless $fh
219 61 0 if ($fh) { }
232 0 0 if ($^W)
255 0 61 unless ($@)
262 0 61 unless ($@)
269 61 0 unless ($@)
291 2211 934 if ($$self{'_using_tmpfile'}) { }
295 0 2211 if length $data > $$self{'_limit'}
325 61 105 if (defined $$self{'_data'})
329 44 17 if $$self{'_using_tmpfile'}
334 88 17 if ($$self{'_using_tmpfile'})
335 44 44 if read $$self{'_filehandle'}, $tmp, $buffer
354 1 61 if $$self{'_fileclosed'}
374 2 59 if not $$self{'_fileclosed'}
390 0 18 if (@_) { }
485 0 2 unless (defined $type)
493 2 0 unless ($embedded)
518 2 0 if (not $embedded) { }
581 21 183 $encoding ? :
585 2 202 if ($chart) { }
593 134 70 if ($name eq '')
596 2 132 if ($chart) { }
606 4 200 if length $name > $limit
609 0 200 if $encoding == 1 and length($name) % 2
614 21 179 if ($encoding != 1 and $name =~ /$invalid_char/) { }
622 7 599 if ($hi eq "\000" and $lo =~ /$invalid_char/)
630 172 0 if ($] >= 5.008)
633 5 167 if (Encode::is_utf8($name))
652 552 66 if ($encd_a == 0 and $encd_b == 0) { }
12 54 elsif ($encd_a == 0 and $encd_b == 1) { }
41 13 elsif ($encd_a == 1 and $encd_b == 0) { }
13 0 elsif ($encd_a == 1 and $encd_b == 1) { }
653 12 540 if lc $name_a eq lc $name_b
657 2 10 if lc $name_a eq lc $name_b
661 5 36 if lc $name_a eq lc $name_b
665 13 0 if ($] >= 5.008) { }
668 4 9 if lc $name_a eq lc $name_b
679 0 0 if ($hi_a or $hi_b) { }
680 0 0 if $name_a eq $name_b
683 0 0 if lc $name_a eq lc $name_b
689 23 595 if ($error)
746 0 1 if $self->sheets
749 1 0 if (defined $_[0]) { }
768 0 0 if $self->sheets
772 0 0 if (defined $_[0]) { }
807 0 0 if (defined $_[1] and $_[1] =~ /^#(\w\w)(\w\w)(\w\w)/)
820 0 0 if ($index < 8 or $index > 64)
826 0 0 if ($red < 0 or $red > 255 or ($green < 0 or $green > 255) or ($blue < 0 or $blue > 255))
929 0 0 if $dir ne '' and not -d $dir
930 0 0 if $self->sheets
948 0 0 if $codepage == 1
949 0 0 if $codepage == 2
994 0 0 if ($name =~ /^(.*)!(.*)$/)
1013 0 0 if ($@)
1063 0 14 unless @_
1067 1 13 if (ref $_[0] eq 'HASH') { }
1093 0 60 unless (exists $properties{$parameter})
1101 1 13 unless (exists $param{'created'})
1121 63 49 if (exists $param{$property} and defined $param{$property})
1148 14 42 if (exists $param{$property} and defined $param{$property})
1181 3 28 if defined $$params{'utf8'}
1184 28 0 if ($] >= 5.008)
1187 60 50 unless exists $$params{$string}
1188 4 46 if Encode::is_utf8($$params{$string})
1208 3 58 unless @{$$self{'_worksheets'};}
1214 61 0 if ($$self{'_activesheet'} == 0)
1221 61 74 if $$sheet{'_selected'}
1222 61 74 if $$sheet{'_index'} == $$self{'_activesheet'}
1252 17 44 if ($$self{'_ext_ref_count'})
1281 60 1 if (not $$self{'_add_doc_properties'} and $$self{'_biffsize'} <= $maxsize) { }
1310 1 0 if (not $@) { }
1335 1 0 if ($$self{'_add_doc_properties'})
1361 1 0 if $$self{'_internal_fh'}
1449 0 78 if @{$$self{'_images_data'};}
1457 2 166 unless $$sheet{'_sheet_type'} == 0
1465 129 37 unless $num_images + $num_comments + $num_charts + $num_filters
1494 12 37 $i > 1024 ? :
1507 20 58 if $mso_size
1545 2 166 unless $$sheet{'_sheet_type'} == 0
1546 166 0 unless $sheet->_prepare_images
1575 0 0 if (not exists $images_seen{$filename}) { }
1580 0 0 unless defined $fh
1595 0 0 if (unpack('x A3', $data) eq 'PNG') { }
0 0 elsif (unpack('n', $data) == 65496 and unpack('x6 A4', $data) eq 'JFIF' || unpack('x6 A4', $data) eq 'Exif') { }
0 0 elsif (unpack('A2', $data) eq 'BM') { }
1691 0 0 if ($$self{'_checksum_method'} == 1) { }
0 0 elsif ($$self{'_checksum_method'} == 2) { }
0 0 elsif ($$self{'_checksum_method'} == 3) { }
1745 0 0 if (length $data <= 54)
1753 0 0 if ($width > 65535)
1757 0 0 if ($height > 65535)
1764 0 0 if ($bitcount != 24)
1768 0 0 if ($planes != 1)
1776 0 0 if ($compression != 0)
1809 3 21 if ($marker == 65472 or $marker == 65474)
1816 1 20 if $marker == 65498
1819 2 3 unless (defined $height)
1907 1284 62 if (not $$format{'_font_only'} and exists $fonts{$key}) { }
1914 62 0 unless ($$format{'_font_only'})
1954 1346 0 unless ($num_format =~ /^0+\d/)
1955 1346 0 if $num_format =~ /^\d+$/
1958 0 0 if (exists $num_formats{$num_format}) { }
2061 6 54 if ($$worksheet{'_filter_count'})
2082 20 40 if (defined $$worksheet{'_print_rowmin'})
2109 2 58 if (defined $rowmin and defined $colmin) { }
16 42 elsif (defined $rowmin) { }
8 34 elsif (defined $colmin) { }
2220 3 132 if $encoding
2223 3 132 if $encoding
2278 0 0 if ($] >= 5.008)
2281 0 0 if (Encode::is_utf8($format))
2293 0 0 if ($encoding == 1)
2294 0 0 if $cch % 2
2295 0 0 if $encoding
2301 0 0 if ($encoding == 0 and $format =~ /\x80/)
2431 0 8 if $encoding
2443 7 1 if ($text_length == 1)
2444 2 5 if ord $name == 6
2445 4 3 if ord $name == 7
2446 1 6 if ord $name == 13
2508 6 44 if $hidden
2731 0 78 if (@{$$self{'_defined_names'};})
2735 0 0 unless (exists $ext_refs{$key})
2758 20 145 if (defined $$worksheet{'_print_rowmin'})
2759 20 0 unless exists $ext_refs{$key}
2767 2 163 if (defined $rowmin and defined $colmin) { }
24 139 elsif (defined $rowmin or defined $colmin) { }
2768 2 0 unless exists $ext_refs{$key}
2773 24 0 unless exists $ext_refs{$key}
2784 6 159 if ($filter)
2785 6 0 unless exists $ext_refs{$key}
2800 44 34 if $ext_ref_count == 0
2877 7 0 if ($block_length < $continue_limit)
2902 0 0 if ($encoding == 1)
2906 0 0 if ($space_remaining > $header_length)
2908 0 0 if (not $split_string and $space_remaining % 2 != 1) { }
0 0 elsif ($split_string and $space_remaining % 2 == 1) { }
2923 0 0 if ($space_remaining > $header_length) { }
2937 0 0 if ($block_length > 0) { }
2959 0 0 if ($block_length < $continue_limit) { }
2969 3 58 if $written + $continue
2981 3 58 if @block_sizes
3026 3 58 if (@block_sizes) { }
3056 3 4 if (++$extsst_str_num % $$self{'_extsst_bucket_size'} == 0)
3068 7 0 if ($block_length < $continue_limit)
3071 3 4 if ($bucket_string)
3104 0 0 if ($encoding == 1)
3108 0 0 if ($space_remaining > $header_length)
3110 0 0 if (not $split_string and $space_remaining % 2 != 1) { }
0 0 elsif ($split_string and $space_remaining % 2 == 1) { }
3125 0 0 if ($space_remaining > $header_length) { }
3130 0 0 if ($bucket_string)
3151 0 0 if ($block_length > 0) { }
3165 0 0 if (@block_sizes)
3172 0 0 if $continue
3181 0 0 if ($block_length < $continue_limit) { }
3184 0 0 if ($bucket_string)
3223 75 14 if ($unique_strings < 1024) { }
3286 58 20 unless $$self{'_mso_size'}
3338 20 0 if (length $data <= $limit)
3351 0 0 if ($block_count == 1) { }
3444 20 0 unless $$self{'_images_size'}
3544 0 0 if $image_type == 5
3545 0 0 if $image_type == 6
3546 0 0 if $image_type == 7
3549 0 0 if ($image_type == 7)