Branch Coverage

blib/lib/Spreadsheet/Edit/IO.pm
Criterion Covered Total %
branch 59 310 19.0


line true false branch
79 0 0 unless eval {
124 0 0 unless open $lock_fh, "+>>", $lockfile_path
128 0 0 if (not flock($lock_fh, 6)) { }
130 0 0 unless seek $lock_fh, 0, 0
132 0 0 unless close $lock_fh
135 0 0 unless my($pid) = $owner =~ /pid (\d+)/
136 0 0 unless my(@s) = stat "/proc/$pid"
139 0 0 $owner ? :
143 0 0 unless $$opts{"silent"}
147 0 0 unless seek $lock_fh, 0, 2
155 0 3 if (defined $locked_fh)
166 0 0 unless $fh == $locked_fh
173 0 0 unless flock $fh, 8
286 0 0 unless s/\W//a
338 0 0 if (not $Saved_Sigs{$_[0]} or $Saved_Sigs{$_[0]} eq "DEFAULT")
443 0 4865766 if (not defined $fullname and $is_MSWin) { }
444 0 0 if $debug
447 0 0 unless (-d _)
452 4487594 378172 unless (-d _ or -l _)
453 2243797 2243797 if $debug
458 12 377526 if (not defined $fullname && -r _ && -x _ or not $is_MSWin and (stat _)[7] == 0 or /\$/ or not -r $fullname or not -x _ or m[^/snap/(?!.*ffice)] or m[^/(proc|dev|sys|tmp|boot|run|lost+found|usr/(include|src))$])
469 323 323 if $debug
473 188763 188763 if $debug
477 6 377520 if (basename($_) =~ /$searchfor_re/)
484 0 12 if (@hits) { }
489 0 0 if ($path)
490 0 0 unless $prefix->subsumes($path)
492 0 0 if (_cmp_subpaths($subpath, $results{$o_l}{"subpath"}) >= 0)
499 0 12 if $@
502 2086 375440 if ($depth == $maxdepth) { }
0 375440 elsif ($depth > $maxdepth) { }
503 1043 1043 if $debug
525 0 1 if defined $hash
529 0 0 if (my $fh = eval {
532 0 0 if ($octets =~ /Created by LibreOffice (\d+\.\d+\.\w+)/)
536 0 0 unless ($raw_version)
537 0 0 if (`$prog --version 2>&1` =~ /Libre.*? (\d+\.\d+\.\w+)/) { }
543 0 0 unless ($raw_version)
576 1 0 unless &_openlibre_features()->{"available"}
578 0 0 unless &_openlibre_supports_allsheets()
581 0 0 unless &can_extract_allsheets() or &_openlibre_supports_named_sheet()
595 0 0 if ($$opts{"suppress_stderr"})
598 0 0 if ($$opts{"stdout_to_stderr"})
602 0 0 if ($$opts{"stderr_to_stdout"})
606 0 0 if ($$opts{"suppress_stdout"})
610 0 0 if ($redirs) { }
612 0 0 if /["']/
614 0 0 if $$opts{"verbose"}
617 0 0 if $$opts{"verbose"}
625 0 0 unless -e $outpath
626 0 0 if -f $outpath
627 0 0 unless -d $outpath
658 1 2 if $tempdir
676 0 0 if ($$seqnums{$bname}++)
679 0 0 if $args{"suf"}
704 0 0 unless &all(sub {
705 0 0 if $$opts{"allsheets"} and not &_openlibre_supports_allsheets()
706 0 0 if $$opts{"sheetname"} and not &_openlibre_supports_named_sheet()
716 0 0 if $debug
718 0 0 if (defined $saved_UserInstallation) { }
749 0 0 if ($$opts{'cvt_from'} eq 'csv') { }
750 0 0 unless my $filter_name = $$suf2ofilter{$$opts{"cvt_from"}}
754 0 0 if (my $cf = $$opts{"col_formats"})
755 0 0 unless ref $cf
758 0 0 unless /^([123459]|10)$/ or s/^standard$/1/i or s/^text$/2/i or s[^M+/D+/Y+$][3]i or s[^D+/M+/Y+$][4]i or s[^Y+/M+/D+$][5]i or s/^ignore$/9/i or s/^US.*English$/10/i
767 0 0 if $colformats
816 0 0 if ($$opts{'cvt_to'} eq 'csv') { }
817 0 0 unless my $filter_name = $$suf2ofilter{$$opts{"cvt_to"}}
862 0 0 $$opts{'sheetname'} ? :
0 0 $$opts{'allsheets'} ? :
895 0 0 $ifilter ? :
0 0 $ofilter ? :
899 0 0 unless ($debug)
906 0 0 if ($cmdstatus != 0)
914 0 0 if $debug
915 0 0 if (@result_files == 0)
916 0 0 unless -r $src
922 0 0 if ($$opts{"allsheets"})
927 0 0 unless (my $newbase = $base) =~ s/^\Q$$opts{"ifbase"}\E-//
930 0 0 if $debug
931 0 0 unless rename $oldpath, $newpath
937 0 0 if (-e $dst) { }
938 0 0 unless -d $dst
939 0 0 if $debug
941 0 0 if $debug
944 0 0 if $debug
946 0 0 if ($$opts{'allsheets'}) { }
947 0 0 if $debug
948 0 0 unless rename $tdir, $dst
950 0 0 if @result_files > 1
952 0 0 if $debug
1073 4 2 wantarray ? :
1097 0 0 if $embedded_sheetname and $sheetname and $embedded_sheetname ne $sheetname
1101 0 2 $sheetname ? :
1111 0 2 if ref $_[0] eq "HASH"
1113 2 0 scalar(@_) % 2 == 1 ? :
1120 0 2 if (defined $opts{'inpath'}) { }
1121 0 0 if defined $leading_inpath
1126 0 2 if $opts{"debug"}
1131 0 2 if (exists $opts{"sheet"})
1133 0 0 if exists $opts{"sheetname"}
1140 0 2 if (defined $sn)
1141 0 0 if $sheetname
1147 0 2 if ($opts{'sheetname'}) { }
0 2 elsif (defined $sheetname) { }
1151 0 0 if defined $sheetname and $sheetname ne $opts{"sheetname"}
1155 0 0 if $opts{"verbose"}
1160 0 2 $key && $key eq 'inpath' ? :
1174 0 0 unless /\A(<prefix>.*?)
1178 0 0 unless /^:(utf8)$/ or /^:encoding\(([^\)]+)\)$/
1436 0 0 if (&_openlibre_supports_allsheets()) { }
0 0 elsif (&_ssconvert_supports_allsheets()) { }
1446 0 0 unless &_openlibre_supports_named_sheet()
1454 0 0 if (&_openlibre_features()->{'available'}) { }
1455 0 0 if $$opts{"sheetname"} and not &_openlibre_supports_named_sheet()
1463 0 0 unless &_openlibre_features()->{"available"}
1472 0 0 if ($$opts{'sheetname'} and &_ssconvert_supports_writing($$opts{'cvt_to'})) { }
0 0 elsif (&_openlibre_supports_writing($$opts{'cvt_to'})) { }
0 0 elsif (&_ssconvert_supports_writing($$opts{'cvt_to'})) { }
1476 0 0 if ($$opts{"sheetname"})
1562 0 0 unless -d $outpath
1571 0 0 if (defined $$opts{'outpath'}) { }
1574 0 0 unless $$opts{"allsheets"}
1584 0 2 if $opts{"debug"}
1597 0 2 unless $opts{"cvt_from"} eq "csv" or $opts{"cvt_to"} eq "csv"
1598 0 2 if ($opts{"allsheets"})
1600 0 0 unless ($opts{"cvt_to"} // "") eq "csv"
1602 0 0 if $opts{"sheetname"}
1604 0 0 if $opts{"outpath"} and -e $opts{"outpath"} and not -d _
1608 2 0 if ($opts{"cvt_from"} eq $opts{"cvt_to"})
1609 2 0 if (not $opts{'allsheets'}) { }
1610 0 2 if ($input_enc ne $output_enc) { }
1613 0 0 if $opts{"debug"}
1622 0 2 if (defined $opts{'outpath'}) { }
1624 0 0 if $opts{"verbose"}
1630 0 2 if $opts{"verbose"}
1638 0 0 if $input_enc ne $output_enc
1645 0 0 if ($@ or not $s) { }
1646 0 0 if $opts{"debug"}
1648 0 0 if $opts{"verbose"}
1652 0 0 if $opts{"verbose"}
1657 0 2 unless ($done)
1658 0 0 if ($opts{'allsheets'}) { }
1663 0 0 if ($opts{'cvt_to'} eq 'csv') { }
1673 4 4 &blessed($v) ? :
1674 2 0 defined $output_enc ? :
1678 0 2 if $opts{"verbose"}
1693 0 2 @_ == 1 ? :
1699 0 2 if exists $opts{"path"} and not $opts{"silent"}
1703 0 2 unless $inpath
1704 0 2 if $opts{"outpath"}
1707 0 2 if exists $$h{"sheet"}
1710 0 2 unless open my $fh, "<", $csvpath
1711 0 2 unless binmode $fh, ":crlf:encoding(" . $$h{"encoding"} . ")"
1717 4 6 exists $$h{$_} ? :