Branch Coverage

blib/lib/Filter/Crypto/CryptFile.pm
Criterion Covered Total %
branch 47 110 42.7


line true false branch
83 0 16 if $constant eq 'constant'
89 0 16 if $error
105 81 16 if (@_ == 1 or @_ == 2 and !defined($_[1]) || $_[1] eq '' || &_isa_cryptmode($_[1])) { }
110 4 77 if (&_isa_filehandle($_[0])) { }
77 0 elsif (&_isa_filename($_[0])) { }
116 1 76 unless (sysopen $fh, $file, 2)
126 80 0 if (-f $fh)
127 0 80 unless (flock $fh, 6)
131 0 0 if $opened
137 8 72 @_ == 2 && defined $_[1] && $_[1] ne '' ? :
140 0 80 unless (&_crypt_fh($fh, $crypt_mode, $num_bytes))
142 0 0 $flocked ? :
0 0 $opened ? :
146 76 4 if ($opened) { }
4 0 elsif ($flocked) { }
147 0 76 unless close $fh
151 0 4 unless flock $fh, 8
157 8 8 if (&_isa_filehandle($_[0])) { }
8 0 elsif (&_isa_filename($_[0])) { }
163 0 8 unless (sysopen $in_fh, $in_file, 0)
173 16 0 if (-f $in_fh)
174 0 16 unless (flock $in_fh, 5)
177 0 0 if $in_opened
184 8 8 if (&_isa_filehandle($_[1])) { }
8 0 elsif (&_isa_filename($_[1])) { }
190 0 8 unless (sysopen $out_fh, $out_file, 577)
195 0 0 $in_flocked ? :
0 0 $in_opened ? :
203 0 0 $in_flocked ? :
0 0 $in_opened ? :
208 16 0 if (-f $out_fh)
209 0 16 unless (flock $out_fh, 6)
213 0 0 $in_flocked ? :
0 0 $in_opened ? :
215 0 0 if $out_opened
222 12 4 if (@_ == 3 and defined $_[2] and $_[2] ne '') { }
223 12 0 if (&_isa_cryptmode($_[2])) { }
228 0 0 $in_flocked ? :
0 0 $in_opened ? :
230 0 0 $out_flocked ? :
0 0 $out_opened ? :
239 0 16 unless (&_crypt_fhs($in_fh, $out_fh, $crypt_mode, $num_bytes))
241 0 0 $in_flocked ? :
0 0 $in_opened ? :
243 0 0 $out_flocked ? :
0 0 $out_opened ? :
248 8 8 if ($in_opened) { }
8 0 elsif ($in_flocked) { }
249 0 8 unless close $in_fh
253 0 8 unless flock $in_fh, 8
258 8 8 if ($out_opened) { }
8 0 elsif ($out_flocked) { }
259 0 8 unless close $out_fh
263 0 8 unless flock $out_fh, 8
269 92 4 $num_bytes ? :