Condition Coverage

blib/lib/File/Unpack.pm
Criterion Covered Total %
condition 51 254 20.0


and 3 conditions

line !l l&&!r l&&r condition
403 0 0 3 defined $opt{'vcs'} and $opt{'vcs'}
404 0 3 0 defined $opt{'vcs'} and not $opt{'vcs'}
462 0 4 0 $r and $r != length $text
563 0 0 0 $free_b >= $needed_b and $free_i >= $needed_i
0 0 0 $free_b >= $needed_b and $free_i >= $needed_i and 100 - $perc > $needed_p
606 3 0 4 $obj{'verbose'} and not $>
665 0 7 0 defined $obj{'helper_dir'} and -d $obj{'helper_dir'}
695 5 0 2 $$self{'input'} || ($$self{'lfp_printed'} || 0) || ($$self{'recursion_level'} || 0) and $$self{'lfp'}
866 2 13 0 $archive =~ m[^/] and $archive =~ m[^\Q$$self{'destdir'}\E/]
874 15 0 0 $$self{'follow_file_symlinks'} and $archive =~ m[^(.*)/(.*?)$]
964 0 3 10 $$self{'exclude'}{'re'} and $f =~ /$$self{'exclude'}{'re'}/
974 13 0 0 $symlink_to_skip and $$self{'follow_file_symlinks'} > $dangeous_symlink
1006 10 0 2 $self->_not_excluded($subdir, $in_file) and not defined $$self{'done'}{$archive}
1063 0 0 0 $$h{'suffix_re'} and $new_name =~ s/[\._-]$$h{'suffix_re'}(?:\._\d*)?$//i
1336 0 0 0 $t and $t->is_expired
1365 0 0 413 @a and defined $a[0]
1541 0 0 0 $nonzero[0] and $$self{'verbose'}
1570 0 0 0 defined $found[0] and $found[0] =~ /^(.*)$/s
1594 0 0 0 $$self{'verbose'} > 1 and defined $wanted_name
0 0 0 $$self{'verbose'} > 1 and defined $wanted_name and not $wanted_name =~ /^\Q$$args{'destfile'}\E/
1601 0 0 0 defined $wanted_name and not -e $wanted_path
1611 0 0 0 defined $found[0] and $found[0] =~ /^(.*)$/s
1613 0 0 0 $#found == 0 and $found0 eq $wanted_name
1631 0 0 0 -f $unpacked and not -l $unpacked
2038 0 0 0 defined $$self{'mime_orcish'}{$mimetype} and -f $$self{'mime_orcish'}{$mimetype}{'argvv'}[0][0]
2276 1 3 0 not $#in and ref $in[0] eq 'HASH'
2313 0 0 0 defined $in{'file'} and -f $in{'file'}
2340 0 0 0 $mime1 eq 'text/plain' and $r[2] =~ /(?:PostScript|font)/i
2371 0 0 0 $mime2 and $mime2 =~ m[^(.*)/(.*)$]
2396 0 0 0 $mime2 and $mime2 =~ m[^image/]
2467 0 0 0 $stat == 'LZMA_OK' || $stat == 'LZMA_STREAM_END' and length $uncomp_buf > length $saved_input
2495 0 0 0 $r[0] =~ m[^application/(?:x-)?bzip2$] and not $in{'recursion'}
2519 0 0 0 length $uncomp_buf and $r[0] =~ m[^application/(x-)?([+\w]+)$]
2550 0 0 0 $r[0] eq 'application/unknown+zip' and $r[2] =~ /\btext\b/i
2563 0 0 0 $r[0] eq 'text/plain' and $in{'file'} =~ /\.(mm|b64|base64)$/i
2569 0 0 0 $r[0] eq 'application/octet-stream' and $in{'file'} =~ /\.(lzma|zx|lz)$/i
2587 0 0 0 $mime2 and $mime2 ne $mime1

or 2 conditions

