Branch Coverage

blib/lib/Spreadsheet/SimpleExcel.pm
Criterion Covered Total %
branch 63 160 39.3


line true false branch
26 0 1 if (length $$sheet[0] > 31)
45 0 5 unless (defined $array[0])
48 0 0 unless defined $array[0]
52 0 5 if (length $array[0] > 31)
59 0 5 if (grep {$$_[0] eq $array[0];} @{$$self{'worksheets'};})
71 56 45 if defined $title
80 0 1 unless defined $title
83 0 1 unless (defined $title)
96 42 1 if (ref $title eq 'ARRAY')
102 0 43 unless $title
105 0 43 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
110 0 43 unless (ref $arref eq 'ARRAY')
116 43 42 if ($$worksheet[0] eq $title)
128 0 1 if (ref $title eq 'ARRAY')
137 0 1 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
142 0 1 unless (ref $arref eq 'ARRAY')
148 1 0 if ($$worksheet[0] eq $title)
160 0 0 if (ref $title eq 'ARRAY')
165 0 0 unless defined $title
168 0 0 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
173 0 0 unless (ref $arref eq 'ARRAY')
179 0 0 if ($$worksheet[0] eq $title)
191 0 0 if (ref $title eq 'ARRAY')
196 0 0 unless defined $title
199 0 0 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
204 0 0 unless (ref $arref eq 'ARRAY')
210 0 0 if ($$worksheet[0] eq $title)
222 0 1 if (ref $index eq 'ARRAY')
229 0 1 unless defined $title
232 0 1 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
237 0 1 unless (ref $arref eq 'ARRAY')
243 1 0 if ($$worksheet[0] eq $title)
245 0 1 if ($index =~ /[^\d]/ or $index > $#array)
262 0 2 if (scalar @_ == 1) { }
0 2 elsif (scalar @_ == 2) { }
0 2 elsif (scalar @_ == 3) { }
267 0 0 if ($title =~ /\D/) { }
279 0 0 if ($title =~ /^\d+$/ and $index =~ /^ASC|DESC$/)
286 0 2 unless defined $title
291 0 2 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
298 2 0 if ($$worksheet[0] eq $title)
299 2 0 unless exists $$worksheet[1]{'sortstring'}
300 0 2 $$worksheet[1]{'sortstring'} =~ /\w/ ? :
302 0 2 unless scalar @array > 0
303 1 1 if ($index >= scalar @{$array[0];})
308 0 1 unless (defined $index or $index =~ /\D/)
313 0 1 if (_is_numeric(\@array, $index)) { }
314 0 0 if ($type and $type eq 'DESC') { }
322 1 0 if ($type and $type eq 'DESC') { }
339 0 0 unless defined $title
342 0 0 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
362 0 1 if (_is_title_numeric(\@title_array)) { }
368 1 0 if $type and $type eq 'DESC'
375 1 0 if $$_[$index] =~ /[^\d\.]/
384 1 0 if $_ =~ /[^\d\.]/
392 4 1 if (exists $$worksheet[1]{'sortstring'} and defined $$worksheet[1]{'sortstring'} and $$worksheet[1]{'sortstring'} =~ /\w/)
405 0 2 unless (defined $excel)
420 0 1 unless (defined $excel)
433 0 3 unless ($filename)
434 0 0 if ($$self{'FILE'}) { }
445 0 3 unless (defined $excel)
450 0 3 unless open EXCEL, ">$filename"
460 0 2 unless ($filename)
465 0 2 unless (scalar @{$$self{'worksheets'};} >= 1)
481 2 0 if (exists $$worksheet[1]{-'headers'}) { }
516 0 6 unless (scalar @{$$self{'worksheets'};} >= 1)
523 0 6 unless ($excel = 'Spreadsheet::WriteExcel'->new(\*XLS))
528 0 6 if ($$self{'BIG'})
530 0 0 if ($@)
534 0 0 unless ($excel = 'Spreadsheet::WriteExcel::Big'->new(\*XLS))
549 6 5 if exists $$worksheet[1]{'-headers'} and scalar @{$$worksheet[1]{'-headers'};} > 0
552 0 107 if ($row >= $c_lines)
561 0 0 if (scalar @{$$worksheet[1]{'-headers'};} > 0)
568 0 214 if (defined $formatref and defined $$formatref[$col]) { }
569 0 0 if ($$formatref[$col] eq 's') { }
0 0 elsif ($$formatref[$col] eq 'n') { }
599 14 0 if (not defined $formatref && defined $$formatref[$col]) { }
603 0 0 if ($$formatref[$col] eq 's') { }
0 0 elsif ($$formatref[$col] eq 'n') { }
620 1 3 wantarray ? :