Condition Coverage

blib/lib/Text/CSV_XS.pm
Criterion Covered Total %
condition 397 466 84.9


and 3 conditions

line !l l&&!r l&&r condition
135 3564 3 2 defined $quo and length $quo
138 2 3325 242 defined $quo and $quo =~ /^[ \t]/
139 4 3033 290 defined $esc and $esc =~ /^[ \t]/
149 11975 418 35 defined $sep and length $sep
151 12396 14 18 defined $quo and length $quo
189 92 903 8 @_ > 0 and ref $_[0] ne "HASH"
212 1 6 2713 /^[a-z]/ and exists $def_attr{$_}
214 21 2491 201 defined $attr{$_} and /_char$/
232 963 4 21 $quote_aliased and defined $attr{'quote_char'}
249 623 324 6 defined $self->{'callbacks'} and ref $self->{'callbacks'} ne "HASH"
255 943 2 8 defined $\ and not exists $attr{'eol'}
358 6 6 6 defined $quote && length $quote
403 5 328 21 defined $sep && length $sep
475 0 912 61 $self and $f
912 56 5 $self and $f and ref $f
968 0 5 $self and $f and ref $f and ref $f eq "CODE"
513 0 13 89 $self and $f
13 81 8 $self and $f and ref $f
94 2 6 $self and $f and ref $f and ref $f eq "CODE"
689 28 4 8 @_ == 1 && ref $_[0] eq 'HASH'
695 4 10 23 $cbk =~ /^[\w.]+$/ and ref $cb->{$cbk} eq "CODE"
723 66 4 1750 $self and ref $self
1 108 1641 UNIVERSAL::isa($self, __PACKAGE__) and exists $self->{'_ERROR_DIAG'}
70 108 1642 $self and ref $self and (UNIVERSAL::isa($self, __PACKAGE__) and exists $self->{'_ERROR_DIAG'})
730 0 1577 64 exists $self->{'_ERROR_SRC'} and $self->{'diag_verbose'}
733 7 1345 289 $diag[0] and $self->{'callbacks'}
1345 279 10 $diag[0] and $self->{'callbacks'} and $self->{'callbacks'}{'error'}
738 10 297 36 $diag[0] and $diag[0] != 2012
743 3 1 32 $self and ref $self
750 16 0 16 $self->{'diag_verbose'} and $self->{'_ERROR_INPUT'}
756 18 11 0 @c >= 11 and $c[10]
11 0 0 @c >= 11 and $c[10] and ref $c[10] eq "HASH"
760 0 0 0 exists $hints->{'autodie'} and $hints->{'autodie'}
0 0 0 exists $hints->{'guard Fatal'} and not exists $hints->{'no Fatal'}
816 3 1 8 ref $self->{'_FFLAGS'} and $idx >= 0
4 1 7 ref $self->{'_FFLAGS'} and $idx >= 0 and $idx < @{$self->{'_FFLAGS'};}
823 1 1 9 ref $self->{'_FFLAGS'} and $idx >= 0
2 1 8 ref $self->{'_FFLAGS'} and $idx >= 0 and $idx < @{$self->{'_FFLAGS'};}
849 1 1 1395 @_ > 0 && $self->Combine(\$str, \@_, 0)
874 6 205 1732 defined $str and $self->Parse($str, $fields, $fflags)
893 315 235 138 @keys == 1 and not defined $keys[0]
895 315 9 226 @keys == 1 and ref $keys[0] eq "ARRAY"
902 543 1 1 $self->{'_BOUND_COLUMNS'} and @keys != @{$self->{'_BOUND_COLUMNS'};}
928 330 0 1 defined $args{'munge'} and not defined $args{'munge_column_names'}
948 2 0 324 defined $hdr and $hdr ne ""
978 144 0 0 $ebcdic and $enc eq "utf-ebcdic"
996 0 313 1 $hdr and $hdr =~ s/\Asep=(\S)([\r\n]+)//i
1051 20 7 5 @refs == 1 and not defined $refs[0]
1056 24 2 1 $self->{'_COLUMN_NAMES'} and @refs != @{$self->{'_COLUMN_NAMES'};}
1075 2 1 2 @{$fr;} == 1 and !defined($fr->[0]) || $fr->[0] eq ''
1092 0 33 1 @f == 1 && !defined($f[0])
1114 1 19 38 defined $spec and $spec =~ /^ \s*
1136 3 27 2 $brr ne "*" and $brr == 0 || $brr < $tlr
2 26 2 $brc ne "*" and $brc == 0 || $brc < $tlc
1155 6 39 15 $brr ne "*" and $r > $brr
1165 6 17 10 $max_row ne "*" and $r == $max_row
1189 28 33 3 $r > $#r and $eod
1211 339 0 4 @_ == 1 && ref $_[0] eq 'HASH'
1254 303 36 1 exists $attr{'out'} && !$attr{'out'}
1259 0 300 40 $in and $out
300 28 12 $in and $out and !ref($in) || ref $in eq 'GLOB' || ref \$in eq 'GLOB'
28 12 0 $in and $out and !ref($in) || ref $in eq 'GLOB' || ref \$in eq 'GLOB' and !ref($out) || ref $out eq 'GLOB' || ref \$out eq 'GLOB'
1272 6 0 1 $cboi and not $cbai
1294 8 20 5 ref $out and 'ARRAY' eq ref $out || 'HASH' eq ref $out
8 7 13 ref $out and "SCALAR" ne ref $out
7 0 7 ref $out and "SCALAR" eq ref $out
7 0 7 ref $out and "SCALAR" eq ref $out and defined ${$out;}
0 5 2 ref $out and "SCALAR" eq ref $out and defined ${$out;} and ${$out;} eq "skip"
1331 16 2 0 not ref $in and $] < "5.008005"
1349 1004 1 6 exists $attr{$f} and not exists $attr{$t}
1354 0 2 0 defined $_[1][0] and $_[1][0] ne ""
1359 321 13 3 defined $fltr and not ref $fltr
334 0 3 defined $fltr and not ref $fltr and exists $fltr{$fltr}
1372 318 8 11 $kh and not ref $kh
326 3 8 $kh and not ref $kh and $kh =~ /^(?:1|yes|true|internal|auto)$/i
1403 1 330 13 @_ and ref $_[0] eq __PACKAGE__
1415 306 7 24 $c->{'out'} and not $c->{'sink'}
1417 6 14 4 not $hdrs and ref $c->{'kh'}
20 0 4 not $hdrs and ref $c->{'kh'} and $c->{'kh'} == \@internal_kh
1448 1 0 10 ref $hdrs || $hdrs eq 'auto' and @hdrs
1467 10 160 3 not defined $c->{'hd_s'} and $c->{'attr'}{'sep_char'}
1469 13 157 3 not defined $c->{'hd_s'} and $c->{'attr'}{'sep'}
1487 4 3 5 ref $key eq "ARRAY" and @{$key;} > 1
1493 2 1 2 ref $val eq "ARRAY" and @{$val;} > 0
1496 278 11 5 $c->{'fltr'} and grep /\D/, keys %{$$c{"fltr"};}
1502 0 0 52 $h && @$h
1525 213 0 10 $c->{'kh'} and $hdrs
1584 118 0 168 @row1 and not $c->{'hd_c'}
118 164 4 @row1 and not $c->{'hd_c'} and not ref $hdrs
1591 0 268 18 $ref and $c->{'cbai'} || $c->{'cboi'}
1604 5 0 2 $ro eq "SCALAR" and ${$c->{'out'};} eq "skip"
1611 0 0 4 @{$c->{'out'};} and @$ref
0 2 2 @{$c->{'out'};} and @$ref and ref $c->{'out'}[0] eq ref $ref->[0]