line l !l condition
384 12 0 $dir ||= ''
561 0 0 $total_b || 1
581 3 4 $obj{'destdir'} ||= '.'
582 3 4 $obj{'logfile'} ||= \*STDOUT
583 0 7 $obj{'log_type'} ||= 'json'
585 0 7 $ENV{'FILE_UNPACK_MAXFILESIZE'} || '2.5G'
595 0 7 $obj{'jail_chmod0'} ||= 0
597 0 7 $obj{'no_op'} ||= 0
604 0 7 $obj{'follow_file_symlinks'} ||= 0
653 0 7 $obj{'fs_warn'} || \&_default_fs_warn
707 2 0 $$self{'recursion_level'} || 0
859 13 2 $$self{'recursion_level'} || 0
950 0 0 $$self{'file_count'} || 0
1275 0 0 $$opt{'in'} ||= \(undef)
1278 0 0 $$opt{'out'} ||= sub { print "O: ($cmdname) @_\n"; }
1279 0 0 $$opt{'err'} ||= sub { print "E: ($cmdname) @_\n"; }
1421 0 0 $$self{'dot_dot_safeguard'} || 0
1507 0 0 $$p{$pid}{'fd'}{$fd}{'pos'} || 0
0 0 $_[1]{'fuser'}{$pid}{'fd'}{$fd}{'pos'} || 0
1518 0 0 $$p{'fastest_fd'}{'pos'} || 0
1519 0 0 $$p{'fastest_fd'}{'size'} || -s $_[1]{'watch'} || 1
1687 0 0 $ppid ||= 1
2208 21 0 $$self{'minfree'}{$i} ||= 0
2291 0 0 $in{'file'} || '-'
2412 0 0 $mime2 ||= 'application/x-text-mixed'

or 3 conditions

line l !l&&r !l&&!r condition
493 0 0 0 $$self{'json'} ||= 'JSON'->new->ascii(1)
550 0 0 0 open $DIR, '<', $$self{'destdir'} or opendir $DIR, $$self{'destdir'}
577 0 7 0 ref $self || $self
599 0 0 7 $obj{'one_shot'} ||= $obj{'no_op'}
608 1 2 4 ref $obj{'logfile'} eq 'SCALAR' or not ref $obj{'logfile'}
636 7 0 0 $have[0] == RLIM_INFINITY() or $have[0] > $obj{'maxfilesize'}
639 7 0 0 &BSD::Resource::setrlimit(RLIMIT_FSIZE(), $obj{'maxfilesize'}, RLIM_INFINITY()) or &BSD::Resource::setrlimit(RLIMIT_FSIZE(), $obj{'maxfilesize'}, $obj{'maxfilesize'})
695 2 0 5 $$self{'input'} || ($$self{'lfp_printed'} || 0) || ($$self{'recursion_level'} || 0)
898 0 2 0 $$self{'json'} ||= 'JSON'->new->ascii(1)
981 12 1 0 -f $new_in or -d _
1020 0 0 0 $$m[0] eq 'text/plain' or not $h
1087 0 0 0 ref $unpacked or -e $unpacked
1094 0 0 0 readlink $unpacked or '' eq $archive
1276 0 0 0 $$opt{'out'} ||= $$opt{'out_err'}
1277 0 0 0 $$opt{'err'} ||= $$opt{'out_err'}
1722 0 0 0 $pid == $ppid or $pid == 1
1750 0 0 0 $o{$p}{'cmd'} ||= $p{$p}{'cmd'}
1899 161 28 0 $#{$args[0];} or defined $args[1]
2277 1 0 3 $#in or ref $in[0]
2280 0 0 4 $$self{'flm'} ||= 'File::LibMagic'->new
2308 0 0 0 $mime1 =~ /, corrupt: / or $mime1 =~ m[^application/octet-stream\b]
2325 0 0 0 $mime1 =~ /^(.*?);\s*(.*)$/ or $mime1 =~ /^(.*?)\s+(.*)$/
2340 0 0 0 $mime1 eq 'text/plain' and $r[2] =~ /(?:PostScript|font)/i or $mime1 eq 'application/postscript'
2353 0 0 0 $mime2 ||= eval { do { open my $fd, '<', \$in{'buf'}; File::MimeInfo::Magic::magic($fd) } }
2370 0 0 0 $mime2 ||= eval { do { open my $fd, '<', \$in{'buf'}; File::MimeInfo::Magic::magic($fd) } }
2379 0 0 0 $r[0] eq 'text/plain' or $r[0] eq 'application/octet-stream'
2395 0 0 0 $mime2 ||= eval { do { open my $fd, '<', \$in{'buf'}; File::MimeInfo::Magic::magic($fd) } }
2407 0 0 0 $mime2 ||= eval { do { open my $fd, '<', \$in{'buf'}; File::MimeInfo::Magic::magic($fd) } }
2467 0 0 0 $stat == 'LZMA_OK' || $stat == 'LZMA_STREAM_END'
2555 0 0 0 $mime2 ||= eval { do { open my $fd, '<', \$in{'buf'}; File::MimeInfo::Magic::magic($fd) } }
2587 0 0 0 $mime1 ne $r[0] or $mime2 and $mime2 ne $mime1