Condition Coverage

blib/lib/Text/CSV_XS.pm
Criterion Covered Total %
condition 368 425 86.3


and 3 conditions

line !l l&&!r l&&r condition
136 3559 3 2 defined $quo and length $quo
139 2 3320 242 defined $quo and $quo =~ /^[ \t]/
140 4 3028 290 defined $esc and $esc =~ /^[ \t]/
150 11865 405 35 defined $sep and length $sep
152 12273 14 18 defined $quo and length $quo
190 86 812 8 @_ > 0 and ref $_[0] ne "HASH"
213 1 6 2030 /^[a-z]/ and exists $def_attr{$_}
215 20 1822 188 defined $attr{$_} and /_char$/
233 866 4 21 $quote_aliased and defined $attr{'quote_char'}
250 567 283 6 defined $self->{'callbacks'} and ref $self->{'callbacks'} ne "HASH"
256 846 2 8 defined $\ and not exists $attr{'eol'}
357 6 6 6 defined $quote && length $quote
402 5 315 21 defined $sep && length $sep
478 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"
653 27 4 8 @_ == 1 && ref $_[0] eq 'HASH'
659 4 10 22 $cbk =~ /^[\w.]+$/ and ref $cb->{$cbk} eq "CODE"
687 66 3 1641 $self and ref $self
1 105 1535 UNIVERSAL::isa($self, "Text::CSV_XS") and exists $self->{'_ERROR_DIAG'}
69 105 1536 $self and ref $self and (UNIVERSAL::isa($self, "Text::CSV_XS") and exists $self->{'_ERROR_DIAG'})
696 7 1266 262 $diag[0] and $self->{'callbacks'}
1266 253 9 $diag[0] and $self->{'callbacks'} and $self->{'callbacks'}{'error'}
701 10 252 19 $diag[0] and $diag[0] != 2012
705 3 1 15 $self and ref $self
712 13 0 2 $self->{'diag_verbose'} and $self->{'_ERROR_INPUT'}
718 3 9 0 @c >= 11 and $c[10]
9 0 0 @c >= 11 and $c[10] and ref $c[10] eq "HASH"
722 0 0 0 exists $hints->{'autodie'} and $hints->{'autodie'}
0 0 0 exists $hints->{'guard Fatal'} and not exists $hints->{'no Fatal'}
778 3 1 8 ref $self->{'_FFLAGS'} and $idx >= 0
4 1 7 ref $self->{'_FFLAGS'} and $idx >= 0 and $idx < @{$self->{'_FFLAGS'};}
785 1 1 9 ref $self->{'_FFLAGS'} and $idx >= 0
2 1 8 ref $self->{'_FFLAGS'} and $idx >= 0 and $idx < @{$self->{'_FFLAGS'};}
811 1 1 1395 @_ > 0 && $self->Combine(\$str, \@_, 0)
836 6 201 1727 defined $str and $self->Parse($str, $fields, $fflags)
855 299 220 138 @keys == 1 and not defined $keys[0]
857 299 9 211 @keys == 1 and ref $keys[0] eq "ARRAY"
864 512 1 1 $self->{'_BOUND_COLUMNS'} and @keys != @{$self->{'_BOUND_COLUMNS'};}
890 317 0 1 defined $args{'munge'} and not defined $args{'munge_column_names'}
910 2 0 311 defined $hdr and $hdr ne ""
940 144 0 0 $ebcdic and $enc eq "utf-ebcdic"
958 0 300 1 $hdr and $hdr =~ s/\Asep=(\S)([\r\n]+)//i
1013 11 7 5 @refs == 1 and not defined $refs[0]
1018 15 2 1 $self->{'_COLUMN_NAMES'} and @refs != @{$self->{'_COLUMN_NAMES'};}
1037 2 1 2 @{$fr;} == 1 and !defined($fr->[0]) || $fr->[0] eq ''
1055 0 12 1 @f == 1 && !defined($f[0])
1074 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
1096 3 27 2 $brr ne "*" and $brr == 0 || $brr < $tlr
2 26 2 $brc ne "*" and $brc == 0 || $brc < $tlc
1115 6 39 15 $brr ne "*" and $r > $brr
1125 6 17 10 $max_row ne "*" and $r == $max_row
1149 28 33 3 $r > $#r and $eod
1171 296 0 4 @_ == 1 && ref $_[0] eq 'HASH'
1186 267 30 0 exists $attr{'out'} && !$attr{'out'}
1190 0 264 33 $in and $out
264 28 5 $in and $out and not ref $in
292 4 1 $in and $out and not ref $in and not ref $out
1195 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"
1232 14 2 0 not ref $in and $] < "5.008005"
1275 872 1 6 exists $attr{$f} and not exists $attr{$t}
1280 0 2 0 defined $_[1][0] and $_[1][0] ne ""
1285 277 13 3 defined $fltr and not ref $fltr
290 0 3 defined $fltr and not ref $fltr and exists $fltr{$fltr}
1297 274 8 11 $kh and not ref $kh
282 3 8 $kh and not ref $kh and $kh =~ /^(?:1|yes|true|internal|auto)$/i
1326 1 291 9 @_ and ref $_[0] eq "Text::CSV_XS"
1338 263 6 24 $c->{'out'} and not $c->{'sink'}
1340 6 14 4 not $hdrs and ref $c->{'kh'}
20 0 4 not $hdrs and ref $c->{'kh'} and $c->{'kh'} == \@internal_kh
1371 1 0 10 ref $hdrs || $hdrs eq 'auto' and @hdrs
1389 10 150 3 not defined $c->{'hd_s'} and $c->{'attr'}{'sep_char'}
1391 13 147 3 not defined $c->{'hd_s'} and $c->{'attr'}{'sep'}
1409 4 3 5 ref $key eq "ARRAY" and @{$key;} > 1
1415 2 1 2 ref $val eq "ARRAY" and @{$val;} > 0
1418 234 11 5 $c->{'fltr'} and grep /\D/, keys %{$$c{"fltr"};}
1442 198 0 10 $c->{'kh'} and $hdrs
1501 88 0 160 @row1 and not $c->{'hd_c'}
88 156 4 @row1 and not $c->{'hd_c'} and not ref $hdrs
1507 0 230 18 $ref and $c->{'cbai'} || $c->{'cboi'}
1520 5 0 1 $ro eq "SCALAR" and ${$c->{'out'};} eq "skip"
1527 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
191 812 86 shift() || {}
489 7 0 $self ||= "Text::CSV_XS"
1145 28 27 $_ ||= 0
1175 44 255 delete $attr{'enc'} || delete $attr{'encoding'} || ''
1188 23 2 $out ||= \*STDOUT
1351 1 1 $hdrs ||= [map({$_ unless $hdr{$_};} keys %{$row;})]
1398 0 156 $hdrs ||= \@hdr
1404 3 7 $hdrs ||= "auto"
1410 7 13 $hdrs ||= "auto"
1418 2 3 $hdrs ||= "auto"

