Branch Coverage

blib/lib/CAM/DBF.pm
Criterion Covered Total %
branch 42 154 27.2


line true false branch
101 2 0 if (@_ % 2 == 0)
106 1 1 if (not defined $filemode or $filemode eq '')
111 0 2 unless ($filemode_open_map{$filemode})
148 0 2 if ($$self{'filename'} eq '-') { }
151 0 0 if ($$self{'filemode'} =~ /r/msx) { }
163 2 0 if (open $fh, $filemode_open_map{$$self{'filemode'}}, $$self{'filename'})
168 0 2 unless ($$self{'fh'})
233 0 1 if (not $$self{'valid'} or $$self{'valid'} != 3 and $$self{'valid'} != 131)
242 0 1 if ($$self{'filesize'} < $$self{'nheaderbytes'})
244 0 0 unless ($$self{'flags'}{'ignoreHeaderBytes'})
254 1 0 if ($$self{'year'} < 1970)
287 0 1 if ($$self{'flags'}{'ignoreHeaderBytes'})
293 0 0 unless ($$self{'flags'}{'allowOffByOne'} and abs $oldvalue - $newvalue <= 1)
296 0 0 if ($$self{'flags'}{'verbose'} and $oldvalue != $$self{'nheaderbytes'})
306 6 0 if ($$field{'type'} =~ /\A[CLND]\z/msx) { }
363 0 0 if ($_[0] eq '-quick') { }
0 0 elsif ($filemode_open_map{$_[0]}) { }
383 0 1 if ($quick)
385 0 0 unless ($pkg->validateColumns(@columns))
392 0 1 unless $self
398 0 1 unless ($self->writeHeader)
421 0 0 if (@columns == 0 and ref $pkg_or_self)
432 0 0 if (not $column && ref $column or 'HASH' ne ref $column)
439 0 0 if (not defined $$column{$key} or $$column{$key} =~ /\A\s*\z/msx)
445 0 0 if (11 < length $$column{'name'})
450 0 0 if ($col_names{$$column{'name'}}++)
455 0 0 unless ($$column{'type'} =~ /\A[CNDL]\z/msx)
460 0 0 unless ($$column{'length'} =~ /\A\d+\z/msx)
465 0 0 unless ($$column{'decimals'} =~ /\A\d+\z/msx)
470 0 0 if ($$column{'type'} eq 'L' and $$column{'length'} != 1)
475 0 0 if ($$column{'type'} eq 'D' and $$column{'length'} != 8)
572 7554 0 if (defined $row)
633 0 7554 unless $A_row
641 45324 0 if (defined $v) { }
651 15108 30216 if ($$column{'type'} eq 'N') { }
15108 15108 elsif ($$column{'type'} eq 'C') { }
7554 7554 elsif ($$column{'type'} eq 'L') { }
7554 0 elsif ($$column{'type'} eq 'D') { }
653 15108 0 if ($v =~ /\d/msx) { }
668 0 7554 !$v || $v =~ /[nNfF]/msx ? :
679 0 45324 if ($l > $$column{'length'})
729 0 15108 if ($ROWCACHE == 0) { }
14956 152 elsif ($$self{'rowcache'} and $rownum < $$self{'rowcache2'} and $rownum >= $$self{'rowcache1'}) { }
732 0 0 $A_rows ? :
741 2 150 if ($rownum + $num >= $$self{'nrecords'})
771 0 15108 if ($delete != 32)
782 30216 60432 if ($type eq 'C') { }
30216 30216 elsif ($type eq 'N') { }
15108 15108 elsif ($type eq 'L') { }
835 0 0 if ($col =~ /\D/msx) { }
839 0 0 if $$field{'name'} eq $col
863 0 0 unless $field
881 0 0 unless $field
899 0 0 unless $field
917 0 0 unless $field
948 0 15108 if ($rownum < 0 or $rownum >= $$self{'nrecords'})
972 0 0 if ($row_start + $row_count > $$self{'nrecords'})
977 0 0 if ($row_start < 0 or $row_start >= $$self{'nrecords'})
979 0 0 if ($row_start >= $$self{'nrecords'})
1003 0 7554 unless $ref
1025 0 0 unless $ref
1067 0 0 unless $rownum
1068 0 0 if $rownum < 0 or $rownum >= $$self{'nrecords'}
1075 0 0 if (open $fh, '+<', $$self{'filename'})
1089 0 0 $result ? :
1134 0 0 if (@_ > 0 and not $_[0] =~ /\A\-/msx)
1143 0 0 if ($key =~ /\A\-(\w+)\z/msx and exists $args{$1} and @_ > 0) { }
1154 0 0 if ($args{'startrow'} < 0 or $args{'endrow'} >= $self->nrecords)
1159 0 0 if $args{'startrow'} > $args{'endrow'}
1162 0 0 if ($args{'showheader'})
1163 0 0 $args{'enclose'} eq '' && $args{'escape'} eq '' ? :
1171 0 0 unless $aref
1172 0 0 if ($args{'enclose'} ne '' or $args{'escape'} ne '')
1293 0 0 if ($self->nRecordBytes != $row_size)
1300 0 0 if ($n_records != $self->nrecords)
1317 0 0 if ($escape ne '')
1320 0 0 if ($enclose ne '')