Branch Coverage

blib/lib/Finance/QIF.pm
Criterion Covered Total %
branch 90 104 86.5


line true false branch
174 15 10 if ($opt{'file'})
183 19 36 if (@_)
184 1 18 ref $_[0] eq 'ARRAY' ? :
187 53 2 if ($$self{'file'}) { }
188 17 36 wantarray ? :
202 16 18621 if (@_)
204 0 16 unless $$self{'_filehandle'} = 'IO::File'->new(@args)
209 5 18632 unless ($$self{'_filehandle'})
217 1 16 if (@_)
220 16 1 if ($self->file) { }
222 8 8 if ($$self{'autodetect'})
223 7 1 if ($self->_filehandle->seek(-2, 2))
226 1 6 if ($buffer eq "\r\n") { }
5 1 elsif ($buffer =~ /\012$/) { }
1 0 elsif ($buffer =~ /\015$/) { }
249 1 695 if ($self->_filehandle->eof)
252 695 0 if (exists $$self{'header'})
257 2 7366 if $line =~ /^\s*$/
259 75 7291 if ($field eq '!') { }
263 0 75 unless (exists $header{$value})
268 695 6596 if ($field eq '^') { }
272 0 6596 if (not exists $header{$object{'header'}} || exists $header{'split'} && ($object{'header'} eq 'noninvestment' || $object{'header'} eq 'memorized')) { }
132 6464 elsif ($object{'header'} eq 'Type:Prices') { }
215 6249 elsif ($field eq 'A' and $header{$object{'header'}}{$field} eq 'address') { }
24 6225 elsif ($field eq 'S' and $header{$object{'header'}}{$field} eq 'splits') { }
46 6179 elsif ($field eq 'E' || $field eq '$' and $csplit) { }
3492 2687 elsif ($field eq 'B' and $header{$object{'header'}}{$field} eq 'budget') { }
2687 0 elsif (exists $header{$object{'header'}}{$field}) { }
291 9 206 if ($$self{'header'} eq 'Type:Payee')
294 0 9 if (length $value == 0) { }
302 6 209 if (exists $object{$header{$object{'header'}}{$field}} and $object{$header{$object{'header'}}{$field}} ne '')
338 695 0 if (scalar keys %object > 1) { }
350 141 7225 if (not $line =~ /^!/ and exists $$self{'header'} and $$self{'header'} eq 'Type:Prices') { }
360 120 21 if (scalar @data > 3)
370 32 7193 if ($$self{'trim_white_space'})
410 6 17 if (exists $header{$header}{'S'} and $header{$header}{'S'} eq 'splits')
417 0 23 if (not exists $header{$header})
425 231 0 if ($$record{'header'} eq $$self{'currentheader'}) { }
426 3 228 if ($$record{'header'} eq 'Type:Prices') { }
427 3 0 if (exists $$record{'symbol'} and exists $$record{'prices'}) { }
429 40 4 if (exists $$price{'close'} and exists $$price{'date'} and exists $$price{'max'} and exists $$price{'min'} and exists $$price{'volume'}) { }
4 0 elsif (exists $$price{'close'} and exists $$price{'date'}) { }
469 6 1000 if $value eq 'header' or $value eq 'splits' or $$self{'currentheader'} eq 'Type:Memorized' and $value eq 'transaction'
474 1000 0 if (exists $$self{'reversemap'}{$value}) { }
475 13 987 if ($value eq 'address') { }
97 890 elsif ($value eq 'budget') { }
477 1 12 if ($$self{'currentheader'} eq 'Type:Payee') { }
481 1 2 if ($count <= $#lines) { }
492 0 72 if ($count <= $#lines) { }
517 3 225 if (exists $$record{'splits'})
520 23 1 if (exists $$s{$key}) { }
531 3 225 if ($$self{'currentheader'} eq 'Type:Memorized' and exists $$record{'transaction'})