Condition Coverage

blib/lib/Text/CSV_XS.pm
Criterion Covered Total %
condition 380 442 85.7


and 3 conditions

line !l l&&!r l&&r condition
134 3559 3 2 defined $quo and length $quo
137 2 3320 242 defined $quo and $quo =~ /^[ \t]/
138 4 3028 290 defined $esc and $esc =~ /^[ \t]/
148 11905 418 35 defined $sep and length $sep
150 12326 14 18 defined $quo and length $quo
188 91 834 8 @_ > 0 and ref $_[0] ne "HASH"
211 1 6 2120 /^[a-z]/ and exists $def_attr{$_}
213 20 1912 188 defined $attr{$_} and /_char$/
231 893 4 21 $quote_aliased and defined $attr{'quote_char'}
248 576 301 6 defined $self->{'callbacks'} and ref $self->{'callbacks'} ne "HASH"
254 873 2 8 defined $\ and not exists $attr{'eol'}
356 6 6 6 defined $quote && length $quote
401 5 328 21 defined $sep && length $sep
462 0 856 47 $self and $f
856 42 5 $self and $f and ref $f
898 0 5 $self and $f and ref $f and ref $f eq "CODE"
500 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"
676 27 4 8 @_ == 1 && ref $_[0] eq 'HASH'
682 4 10 22 $cbk =~ /^[\w.]+$/ and ref $cb->{$cbk} eq "CODE"
710 66 3 1649 $self and ref $self
1 105 1543 UNIVERSAL::isa($self, "Text::CSV_XS") and exists $self->{'_ERROR_DIAG'}
69 105 1544 $self and ref $self and (UNIVERSAL::isa($self, "Text::CSV_XS") and exists $self->{'_ERROR_DIAG'})
719 7 1270 266 $diag[0] and $self->{'callbacks'}
1270 257 9 $diag[0] and $self->{'callbacks'} and $self->{'callbacks'}{'error'}
724 10 256 19 $diag[0] and $diag[0] != 2012
728 3 1 15 $self and ref $self
735 13 0 2 $self->{'diag_verbose'} and $self->{'_ERROR_INPUT'}
741 3 9 0 @c >= 11 and $c[10]
9 0 0 @c >= 11 and $c[10] and ref $c[10] eq "HASH"
745 0 0 0 exists $hints->{'autodie'} and $hints->{'autodie'}
0 0 0 exists $hints->{'guard Fatal'} and not exists $hints->{'no Fatal'}
801 3 1 8 ref $self->{'_FFLAGS'} and $idx >= 0
4 1 7 ref $self->{'_FFLAGS'} and $idx >= 0 and $idx < @{$self->{'_FFLAGS'};}
808 1 1 9 ref $self->{'_FFLAGS'} and $idx >= 0
2 1 8 ref $self->{'_FFLAGS'} and $idx >= 0 and $idx < @{$self->{'_FFLAGS'};}
834 1 1 1395 @_ > 0 && $self->Combine(\$str, \@_, 0)
859 6 201 1727 defined $str and $self->Parse($str, $fields, $fflags)
878 312 231 138 @keys == 1 and not defined $keys[0]
880 312 9 222 @keys == 1 and ref $keys[0] eq "ARRAY"
887 536 1 1 $self->{'_BOUND_COLUMNS'} and @keys != @{$self->{'_BOUND_COLUMNS'};}
913 330 0 1 defined $args{'munge'} and not defined $args{'munge_column_names'}
933 2 0 324 defined $hdr and $hdr ne ""
963 144 0 0 $ebcdic and $enc eq "utf-ebcdic"
981 0 313 1 $hdr and $hdr =~ s/\Asep=(\S)([\r\n]+)//i
1036 11 7 5 @refs == 1 and not defined $refs[0]
1041 15 2 1 $self->{'_COLUMN_NAMES'} and @refs != @{$self->{'_COLUMN_NAMES'};}
1060 2 1 2 @{$fr;} == 1 and !defined($fr->[0]) || $fr->[0] eq ''
1078 0 12 1 @f == 1 && !defined($f[0])
1097 1 19 38 defined $spec and $spec =~ /^ \s* \x23 ? \s* # optional leading # ( row | col | cell ) \s* = ( $qc # for row and col | $qd , $qd (?: - $qs , $qs)? # for cell (ranges) (?: ; $qd , $qd (?: - $qs , $qs)? )* # and cell (range) lists ) \s* $/xi
1119 3 27 2 $brr ne "*" and $brr == 0 || $brr < $tlr
2 26 2 $brc ne "*" and $brc == 0 || $brc < $tlc
1138 6 39 15 $brr ne "*" and $r > $brr
1148 6 17 10 $max_row ne "*" and $r == $max_row
1172 28 33 3 $r > $#r and $eod
1194 318 0 4 @_ == 1 && ref $_[0] eq 'HASH'
1209 289 30 0 exists $attr{'out'} && !$attr{'out'}
1213 0 286 33 $in and $out
286 28 5 $in and $out and not ref $in
314 4 1 $in and $out and not ref $in and not ref $out
1218 8 19 5 ref $out and 'ARRAY' eq ref $out || 'HASH' eq ref $out
8 6 13 ref $out and "SCALAR" ne ref $out
7 0 6 ref $out and "SCALAR" eq ref $out
7 0 6 ref $out and "SCALAR" eq ref $out and defined ${$out;}
0 5 1 ref $out and "SCALAR" eq ref $out and defined ${$out;} and ${$out;} eq "skip"
1255 14 2 0 not ref $in and $] < "5.008005"
1298 938 1 6 exists $attr{$f} and not exists $attr{$t}
1303 0 2 0 defined $_[1][0] and $_[1][0] ne ""
1308 299 13 3 defined $fltr and not ref $fltr
312 0 3 defined $fltr and not ref $fltr and exists $fltr{$fltr}
1320 296 8 11 $kh and not ref $kh
304 3 8 $kh and not ref $kh and $kh =~ /^(?:1|yes|true|internal|auto)$/i
1349 1 309 13 @_ and ref $_[0] eq "Text::CSV_XS"
1361 285 6 24 $c->{'out'} and not $c->{'sink'}
1363 6 14 4 not $hdrs and ref $c->{'kh'}
20 0 4 not $hdrs and ref $c->{'kh'} and $c->{'kh'} == \@internal_kh
1394 1 0 10 ref $hdrs || $hdrs eq 'auto' and @hdrs
1412 10 160 3 not defined $c->{'hd_s'} and $c->{'attr'}{'sep_char'}
1414 13 157 3 not defined $c->{'hd_s'} and $c->{'attr'}{'sep'}
1432 4 3 5 ref $key eq "ARRAY" and @{$key;} > 1
1438 2 1 2 ref $val eq "ARRAY" and @{$val;} > 0
1441 256 11 5 $c->{'fltr'} and grep /\D/, keys %{$$c{"fltr"};}
1447 0 0 48 $h && @$h
1470 209 0 10 $c->{'kh'} and $hdrs
1529 96 0 168 @row1 and not $c->{'hd_c'}
96 164 4 @row1 and not $c->{'hd_c'} and not ref $hdrs
1535 0 246 18 $ref and $c->{'cbai'} || $c->{'cboi'}
1548 5 0 1 $ro eq "SCALAR" and ${$c->{'out'};} eq "skip"
1555 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
189 834 91 shift() || {}
473 0 0 $self ||= "Text::CSV_XS"
511 7 0 $self ||= "Text::CSV_XS"
1168 28 27 $_ ||= 0
1198 44 277 delete $attr{'enc'} || delete $attr{'encoding'} || ''
1211 23 2 $out ||= \*STDOUT
1374 1 1 $hdrs ||= [map({$_ unless $hdr{$_};} keys %{$row;})]
1421 1 165 $hdrs ||= \@hdr
1427 3 7 $hdrs ||= "auto"
1433 7 13 $hdrs ||= "auto"
1441 2 3 $hdrs ||= "auto"

