Condition Coverage

lib/File/Util.pm
Criterion Covered Total %
condition 160 335 47.7


and 2 conditions

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

and 3 conditions

line !l l&&!r l&&r condition
56 21 0 3 exists $in->{'use_flock'} and defined $in->{'use_flock'}
62 24 0 0 exists $in->{'diag'} and defined $in->{'diag'}
78 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/
85 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/
127 0 0 32 defined $dir and length $dir
236 80 0 0 $opts->{'max_depth'} and $opts->{'_recursion'}{'_depth'} >= $opts->{'max_depth'}
246 80 0 0 $opts->{'_recursion'}{'_depth'} == $abort_depth and $abort_depth != 0
292 69 0 4 $dir_contents[0] eq '.' and $dir_contents[1] eq '..'
304 0 0 80 $dir ne '/' && !($dir =~ /^$File::Util::WINROOT$/)
313 396 0 66 -d $dir_base . $dir_entry and not -l $dir_base . $dir_entry
376 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
417 0 0 48 ref $dirs_ref and ref $dirs_ref eq 'ARRAY'
420 0 0 48 ref $files_ref and ref $files_ref eq 'ARRAY'
427 48 27 5 not $opts->{'_recursing'} and $opts->{'path_matches'} || $opts->{'parent_matches'}
458 77 3 0 $opts->{'dirs_only'} and $opts->{'count_only'}
461 62 18 0 $opts->{'files_only'} and $opts->{'count_only'}
553 21 21 9 $opts->{'files_match'} and $opts->{'dirs_match'}
731 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'
751 18 0 6 defined $pattern_ref && ref $pattern_ref eq 'HASH' && defined $pattern_ref->{'or'} && ref $pattern_ref->{'or'} eq 'ARRAY'
832 0 0 0 @predecessors > 1 and $predecessors[0] eq '/'
838 0 0 0 $root and $parent ne $root
843 0 0 0 exists $opts->{'dirmeta'} and defined $opts->{'dirmeta'}
0 0 0 exists $opts->{'dirmeta'} and defined $opts->{'dirmeta'} and $opts->{'dirmeta'} == 0
1260 72 0 1 exists $in->{'filename'} && defined $in->{'filename'} && length $in->{'filename'}
44 0 28 exists $in->{'file'} && defined $in->{'file'} && length $in->{'file'}
1267 26 3 44 not ref $maybe_file and $file eq ''
1317 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'}
1393 0 0 0 ref $in->{'onfail'} and ref $in->{'onfail'} eq 'CODE'
1400 0 0 0 exists $in->{'dbitmask'} && defined $in->{'dbitmask'}
1437 0 0 0 $in->{'binmode'} and lc $in->{'binmode'} eq 'utf8'
1511 20 0 2 $in->{'binmode'} and lc $in->{'binmode'} eq 'utf8'
1549 51 0 0 $in->{'binmode'} and lc $in->{'binmode'} eq 'utf8'
1694 0 0 128 $fh and ref $fh eq 'GLOB'
1875 0 0 26 defined $file and length $file
1887 25 1 0 -e $file and -d $file
1901 1 25 0 -e $path and not -r $path
1931 0 0 8 defined $f and -e $f
2091 0 0 10 defined $dir and length $dir
2194 20 40 0 -e $dir and not -d $dir
2251 0 0 0 &blessed($this) and $this->{'opts'}
2286 0 0 0 &blessed($this) and $this->{'opts'}
2305 0 0 0 &blessed($this) and $this->{'opts'}
2343 5 0 0 exists $in->{'filename'} && defined $in->{'filename'} && length $in->{'filename'}
4 0 1 exists $in->{'file'} && defined $in->{'file'} && length $in->{'file'}
2350 0 1 4 not ref $maybe_file and $file eq ''
2384 4 1 0 $mode eq 'read' and not -e $raw_name
2439 0 0 5 exists $File::Util::MODES->{'popen'}{$mode} and defined $File::Util::MODES->{'popen'}{$mode}
2456 0 0 0 exists $File::Util::MODES->{'sysopen'}{$mode} and defined $File::Util::MODES->{'sysopen'}{$mode}
2489 1 4 0 $mode ne 'read' and not -e $root . $path
2506 0 0 0 ref $in->{'onfail'} and ref $in->{'onfail'} eq 'CODE'
2513 0 0 0 exists $in->{'dbitmask'} && defined $in->{'dbitmask'}
2599 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')
2811 0 0 2 $fh and fileno $fh
2931 1 0 0 defined $in->{'diag'} && !$in->{'diag'}
2933 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
44 24 0 $this->_parse_in(@_) || {}
46 24 0 $in || {}
48 1 23 $this->{'opts'}{'onfail'} ||= 'die'
327 5 15 $opts->{'files_match'} || $opts->{'dirs_match'} || $opts->{'parent_matches'} || $opts->{'path_matches'} || 0
411 34 14 $opts->{'_patterns'} || {}
841 0 0 $ancestory->{$self} ||= {}
867 0 0 $$parent{strip_path($subdir)} ||= {}
970 56 0 shift @_ || ''
1243 10 63 $in->{'mode'} || 'write'
1244 0 73 $in->{'bitmask'} || 511
1741 172 4 $1 || ''
172 4 $2 || ''
164 12 $3 || ''
1871 26 0 shift @_ || ''
1992 5 0 $f ||= ''
2005 5 0 $f ||= ''
2018 2 0 $f ||= ''
2039 6 0 $dir ||= ''
2087 0 10 $bitmask ||= 511
2326 0 5 $in->{'bitmask'} || 511
2357 5 0 $mode ||= 'read'
2868 5 0 $f ||= ''
2921 1 0 $this->_parse_in(@_) || {}

or 3 conditions

line l !l&&r !l&&!r condition
146 0 0 32 $opts->{'recurse_fast'} or $opts->{'follow'}
179 0 0 32 $dir eq '/' || $dir =~ /^$File::Util::WINROOT/
341 25 48 7 $opts->{'recurse'} or $opts->{'with_paths'}
427 5 5 22 $opts->{'path_matches'} || $opts->{'parent_matches'}
991 56 0 0 length $root || length $path
1122 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
1194 0 0 56 $in->{'no_lock'} or $this->{'opts'}{'no_lock'}
1272 0 27 46 ref $maybe_content || exists $in->{'content'}
1317 0 27 46 !defined($content) || length $content == 0
1347 63 8 2 $mode eq 'write' or $mode eq 'append'
71 2 0 $mode eq 'write' or $mode eq 'append' or $mode eq 'trunc'
1363 73 0 0 length $root || length $path
1430 0 0 73 $in->{'no_lock'} or not $File::Util::USE_FLOCK
1639 0 0 72 $in->{'no_lock'} or not $File::Util::USE_FLOCK
1680 134 0 1 $fh or not scalar @policy
2053 1 4 1 $opts->{'as_list'} || $opts->{'as_listref'}
2355 0 1 4 ref $maybe_mode || exists $in->{'mode'}
2434 0 0 5 exists $in->{'use_sysopen'} || defined $in->{'use_sysopen'}
2476 5 0 0 length $root || length $path
2519 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'
2618 0 0 5 $in->{'no_lock'} or not $File::Util::USE_FLOCK
2619 0 0 0 exists $in->{'use_sysopen'} || defined $in->{'use_sysopen'}
2656 0 0 5 exists $in->{'use_sysopen'} || defined $in->{'use_sysopen'}
2933 0 0 1 $in->{'diag'} or $in->{'opts'} and ref $in->{'opts'} and ref $in->{'opts'} eq 'HASH' and $in->{'opts'}{'diag'}