or 3 conditions

line l !l&&r !l&&!r condition
189 2 904 1 ref $proto || $proto
515 1 1 9 not defined $v or $v eq ""
593 1 1 7 not defined $v or $v eq ""
604 1 1 6 not defined $v or $v eq ""
722 0 0 0 exists $hints->{'autodie'} and $hints->{'autodie'} or exists $hints->{'guard Fatal'} and not exists $hints->{'no Fatal'}
791 1 7 11 $idx < 0 or not ref $self->{'_FFLAGS'}
1037 0 2 0 $self->{'_FFLAGS'}[0] ||= CSV_FLAGS_IS_MISSING()
0 2 1 !defined($fr->[0]) || $fr->[0] eq ''
1053 0 11 0 $\ || $/
1096 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
1104 2 17 9 $brr eq "*" or $brr > $max_row
1115 17 15 45 $r < $tlr or $brr ne "*" and $r > $brr
1116 33 3 9 not defined $lc or $tlc < $lc
1136 9 14 2 $to ||= $from
1139 2 1 22 $from <= 0 or $to < $from
1149 3 17 44 $r > $#r and $eod or $r[$r]
1158 27 99 279 $_ > $#r && $eod || $r[$_]
1184 294 3 3 delete $attr{'in'} || delete $attr{'file'}
1186 30 1 266 delete $attr{'out'} || delete $attr{'file'}
1188 3 22 272 ref $in eq "CODE" or ref $in eq "ARRAY"
1195 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
1222 3 21 271 ref $in eq "CODE" or ref $in eq "ARRAY"
14 2 232 ref $in or "GLOB" eq ref \$in
1243 293 0 0 $fh or $sink
1251 2 15 274 delete $attr{'keep_headers'} || delete $attr{'keep_column_names'} || delete $attr{'kh'}
1256 1 1 282 delete $attr{'callbacks'}{'after_in'} || delete $attr{'after_in'} || delete $attr{'callbacks'}{'after_parse'} || delete $attr{'after_parse'}
1258 2 2 289 delete $attr{'callbacks'}{'before_out'} || delete $attr{'before_out'}
1260 4 11 278 delete $attr{'callbacks'}{'on_in'} || delete $attr{'on_in'}
1263 4 6 283 delete $attr{'sep_set'} || delete $attr{'seps'}
1265 42 109 142 delete $attr{'detect_bom'} || delete $attr{'bom'}
1267 7 1 285 delete $attr{'munge'} || delete $attr{'munge_column_names'}
1293 11 282 0 delete $attr{'csv'} || 'Text::CSV_XS'->new(\%attr)
1342 1 9 11 @{$in;} == 0 or ref $in->[0] eq "ARRAY"
1371 5 5 1 ref $hdrs || $hdrs eq 'auto'
1386 10 145 114 defined $c->{'hd_s'} or defined $c->{'hd_b'}
155 6 108 defined $c->{'hd_s'} or defined $c->{'hd_b'} or defined $c->{'hd_m'}
151 2 106 defined $c->{'hd_s'} or defined $c->{'hd_b'} or defined $c->{'hd_m'} or defined $c->{'hd_c'}
1409 15 5 7 not ref $key or ref $key eq "ARRAY" and @{$key;} > 1
1415 3 2 3 not ref $val or ref $val eq "ARRAY" and @{$val;} > 0
1430 0 3 0 $hdr{$_} || $_
1434 0 3 0 $hdr{$_} || $_
1440 0 3 0 $hdr{$_} || $_
1507 11 11 226 $c->{'cbai'} || $c->{'cboi'}