Branch Coverage

blib/lib/Text/CSV/Hashify.pm
Criterion Covered Total %
branch 61 64 95.3


line true false branch
196 1 9 unless @_ == 2
200 1 17 unless $args[$i]
209 2 4 $obj_args{'file'} =~ /\.tsv(\.gz)?$/ ? :
2 6 $obj_args{'file'} =~ /\.psv(\.gz)?$/ ? :
296 2 35 unless ref $args and &reftype($args) eq 'HASH'
298 1 34 unless $args->{'file'}
300 1 33 unless -f $args->{'file'}
303 1 32 if ($args->{'format'} and not $args->{'format'} =~ /^(?:h|a)oh$/i)
308 29 3 if (exists $args->{'key'})
310 2 27 unless defined $args->{'key'} and length $args->{'key'}
313 1 29 if (not exists $args->{'key'} and $data{'format'} ne 'aoh')
319 8 21 if (defined $args->{'max_rows'})
320 3 5 if (not $args->{'max_rows'} =~ /^[0-9]+$/) { }
331 0 26 unless my $csv = 'Text::CSV'->new($args)
334 8 18 if ($data{'file'} =~ /\.gz$/) { }
340 0 26 unless defined $IN
345 1 521 if (exists $header_fields_seen{$_}) { }
352 23 2 if ($data{'format'} eq 'hoh')
354 1 22 unless $header_fields_seen{$data{'key'}}
368 4229 10 if ($data{'format'} eq 'hoh') { }
370 1 4228 if ($keys_seen{$kk}) { }
380 2 4226 if defined $data{'max_rows'} and scalar CORE::keys %parsed_data == $data{'max_rows'}
388 1 9 if defined $data{'max_rows'} and scalar @parsed_data == $data{'max_rows'}
391 0 23 unless $IN->close
392 2 21 $data{'format'} eq 'aoh' ? :
393 21 2 if $data{'format'} eq 'hoh'
492 6 9 unless defined $key and $key ne ''
496 3 6 $self->{'format'} eq 'aoh' ? :
524 3 11 unless @args == 2
526 6 13 unless defined $args[$i] and $args[$i] ne ''
531 3 2 $self->{'format'} eq 'aoh' ? :
561 3 1 if (exists $self->{'keys'}) { }