Branch Coverage

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


line true false branch
79 259 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 259 0 if $dbh
122 259 0 if (my(@ka) = eval { do { "Text::CSV_XS"->known_attributes } })
123 7511 518 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 23 6278 unless (%compat_map)
212 23 6278 if ($class and not $class_mapped{$class}++ and my(@ka) = eval { do { $class->known_attributes } })
218 23 6278 if ($x)
238 5976 14 unless exists $meta->{'csv_skip_first_row'}
240 0 5976 exists $dbh->{'bom'} ? :
5976 14 unless exists $meta->{'csv_bom'}
252 275 16 unless ($csv_in)
257 275 5991 if $attr eq "eol"
258 421 5570 if exists $$dbh{"csv_$attr"}
262 0 6 'Text::CSV_XS'->version < 1.18 ? :
6 269 if $dbh->{'csv_null'} or $meta->{'csv_null'}
266 0 275 unless $eol =~ /^\A(?:[\r\n]|\r\n)\Z/
274 11 814 exists $$dbh{"csv_$attr"} ? :
0 825 exists $meta->{$attr} ? :
276 0 273 unless $meta->{'csv_in'} = $class->new(\%opts)
279 0 273 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 427 0 if ($meta and $meta->{'fh'})
307 2 425 if (my $types = $meta->{'types'})
313 5 1 $_ ? :
320 397 30 if (not $flags->{'createMode'})
326 3 247 exists $meta->{'col_names'} ? :
0 250 defined $meta->{'csv_skip_first_row'} ? :
147 250 defined $meta->{'skip_rows'} ? :
328 250 147 unless defined $meta->{'skip_rows'}
329 0 397 if ($meta->{'csv_bom'})
331 0 0 unless my(@hdr) = $attrs->{'csv_csv_in'}->header($meta->{'fh'})
333 0 0 if $skipRows
335 391 6 if ($skipRows--)
337 0 391 unless $array = $attrs->{'csv_csv_in'}->getline($meta->{'fh'})
338 391 0 unless ($meta->{'raw_header'})
342 249 142 unless defined $meta->{'col_names'}
350 135 262 if $flags->{'lockMode'}
352 397 0 if exists $meta->{'col_names'}
353 1 396 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 189 unless ($csv->print($fh, $fields))