Condition Coverage

lib/File/Util.pm
Criterion Covered Total %
condition 155 335 46.2


and 2 conditions

line l !l condition
200 0 0 warn sprintf("*WARNING! Filesystem loop detected at %s, dev %s, inode %s\n", $dir, $dev, $inode) and return ()
2680 0 1 "returning $lockstat" && (return $lockstat)

and 3 conditions

line !l l&&!r l&&r condition
58 21 0 3 exists $in->{'use_flock'} and defined $in->{'use_flock'}
64 24 0 0 exists $in->{'diag'} and defined $in->{'diag'}
80 21 0 3 exists $in->{'read_limit'} and defined $in->{'read_limit'}
21 0 3 exists $in->{'read_limit'} and defined $in->{'read_limit'} and not $in->{'read_limit'} =~ /\D/
87 21 0 3 exists $in->{'abort_depth'} and defined $in->{'abort_depth'}
21 0 3 exists $in->{'abort_depth'} and defined $in->{'abort_depth'} and not $in->{'abort_depth'} =~ /\D/
129 0 0 32 defined $dir and length $dir
238 80 0 0 $opts->{'max_depth'} and $opts->{'_recursion'}{'_depth'} >= $opts->{'max_depth'}
248 80 0 0 $opts->{'_recursion'}{'_depth'} == $abort_depth and $abort_depth != 0
294 73 0 0 $dir_contents[0] eq '.' and $dir_contents[1] eq '..'
306 0 0 80 $dir ne '/' && !($dir =~ /^$File::Util::WINROOT$/)
315 396 0 66 -d $dir_base . $dir_entry and not -l $dir_base . $dir_entry
378 25 0 0 $opts->{'max_depth'} && $opts->{'_recursion'}{'_depth'} == $opts->{'max_depth'} - 1
55 0 25 $opts->{'recurse'} and not $opts->{'max_depth'} && $opts->{'_recursion'}{'_depth'} == $opts->{'max_depth'} - 1
419 0 0 48 ref $dirs_ref and ref $dirs_ref eq 'ARRAY'
422 0 0 48 ref $files_ref and ref $files_ref eq 'ARRAY'
429 48 32 0 not $opts->{'_recursing'} and $opts->{'path_matches'} || $opts->{'parent_matches'}
460 77 3 0 $opts->{'dirs_only'} and $opts->{'count_only'}
463 62 18 0 $opts->{'files_only'} and $opts->{'count_only'}
555 21 30 0 $opts->{'files_match'} and $opts->{'dirs_match'}
733 17 0 7 defined $pattern_ref && ref $pattern_ref eq 'HASH' && defined $pattern_ref->{'and'} && ref $pattern_ref->{'and'} eq 'ARRAY'
44 6 11 defined $pattern_ref && ref $pattern_ref eq 'Regexp'
753 18 0 6 defined $pattern_ref && ref $pattern_ref eq 'HASH' && defined $pattern_ref->{'or'} && ref $pattern_ref->{'or'} eq 'ARRAY'
834 0 0 0 @predecessors > 1 and $predecessors[0] eq '/'
840 0 0 0 $root and $parent ne $root
845 0 0 0 exists $opts->{'dirmeta'} and defined $opts->{'dirmeta'}
0 0 0 exists $opts->{'dirmeta'} and defined $opts->{'dirmeta'} and $opts->{'dirmeta'} == 0
1262 72 0 1 exists $in->{'filename'} && defined $in->{'filename'} && length $in->{'filename'}
44 0 28 exists $in->{'file'} && defined $in->{'file'} && length $in->{'file'}
1269 26 3 44 not ref $maybe_file and $file eq ''
1319 46 2 25 !defined($content) || length $content == 0 and $mode ne 'trunc'
48 0 25 !defined($content) || length $content == 0 and $mode ne 'trunc' and not $File::Util::EMPTY_WRITES_OK
2 25 0 !defined($content) || length $content == 0 and $mode ne 'trunc' and not $File::Util::EMPTY_WRITES_OK and not $in->{'empty_writes_OK'}
25 0 0 !defined($content) || length $content == 0 and $mode ne 'trunc' and not $File::Util::EMPTY_WRITES_OK and not $in->{'empty_writes_OK'} and not $in->{'empty_writes_ok'}
1395 0 0 0 ref $in->{'onfail'} and ref $in->{'onfail'} eq 'CODE'
1402 0 0 0 exists $in->{'dbitmask'} && defined $in->{'dbitmask'}
1439 0 0 0 $in->{'binmode'} and lc $in->{'binmode'} eq 'utf8'
1513 20 0 2 $in->{'binmode'} and lc $in->{'binmode'} eq 'utf8'
1551 51 0 0 $in->{'binmode'} and lc $in->{'binmode'} eq 'utf8'
1696 0 0 128 $fh and ref $fh eq 'GLOB'
1877 0 0 26 defined $file and length $file
1889 25 1 0 -e $file and -d $file
1903 1 25 0 -e $path and not -r $path
1933 0 0 8 defined $f and -e $f
2093 0 0 10 defined $dir and length $dir
2196 20 40 0 -e $dir and not -d $dir
2253 0 0 0 &blessed($this) and $this->{'opts'}
2288 0 0 0 &blessed($this) and $this->{'opts'}
2307 0 0 0 &blessed($this) and $this->{'opts'}
2345 5 0 0 exists $in->{'filename'} && defined $in->{'filename'} && length $in->{'filename'}
4 0 1 exists $in->{'file'} && defined $in->{'file'} && length $in->{'file'}
2352 0 1 4 not ref $maybe_file and $file eq ''
2386 4 1 0 $mode eq 'read' and not -e $raw_name
2441 0 0 5 exists $File::Util::MODES->{'popen'}{$mode} and defined $File::Util::MODES->{'popen'}{$mode}
2458 0 0 0 exists $File::Util::MODES->{'sysopen'}{$mode} and defined $File::Util::MODES->{'sysopen'}{$mode}
2491 1 4 0 $mode ne 'read' and not -e $root . $path
2508 0 0 0 ref $in->{'onfail'} and ref $in->{'onfail'} eq 'CODE'
2515 0 0 0 exists $in->{'dbitmask'} && defined $in->{'dbitmask'}
2601 5 0 0 exists $in->{'use_sysopen'} and defined $in->{'use_sysopen'}
0 0 0 $in->{'binmode'} and lc $in->{'binmode'} eq 'utf8'
5 0 0 exists $in->{'use_sysopen'} and defined $in->{'use_sysopen'} and ($in->{'binmode'} and lc $in->{'binmode'} eq 'utf8')
2813 0 0 2 $fh and fileno $fh
2933 1 0 0 defined $in->{'diag'} && !$in->{'diag'}
2935 0 0 1 $in->{'opts'} and ref $in->{'opts'}
0 0 1 $in->{'opts'} and ref $in->{'opts'} and ref $in->{'opts'} eq 'HASH'
0 1 0 $in->{'opts'} and ref $in->{'opts'} and ref $in->{'opts'} eq 'HASH' and $in->{'opts'}{'diag'}

