Branch Coverage

blib/lib/DBD/CSV.pm
Criterion Covered Total %
branch 78 110 70.9


line true false branch
79 255 0 if ($attr and ref $attr eq 'HASH')
83 0 3 if exists $attr->{$f_key}
88 0 3 if exists $attr->{$c_key}
94 255 0 if $dbh
122 255 0 if (my(@ka) = eval { do { 'Text::CSV_XS'->known_attributes } })
123 6885 510 if /^[a-su-z]/
151 0 1 if $table
152 1 0 unless ($meta)
158 1 0 if $dvsn
166 0 209 if ref $v eq 'CODE'
207 22 6070 unless (%compat_map)
212 22 6070 if ($class and not $class_mapped{$class}++ and my(@ka) = eval { do { $class->known_attributes } })
218 22 6070 if ($x)
238 5771 14 unless exists $meta->{'csv_skip_first_row'}
240 0 5771 exists $dbh->{'bom'} ? :
5771 14 unless exists $meta->{'csv_bom'}
252 271 16 unless ($csv_in)
257 271 6118 if $attr eq 'eol'
258 421 5697 if exists $$dbh{"csv_$attr"}
262 0 6 'Text::CSV_XS'->version < 1.18 ? :
6 265 if $dbh->{'csv_null'} or $meta->{'csv_null'}
266 0 271 unless $eol =~ /^\A(?:[\r\n]|\r\n)\Z/
274 11 802 exists $$dbh{"csv_$attr"} ? :
0 813 exists $meta->{$attr} ? :
276 0 271 unless $meta->{'csv_in'} = $class->new(\%opts)
279 0 271 unless $meta->{'csv_out'} = $class->new(\%opts)
290 3 17 if (exists $csv_xs_attr{$csv_attr})
293 6 0 if exists $meta->{$_} and exists $meta->{$_}{$csv_attr}
304 423 0 if ($meta and $meta->{'fh'})
307 2 421 if (my $types = $meta->{'types'})
313 5 1 $_ ? :
320 395 28 if (not $flags->{'createMode'})
326 3 245 exists $meta->{'col_names'} ? :
0 248 defined $meta->{'csv_skip_first_row'} ? :
147 248 defined $meta->{'skip_rows'} ? :
328 248 147 unless defined $meta->{'skip_rows'}
329 0 395 if ($meta->{'csv_bom'})
331 0 0 unless my(@hdr) = $attrs->{'csv_csv_in'}->header($meta->{'fh'})
333 0 0 if $skipRows
335 389 6 if ($skipRows--)
337 0 389 unless $array = $attrs->{'csv_csv_in'}->getline($meta->{'fh'})
338 389 0 unless ($meta->{'raw_header'})
342 247 142 unless defined $meta->{'col_names'}
350 133 262 if $flags->{'lockMode'}
352 395 0 if exists $meta->{'col_names'}
353 1 394 if (not $meta->{'col_names'} && @{$meta->{'col_names'};})
373 0 4 unless defined $diag[$_]
384 1 1176 if exists $tbl->{'cached_row'}
387 0 1176 unless my $csv = $self->{'csv_csv_in'}
390 285 891 unless ($fields)
391 283 2 if $csv->eof
394 0 2 if $diag[0] == 2012
400 0 891 if @$fields < @{$tbl->{'col_names'};}
401 891 0 @$fields ? :
410 0 187 unless ($csv->print($fh, $fields))