or 3 conditions

line l !l&&r !l&&!r condition
187 2 931 1 ref $proto || $proto
538 1 1 9 not defined $v or $v eq ""
616 1 1 7 not defined $v or $v eq ""
627 1 1 6 not defined $v or $v eq ""
745 0 0 0 exists $hints->{'autodie'} and $hints->{'autodie'} or exists $hints->{'guard Fatal'} and not exists $hints->{'no Fatal'}
814 1 7 11 $idx < 0 or not ref $self->{'_FFLAGS'}
1060 0 2 0 $self->{'_FFLAGS'}[0] ||= CSV_FLAGS_IS_MISSING()
0 2 1 !defined($fr->[0]) || $fr->[0] eq ''
1076 0 11 0 $\ || $/
1119 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
1127 2 17 9 $brr eq "*" or $brr > $max_row
1138 17 15 45 $r < $tlr or $brr ne "*" and $r > $brr
1139 33 3 9 not defined $lc or $tlc < $lc
1159 9 14 2 $to ||= $from
1162 2 1 22 $from <= 0 or $to < $from
1172 3 17 44 $r > $#r and $eod or $r[$r]
1181 27 99 279 $_ > $#r && $eod || $r[$_]
1207 316 3 3 delete $attr{'in'} || delete $attr{'file'}
1209 30 1 288 delete $attr{'out'} || delete $attr{'file'}
1211 3 22 294 ref $in eq "CODE" or ref $in eq "ARRAY"
1218 4 1 19 'ARRAY' eq ref $out || 'HASH' eq ref $out
13 1 13 ref $out and "SCALAR" ne ref $out or "GLOB" eq ref \$out
1245 3 21 293 ref $in eq "CODE" or ref $in eq "ARRAY"
14 2 252 ref $in or "GLOB" eq ref \$in
1266 315 0 0 $fh or $sink
1274 2 15 296 delete $attr{'keep_headers'} || delete $attr{'keep_column_names'} || delete $attr{'kh'}
1279 1 1 304 delete $attr{'callbacks'}{'after_in'} || delete $attr{'after_in'} || delete $attr{'callbacks'}{'after_parse'} || delete $attr{'after_parse'}
1281 2 2 311 delete $attr{'callbacks'}{'before_out'} || delete $attr{'before_out'}
1283 4 11 300 delete $attr{'callbacks'}{'on_in'} || delete $attr{'on_in'}
1286 4 6 305 delete $attr{'sep_set'} || delete $attr{'seps'}
1288 42 119 154 delete $attr{'detect_bom'} || delete $attr{'bom'}
1290 7 1 307 delete $attr{'munge'} || delete $attr{'munge_column_names'}
1316 15 300 0 delete $attr{'csv'} || 'Text::CSV_XS'->new(\%attr)
1365 1 9 11 @{$in;} == 0 or ref $in->[0] eq "ARRAY"
1394 5 5 1 ref $hdrs || $hdrs eq 'auto'
1409 10 155 126 defined $c->{'hd_s'} or defined $c->{'hd_b'}
165 6 120 defined $c->{'hd_s'} or defined $c->{'hd_b'} or defined $c->{'hd_m'}
161 2 118 defined $c->{'hd_s'} or defined $c->{'hd_b'} or defined $c->{'hd_m'} or defined $c->{'hd_c'}
1432 15 5 7 not ref $key or ref $key eq "ARRAY" and @{$key;} > 1
1438 3 2 3 not ref $val or ref $val eq "ARRAY" and @{$val;} > 0
1443 47 1 171 not ref $hdrs or ref $hdrs eq "CODE"
1452 0 3 0 $hdr{$_} || $_
1463 0 3 0 $hdr{$_} || $_
1467 0 3 0 $hdr{$_} || $_
1535 11 11 242 $c->{'cbai'} || $c->{'cboi'}