or 2 conditions

line l !l condition
46 24 0 $this->_parse_in(@_) || {}
48 24 0 $in || {}
50 1 23 $this->{'opts'}{'onfail'} ||= 'die'
329 5 15 $opts->{'files_match'} || $opts->{'dirs_match'} || $opts->{'parent_matches'} || $opts->{'path_matches'} || 0
413 34 14 $opts->{'_patterns'} || {}
843 0 0 $ancestory->{$self} ||= {}
869 0 0 $$parent{strip_path($subdir)} ||= {}
972 56 0 shift @_ || ''
1245 10 63 $in->{'mode'} || 'write'
1246 0 73 $in->{'bitmask'} || 511
1743 172 4 $1 || ''
172 4 $2 || ''
164 12 $3 || ''
1873 26 0 shift @_ || ''
1994 5 0 $f ||= ''
2007 5 0 $f ||= ''
2020 2 0 $f ||= ''
2041 6 0 $dir ||= ''
2089 0 10 $bitmask ||= 511
2328 0 5 $in->{'bitmask'} || 511
2359 5 0 $mode ||= 'read'
2870 5 0 $f ||= ''
2923 1 0 $this->_parse_in(@_) || {}

or 3 conditions

line l !l&&r !l&&!r condition
148 0 0 32 $opts->{'recurse_fast'} or $opts->{'follow'}
181 0 0 32 $dir eq '/' || $dir =~ /^$File::Util::WINROOT/
343 25 0 55 $opts->{'recurse'} or $opts->{'with_paths'}
429 5 0 27 $opts->{'path_matches'} || $opts->{'parent_matches'}
993 56 0 0 length $root || length $path
1124 0 0 56 $in->{'no_lock'} or $this->{'opts'}{'no_lock'}
0 0 56 $in->{'no_lock'} or $this->{'opts'}{'no_lock'} or not $this->use_flock
1196 0 0 56 $in->{'no_lock'} or $this->{'opts'}{'no_lock'}
1274 0 27 46 ref $maybe_content || exists $in->{'content'}
1319 0 27 46 !defined($content) || length $content == 0
1349 63 8 2 $mode eq 'write' or $mode eq 'append'
71 2 0 $mode eq 'write' or $mode eq 'append' or $mode eq 'trunc'
1365 73 0 0 length $root || length $path
1432 0 0 73 $in->{'no_lock'} or not $File::Util::USE_FLOCK
1641 0 0 72 $in->{'no_lock'} or not $File::Util::USE_FLOCK
1682 134 0 1 $fh or not scalar @policy
2055 1 4 1 $opts->{'as_list'} || $opts->{'as_listref'}
2357 0 1 4 ref $maybe_mode || exists $in->{'mode'}
2436 0 0 5 exists $in->{'use_sysopen'} || defined $in->{'use_sysopen'}
2478 5 0 0 length $root || length $path
2521 3 1 1 $mode eq 'write' or $mode eq 'append'
4 0 1 $mode eq 'write' or $mode eq 'append' or $mode eq 'rwcreate'
1 0 1 $mode eq 'write' or $mode eq 'append' or $mode eq 'rwcreate' or $mode eq 'rwclobber'
0 0 1 $mode eq 'write' or $mode eq 'append' or $mode eq 'rwcreate' or $mode eq 'rwclobber' or $mode eq 'rwappend'
1 0 0 $mode eq 'read' or $mode eq 'rwupdate'
2620 0 0 5 $in->{'no_lock'} or not $File::Util::USE_FLOCK
2621 0 0 0 exists $in->{'use_sysopen'} || defined $in->{'use_sysopen'}
2658 0 0 5 exists $in->{'use_sysopen'} || defined $in->{'use_sysopen'}
2935 0 0 1 $in->{'diag'} or $in->{'opts'} and ref $in->{'opts'} and ref $in->{'opts'} eq 'HASH' and $in->{'opts'}{'diag'}