Branch Coverage

blib/lib/CSV/Reader.pm
Criterion Covered Total %
branch 47 80 58.7


line true false branch
106 0 7 unless (defined $file and length $file)
109 3 4 if (ref $file) { }
110 0 3 unless (ref $file eq 'GLOB' or UNIVERSAL::isa($file, 'IO::Handle'))
121 0 4 $@ ? :
122 0 4 if $options{'debug'}
123 0 4 unless open $h, $mode, $file
132 7 0 if (%options)
135 0 20 if ($key eq 'debug' or $key eq 'skip_empty_lines') { }
6 14 elsif ($key eq 'enclosure' or $key eq 'escape') { }
6 8 elsif ($key eq 'delimiter') { }
1 7 elsif ($key eq 'include_fields') { }
7 0 elsif ($key eq 'field_aliases') { }
0 0 elsif ($key eq 'field_normalizer') { }
139 0 6 if (not defined $value or ref $value)
145 0 6 if (not defined $value or ref $value or not length $value)
152 0 1 if (ref $value ne 'ARRAY')
158 0 7 if (ref $value ne 'HASH')
164 0 0 if (ref $value ne 'CODE')
190 0 0 if ($err eq '2012')
205 7 0 if (my $row = $self->{'text_csv'}->getline($self->{'h'})) { }
209 0 56 unless (defined $name)
213 0 56 unless (length $name)
216 0 56 if ($opt_field_normalizer)
219 56 0 if (%opt_field_aliases)
221 7 49 if (defined $opt_field_aliases{$key})
225 6 50 if (%opt_include_fields and not exists $opt_include_fields{$name})
228 0 50 if (exists $self->{'field_cols'}{$name})
233 0 7 unless (%{$self->{'field_cols'};})
234 0 0 %opt_include_fields ? :
237 1 6 if (%opt_include_fields)
242 2 0 if (exists $self->{'field_cols'}{$key})
254 1 6 if (%opt_include_fields)
257 0 2 unless (exists $self->{'field_cols'}{$name})
261 0 1 if (@missing)
280 4 3 if ($self->{'own_h'})
300 24 8 if (my $csv_row = $self->{'text_csv'}->getline($self->{'h'})) { }
301 0 24 if ($self->{'debug'})
311 109 65 if (defined $v)
313 0 109 unless (length $v)
418 0 1 unless seek $self->{'h'}, 0, 0