or 2 conditions

line l !l condition
190 903 92 shift() || {}
486 0 0 $self ||= "Text::CSV_XS"
524 7 0 $self ||= "Text::CSV_XS"
1185 28 27 $_ ||= 0
1216 44 298 delete $attr{'enc'} || delete $attr{'encoding'} || ''
1256 23 2 $out ||= \*STDOUT
1428 1 1 $hdrs ||= [map({$_ unless $hdr{$_};} keys %{$row;})]
1476 1 165 $hdrs ||= \@hdr
1482 3 7 $hdrs ||= "auto"
1488 7 13 $hdrs ||= "auto"
1496 2 3 $hdrs ||= "auto"

or 3 conditions

line l !l&&r !l&&!r condition
188 2 1001 1 ref $proto || $proto
551 1 1 9 not defined $v or $v eq ""
629 1 1 7 not defined $v or $v eq ""
640 1 1 6 not defined $v or $v eq ""
760 0 0 0 exists $hints->{'autodie'} and $hints->{'autodie'} or exists $hints->{'guard Fatal'} and not exists $hints->{'no Fatal'}
829 1 7 11 $idx < 0 or not ref $self->{'_FFLAGS'}
1075 0 2 0 $self->{'_FFLAGS'}[0] ||= CSV_FLAGS_IS_MISSING()
0 2 1 !defined($fr->[0]) || $fr->[0] eq ''
1094 0 11 0 $self->eol_type || $\ || $/
1136 2 2 32 $tlr == 0 or $tlc == 0
0 2 27 $brr == 0 || $brr < $tlr
4 2 30 $tlr == 0 or $tlc == 0 or $brr ne "*" and $brr == 0 || $brr < $tlr
0 2 26 $brc == 0 || $brc < $tlc
2 2 28 $tlr == 0 or $tlc == 0 or $brr ne "*" and $brr == 0 || $brr < $tlr or $brc ne "*" and $brc == 0 || $brc < $tlc
1144 2 17 9 $brr eq "*" or $brr > $max_row
1155 17 15 45 $r < $tlr or $brr ne "*" and $r > $brr
1156 33 3 9 not defined $lc or $tlc < $lc
1176 9 14 2 $to ||= $from
1179 2 1 22 $from <= 0 or $to < $from
1189 3 17 44 $r > $#r and $eod or $r[$r]
1198 27 99 279 $_ > $#r && $eod || $r[$_]
1228 2 15 324 delete $attr{'keep_headers'} || delete $attr{'keep_column_names'} || delete $attr{'kh'}
1233 2 2 330 delete $attr{'callbacks'}{'after_in'} || delete $attr{'after_in'} || delete $attr{'callbacks'}{'after_parse'} || delete $attr{'after_parse'}
1235 2 2 339 delete $attr{'callbacks'}{'before_out'} || delete $attr{'before_out'}
1237 4 12 327 delete $attr{'callbacks'}{'on_in'} || delete $attr{'on_in'}
1239 0 1 342 delete $attr{'callbacks'}{'on_error'} || delete $attr{'on_error'}
1242 4 6 333 delete $attr{'sep_set'} || delete $attr{'seps'}
1244 42 119 182 delete $attr{'detect_bom'} || delete $attr{'bom'}
1246 7 1 335 delete $attr{'munge'} || delete $attr{'munge_column_names'}
1252 337 3 3 delete $attr{'in'} || delete $attr{'file'}
1254 36 1 302 delete $attr{'out'} || delete $attr{'file'}
1256 3 22 315 ref $in eq "CODE" or ref $in eq "ARRAY"
1259 12 0 28 !ref($in) || ref $in eq 'GLOB' || ref \$in eq 'GLOB'
7 0 5 !ref($out) || ref $out eq 'GLOB' || ref \$out eq 'GLOB'
1261 2 0 5 ref $out or "GLOB" eq ref \$out
1294 4 1 20 'ARRAY' eq ref $out || 'HASH' eq ref $out
13 1 14 ref $out and "SCALAR" ne ref $out or "GLOB" eq ref \$out
1314 7 0 18 defined $attr{'eol'} or defined $fho
1321 3 21 315 ref $in eq "CODE" or ref $in eq "ARRAY"
16 2 267 ref $in or "GLOB" eq ref \$in
1342 337 0 0 $fh or $sink
1367 15 322 0 delete $attr{'csv'} || 'Text::CSV_XS'->new(\%attr)
1419 1 9 11 @{$in;} == 0 or ref $in->[0] eq "ARRAY"
1448 5 5 1 ref $hdrs || $hdrs eq 'auto'
1464 10 155 148 defined $c->{'hd_s'} or defined $c->{'hd_b'}
165 6 142 defined $c->{'hd_s'} or defined $c->{'hd_b'} or defined $c->{'hd_m'}
161 2 140 defined $c->{'hd_s'} or defined $c->{'hd_b'} or defined $c->{'hd_m'} or defined $c->{'hd_c'}
1487 15 5 7 not ref $key or ref $key eq "ARRAY" and @{$key;} > 1
1493 3 2 3 not ref $val or ref $val eq "ARRAY" and @{$val;} > 0
1498 51 1 171 not ref $hdrs or ref $hdrs eq "CODE"
1507 0 3 0 $hdr{$_} || $_
1518 0 3 0 $hdr{$_} || $_
1522 0 3 0 $hdr{$_} || $_
1591 12 11 263 $c->{'cbai'} || $c->{'cboi'}
1633 2 265 4 $last_err ||= $csv->{'_ERROR_DIAG'}