Branch Coverage

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


line true false branch
27 0 1 if (length $$sheet[0] > 31)
46 0 5 unless (defined $array[0])
49 0 0 unless defined $array[0]
53 0 5 if (length $array[0] > 31)
60 0 5 if (grep {$$_[0] eq $array[0];} @{$$self{'worksheets'};})
72 56 45 if defined $title
81 0 1 unless defined $title
84 0 1 unless (defined $title)
97 42 1 if (ref $title eq 'ARRAY')
103 0 43 unless $title
106 0 43 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
111 0 43 unless (ref $arref eq 'ARRAY')
117 43 42 if ($$worksheet[0] eq $title)
129 0 1 if (ref $title eq 'ARRAY')
138 0 1 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
143 0 1 unless (ref $arref eq 'ARRAY')
149 1 0 if ($$worksheet[0] eq $title)
161 0 0 if (ref $title eq 'ARRAY')
166 0 0 unless defined $title
169 0 0 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
174 0 0 unless (ref $arref eq 'ARRAY')
180 0 0 if ($$worksheet[0] eq $title)
192 0 0 if (ref $title eq 'ARRAY')
197 0 0 unless defined $title
200 0 0 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
205 0 0 unless (ref $arref eq 'ARRAY')
211 0 0 if ($$worksheet[0] eq $title)
223 0 1 if (ref $index eq 'ARRAY')
230 0 1 unless defined $title
233 0 1 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
238 0 1 unless (ref $arref eq 'ARRAY')
244 1 0 if ($$worksheet[0] eq $title)
246 0 1 if ($index =~ /[^\d]/ or $index > $#array)
263 0 2 if (scalar @_ == 1) { }
0 2 elsif (scalar @_ == 2) { }
0 2 elsif (scalar @_ == 3) { }
268 0 0 if ($title =~ /\D/) { }
280 0 0 if ($title =~ /^\d+$/ and $index =~ /^ASC|DESC$/)
287 0 2 unless defined $title
292 0 2 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
299 2 0 if ($$worksheet[0] eq $title)
300 2 0 unless exists $$worksheet[1]{'sortstring'}
301 0 2 $$worksheet[1]{'sortstring'} =~ /\w/ ? :
303 0 2 unless scalar @array > 0
304 1 1 if ($index >= scalar @{$array[0];})
309 0 1 unless (defined $index or $index =~ /\D/)
314 0 1 if (_is_numeric(\@array, $index)) { }
315 0 0 if ($type and $type eq 'DESC') { }
323 1 0 if ($type and $type eq 'DESC') { }
340 0 0 unless defined $title
343 0 0 unless (grep {$$_[0] eq $title;} @{$$self{'worksheets'};})
363 0 1 if (_is_title_numeric(\@title_array)) { }
369 1 0 if $type and $type eq 'DESC'
376 1 0 if $$_[$index] =~ /[^\d\.]/
385 1 0 if $_ =~ /[^\d\.]/
393 4 1 if (exists $$worksheet[1]{'sortstring'} and defined $$worksheet[1]{'sortstring'} and $$worksheet[1]{'sortstring'} =~ /\w/)
406 0 2 unless (defined $excel)
421 0 1 unless (defined $excel)
434 0 3 unless ($filename)
435 0 0 if ($$self{'FILE'}) { }
446 0 3 unless (defined $excel)
451 0 3 unless open EXCEL, ">$filename"
461 0 2 unless ($filename)
466 0 2 unless (scalar @{$$self{'worksheets'};} >= 1)
482 2 0 if (exists $$worksheet[1]{-'headers'}) { }
517 0 6 unless (scalar @{$$self{'worksheets'};} >= 1)
524 0 6 unless ($excel = 'Spreadsheet::WriteExcel'->new(\*XLS))
529 0 6 if ($$self{'BIG'})
531 0 0 if ($@)
535 0 0 unless ($excel = 'Spreadsheet::WriteExcel::Big'->new(\*XLS))
550 6 5 if exists $$worksheet[1]{'-headers'} and scalar @{$$worksheet[1]{'-headers'};} > 0
553 0 107 if ($row >= $c_lines)
562 0 0 if (scalar @{$$worksheet[1]{'-headers'};} > 0)
569 0 214 if (defined $formatref and defined $$formatref[$col]) { }
570 0 0 if ($$formatref[$col] eq 's') { }
0 0 elsif ($$formatref[$col] eq 'n') { }
600 14 0 if (not defined $formatref && defined $$formatref[$col]) { }
604 0 0 if ($$formatref[$col] eq 's') { }
0 0 elsif ($$formatref[$col] eq 'n') { }
621 1 3 wantarray ? :