Branch Coverage

blib/lib/File/MimeInfo.pm
Criterion Covered Total %
branch 114 176 64.7


line true false branch
33 0 21 unless defined $file
42 0 29 if $DEBUG
43 13 16 unless lstat $file
44 14 2 if -f _
45 0 0 -S _ ? :
0 0 -b _ ? :
0 0 -c _ ? :
0 0 -p _ ? :
1 0 -d _ ? :
1 1 -l $file ? :
51 1 1 if ($t eq 'inode/directory') { }
56 0 1 if -l $file
59 0 1 unless (stat $dir)[0] == $dev
62 1 0 $t ? :
67 0 25 unless defined $file
68 1 24 unless $_hashed
70 0 25 if $DEBUG
72 1 24 if exists $literal{$file}
74 11 13 if ($file =~ /\.(\w+(\.\w+)*)$/)
78 0 16 if $DEBUG
79 0 16 if wantarray
83 0 10 wantarray ? :
10 6 if exists $extension{$ext}
89 12 2 unless $file =~ /$_->[1]/
90 0 2 if $DEBUG
94 1 11 if $file =~ /[A-Z]/
100 0 8 unless defined $file
103 0 0 do { ref $file eq 'Path::Tiny' } ? :
0 8 ref $file ? :
104 1 7 unless -f $file
105 0 7 if $DEBUG
106 1 6 if -z $file
108 0 6 unless open FILE, "<", $file
109 6 0 unless $] < "5.008"
114 0 0 unless $file->exists
115 0 0 if $DEBUG
117 0 0 unless open my $fh, "<", $file
118 0 0 unless $] < "5.008"
123 0 0 if $DEBUG
131 2 4 if ($] < 5.008 or not utf8::valid($line)) { }
134 0 2 unless $line =~ /[\x00-\x1F\x7F]/
138 3 1 unless $line =~ /[^[:print:]\s]/
141 0 3 if $DEBUG
149 1 0 if -e $_
1 3 @DIRS ? :
151 3 1 if (@globfiles) { }
159 2 3 if grep {$file eq $_;} @done
169 3 0 unless $] < "5.008"
172 3 30 if /^\s*#/ or not /\S/
175 24 3 do { $glob =~ /^\*\.(\w+(\.\w+)*)$/ } ? :
27 3 $glob =~ /[\?\*\[]/ ? :
177 21 3 unless exists $extension{$1}
178 21 3 unless defined $mime2ext{$string}
182 0 3 unless close GLOB
194 1 0 unless $_hashed
200 1 1 unless $_hashed
201 2 0 if exists $mime2ext{$mimet}
202 1 0 $ref ? :
1 1 if wantarray
203 1 0 $ref ? :
207 0 2 if ref $_[0]
209 0 2 unless $mt
211 2 0 unless defined $lang
212 1 1 $lang ? :
215 0 0 if -e $_
0 2 @DIRS ? :
220 2 0 unless $] < "5.008"
222 18 2 unless m[(.*?)]
226 0 2 unless close XML
227 2 0 if $desc
234 0 16 unless defined $mimet
235 2 14 unless $_hashed_aliases
236 1 15 exists $aliases{$mimet} ? :
247 0 0 if -e $_
0 3 @DIRS ? :
251 3 3 if grep {$_ eq $file;} @done
253 3 0 unless $] < "5.008"
255 0 6 unless $line =~ /\S/
256 0 6 if $line =~ /^\s*#/
259 2 4 if ($list) { }
260 1 1 unless $map{$k}
274 2 3 if (ref $mimet or not defined $mimet) { }
282 1 4 unless $_hashed_subclasses
285 1 4 if $mimet eq "inode/mount-point"
286 2 3 if exists $subclasses{$mimet}
287 2 3 if $mimet =~ m[^text/]
288 4 1 unless $mimet =~ m[^inode/]
290 3 2 $parent ? :