Branch Coverage

blib/lib/Spreadsheet/ParseExcel.pm
Criterion Covered Total %
branch 295 462 63.8


line true false branch
177 20 26 unless (defined $_use_perlio)
178 20 0 if (exists $Spreadsheet::ParseExcel::Config{'useperlio'} and defined $Spreadsheet::ParseExcel::Config{'useperlio'} and $Spreadsheet::ParseExcel::Config{'useperlio'} eq 'define') { }
194 46 0 unpack('H08', "\cB\000\000\000") eq '02000000' ? :
0 46 defined $hParam{'Endian'} ? :
201 0 46 if ($hParam{'EventHandlers'}) { }
207 0 46 if ($hParam{'AddHandlers'})
217 2 44 if (defined $hParam{'Password'}) { }
314 12 51 if (64 - $offset < 5)
323 15 48 if ($offset == 64)
371 3 398 if ($block != $q->{'block'})
384 0 4 if ($q->{'opcode'} != 47)
388 0 4 if ($password eq "")
396 1 3 if ($q->{'length'} != 54)
400 1 2 unless (VerifyPassword($password, substr($q->{'data'}, 6, 16), substr($q->{'data'}, 22, 16), substr($q->{'data'}, 38, 16), \$q->{'md5_ctxt'}))
452 42 10047 if ($q->{'streamPos'} + 4 >= $q->{'streamLen'})
461 0 10047 if ($q->{'length'} >= 20000)
465 7562 2485 if ($q->{'length'} > 0) { }
473 399 9648 if ($q->{'encryption'} == 2) { }
0 9648 elsif ($q->{'encryption'} == 1) { }
9648 0 elsif ($q->{'encryption'} == 0) { }
474 12 387 if ($q->{'dont_decrypt_next_record'}) { }
534 4 44 unless $biff_data
536 7 37 if ($formatter) { }
555 4 10043 if ($record == 47)
556 2 2 unless (SetDecrypt($stream, "", $self->{'Password'}))
563 0 0 if ($workbook->{'_PrevPos'} and defined $self->{'FuncTbl'}{$record} and $record != 519)
585 138 9907 if (($record & 61695) == 9)
589 4889 5156 if (defined $self->{'FuncTbl'}{$record} and not $workbook->{'_skip_chart'})
595 10018 27 if $record != 60
597 0 10045 if defined $workbook->{'_ParseAbort'}
604 2 85 if ($worksheet->{'HyperLinks'})
633 6 42 if ($ref) { }
634 1 5 if ($ref eq 'SCALAR') { }
1 4 elsif ($ref eq 'ARRAY') { }
653 3 1 if (eval { do { binmode $source } }) { }
682 2 40 unless (-e $source)
691 44 2 if ($data_length) { }
708 0 46 unless $oOl
716 0 46 if $#aRes < 0
719 44 2 if ($aRes[0]{'Data'})
727 0 2 if (ref $sFile eq 'SCALAR') { }
0 2 elsif (UNIVERSAL::isa($sFile, 'IO::Handle')) { }
2 0 elsif (not ref $sFile) { }
728 0 0 if ($_use_perlio) { }
746 0 2 unless $oIo->open("<$sFile")
758 2 0 if substr($sBuff, 0, 1) ne "\t"
770 44 94 if ($iDt == 5) { }
87 7 elsif ($iDt != 32) { }
773 9 35 $oBook->{'Version'} == 1280 ? :
780 87 0 if (defined $oBook->{'_CurSheet_'}) { }
788 87 0 if length $sWk > 4
793 0 0 if ($oBook->{'BIFFVersion'} == 0 or $oBook->{'BIFFVersion'} == 2 or $oBook->{'BIFFVersion'} == 4)
890 0 285 $BIGENDIAN ? :
904 0 0 if (length $sWk > 8 + $iL) { }
1004 0 25 if ($iFlg == 65535) { }
1008 0 0 if ($iKind == 1 or $iKind == 2) { }
1009 0 0 $iKind == 1 ? :
1055 0 0 unless $iPos
1060 0 0 if ($oBook->{'BIFFVersion'} == 24) { }
0 0 elsif ($oBook->{'BIFFVersion'} == 8) { }
1063 0 0 $raBuff->[1] ? :
1099 0 147 if ($oBook->{'BIFFVersion'} >= 24) { }
1103 0 0 $raBuff->[1] ? :
1137 0 62 if $workbook->{'SheetCount'} <= 0
1211 72 453 $oBook->{'PkgStr'}[$iIdx]{'Unicode'} ? :
1230 0 585 unless defined $oBook->{'_CurSheet'}
1237 8 577 if ($iGr & 32)
1252 0 1577 unless defined $oBook->{'_CurSheet'}
1258 83 1494 unless defined $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MinRow'} and $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MinRow'} <= $iR
1263 698 879 unless defined $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MaxRow'} and $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MaxRow'} > $iR
1268 83 1494 unless defined $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MinCol'} and $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MinCol'} <= $iSc
1273 812 765 unless defined $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MaxCol'} and $oBook->{'Worksheet'}[$oBook->{'_CurSheet'}]{'MaxCol'} > $iEc
1282 0 87 unless defined $oBook->{'_CurSheet'}
1313 87 0 if $width == 8
1338 14 2157 if ($pixels <= 12) { }
1358 0 98 unless defined $oBook->{'_CurSheet'}
1369 8 2122 if ($iGr & 1)
1381 0 60 if $workbook->{'BIFFVersion'} <= 4
1406 0 2 unless $rc == 2146
1440 14 38 if ($bc)
1445 52 0 if $zterm
1459 0 28 unless $guid eq "79EAC9D0-BAF9-11CE-8C82-00AA004BA90B"
1462 0 28 if $flags & 96 or $stmvers != 2
1467 28 0 if (($flags & 20) == 20)
1471 0 28 if ($flags & 128)
1476 4 24 if ($flags & 256) { }
22 2 elsif ($flags & 1) { }
1483 14 8 if ($guid eq '79EAC9E0-BAF9-11CE-8C82-00AA004BA90B') { }
8 0 elsif ($guid eq '00000303-0000-0000-C000-000000000046') { }
1490 4 4 unless ($flags & 2)
1492 4 0 if (defined $file and length $file) { }
1509 4 4 if ($size)
1521 6 22 if ($flags & 8)
1552 27 0 if $PREFUNC == 252
1560 0 42 if defined $oBook->{'_Author'}
1563 33 9 if ($oBook->{'BIFFVersion'} >= 24) { }
1585 0 929 if ($iRich and $iExt) { }
6 923 elsif ($iRich) { }
31 892 elsif ($iExt) { }
1606 254 675 if ($iHigh) { }
1610 162 92 unless $iCnvFlg
1615 243 432 unless $iCnvFlg
1619 524 405 if (wantarray) { }
1622 27 497 if (length $sWk < $iStPos + $iLen + $iRichCnt * 4 + $iExtCnt) { }
1663 0 1065 if ($oBook->{'BIFFVersion'} == 4) { }
864 201 elsif ($oBook->{'BIFFVersion'} == 24) { }
1674 858 6 $iGen & 1 ? :
1675 0 864 $iGen & 2 ? :
1676 666 198 $iGen & 4 ? :
1677 9 855 $iGen & 8 ? :
1679 6 858 $iAlign & 8 ? :
1681 0 864 $iAlign & 128 ? :
1684 0 864 if $iRotate == 255
1685 0 864 if $iRotate > 90
1688 0 864 $iGen2 & 16 ? :
1689 0 864 $iGen2 & 32 ? :
1714 201 0 $iGen & 1 ? :
1715 0 201 $iGen & 2 ? :
1716 180 21 $iGen & 4 ? :
1717 0 201 $iGen & 8 ? :
1720 0 201 $iAlign & 8 ? :
1722 0 201 $iAlign & 128 ? :
1777 117 348 if ($oBook->{'BIFFVersion'} <= 8) { }
1789 0 465 if ($oBook->{'BIFFVersion'} <= 4 and $format_index == 0)
1816 191 45 if ($oBook->{'BIFFVersion'} == 24) { }
45 0 elsif ($oBook->{'BIFFVersion'} == 8) { }
1820 191 0 if ($iHigh) { }
1829 11 180 $iBold >= 700 ? :
1830 6 185 $iAttr & 2 ? :
1831 0 191 $iAttr & 8 ? :
1832 6 185 $iUnderline ? :
1841 0 45 $iBold >= 700 ? :
1842 0 45 $iAttr & 2 ? :
1843 0 45 $iAttr & 8 ? :
1844 0 45 $iUnderline ? :
1851 0 0 $iAttr & 1 ? :
1852 0 0 $iAttr & 2 ? :
1853 0 0 $iAttr & 4 ? :
1854 0 0 $iAttr & 8 ? :
1873 42 194 if scalar @{$oBook->{'Font'};} == 4
1884 4 87 if $iKind != 0 and $iKind != 1
1886 69 18 if ($oBook->{'BIFFVersion'} >= 24) { }
1889 8 61 if ($iUni & 1)
1923 0 87 unless defined $oBook->{'_CurSheet'}
1926 75 12 unless (defined $sWk)
1932 12 0 if ($oBook->{'BIFFVersion'} >= 24) { }
1935 0 12 $sW eq "\000" ? :
1944 0 0 $sW eq "\000\000\000" ? :
1953 0 87 unless defined $oBook->{'_CurSheet'}
1956 75 12 unless (defined $sWk)
1962 12 0 if ($oBook->{'BIFFVersion'} >= 24) { }
1965 0 12 $sW eq "\000" ? :
1974 0 0 $sW eq "\000\000\000" ? :
1986 0 6 unless defined $oBook->{'_CurSheet'}
1989 6 0 if ($oBook->{'BIFFVersion'} >= 24) { }
2017 0 6 unless defined $oBook->{'_CurSheet'}
2023 6 0 if ($oBook->{'BIFFVersion'} >= 24) { }
2051 0 48 unless defined $oBook->{'_CurSheet'}
2056 12 36 if ($bOp == 38) { }
12 24 elsif ($bOp == 39) { }
12 12 elsif ($bOp == 40) { }
12 0 elsif ($bOp == 41) { }
2079 0 87 unless defined $oBook->{'_CurSheet'}
2091 0 87 unless defined $oBook->{'_CurSheet'}
2102 0 87 unless defined $oBook->{'_CurSheet'}
2114 0 87 unless defined $oBook->{'_CurSheet'}
2125 0 87 unless defined $oBook->{'_CurSheet'}
2129 0 87 if $bLen != 34
2143 6 81 $iGrBit & 1 ? :
2144 54 33 $iGrBit & 2 ? :
2145 43 44 $iGrBit & 4 ? :
2146 6 81 $iGrBit & 8 ? :
2147 6 81 $iGrBit & 16 ? :
2148 6 81 $iGrBit & 32 ? :
2149 2 85 $iGrBit & 64 ? :
2150 8 79 $iGrBit & 128 ? :
2156 43 44 if $oWkS->{'NoPls'}
2175 24 0 if ($iGrBit & 32 and $cCh == 1)
2178 24 0 if ($oBook->{'BIFFVersion'} >= 24) { }
2185 0 24 if $iSheet == -1
2187 12 12 if ($iName == 6) { }
12 0 elsif ($iName == 7) { }
2196 6 12 if ($raI->[3] == 255) { }
2209 0 0 if ($iName == 6) { }
0 0 elsif ($iName == 7) { }
2220 0 0 if ($raI->[3] == 255) { }
2243 12 12 if ($iOp == 59) { }
12 0 elsif ($iOp == 41) { }
2256 24 0 if ($iOpW == 59)
2261 12 12 if ($iSt == 0) { }
2281 0 0 if ($iOp == 59) { }
0 0 elsif ($iOp == 41) { }
2295 0 0 if $iOpW == 59
2297 0 0 if ($iSt == 0) { }
2313 0 87 unless defined $oBook->{'_CurSheet'}
2316 6 81 unpack('v', $sWk) & 256 ? :
2324 0 18 unless defined $oBook->{'_CurSheet'}
2328 18 0 unless defined $oWkS->{'MergedArea'}
2335 71 4 if defined $oWkS->{'Cells'}[$iR][$iC]
2347 0 0 if ($iFlg) { }
2348 0 0 if ($iVal == 0) { }
0 0 elsif ($iVal == 7) { }
0 0 elsif ($iVal == 15) { }
0 0 elsif ($iVal == 23) { }
0 0 elsif ($iVal == 29) { }
0 0 elsif ($iVal == 36) { }
0 0 elsif ($iVal == 42) { }
2374 0 0 $iVal ? :
2392 75 431 if ($rk_number & 2) { }
2400 22 53 if $number & 536870912
2410 0 431 if $BIGENDIAN
2417 170 336 if $rk_number & 1
2442 27 33 if ($is_continue) { }
2446 0 27 if ($self->{'_buffer'} eq '') { }
0 27 elsif (not defined $self->{'_string_continued'}) { }
2469 0 27 if ($buff_length >= $str_position + $str_length) { }
10 17 elsif (($self->{'_string_continued'} & 1) == ($grbit & 1)) { }
2483 4 13 if ($grbit & 1) { }
2518 9 4 if ($change_length > ($biff_length - 1) * 2)
2551 497 27 if (defined $str_info->[0]) { }
2589 0 1122 unless defined $oBook->{'_CurSheet'}
2597 43 1079 if (defined $FmtStr and $rhKey{'Type'} eq "Numeric")
2602 39 4 if ($FmtStr =~ m[^[dmy][-\\/dmy]*$]i)
2616 6 1116 if ($rhKey{'Rich'})
2626 56 1066 if (defined $oBook->{'CellHandler'})
2627 0 56 if (defined $oBook->{'Object'}) { }
2634 0 0 ref $oBook->{'CellHandler'} eq 'CODE' ? :
2640 1066 56 unless ($oBook->{'NotSetCell'})
2657 0 0 unless (defined $currentbook)
2658 0 0 defined $aColor[$iIdx] ? :
2677 8 0 if (exists $error_strings{$parse_error}) { }