Branch Coverage

blib/lib/CSV/Reader.pm
Criterion Covered Total %
branch 60 94 63.8


line true false branch
124 0 8 unless (defined $file and length $file)
127 3 5 if (ref $file) { }
128 0 3 unless (ref $file eq 'GLOB' or UNIVERSAL::isa($file, 'IO::Handle'))
139 0 5 $@ ? :
140 0 5 if $options{'debug'}
141 0 5 unless open $h, $mode, $file
150 8 0 if (%options)
153 0 25 if ($key eq 'debug' or $key eq 'skip_empty_lines') { }
7 18 elsif ($key eq 'enclosure' or $key eq 'escape') { }
7 11 elsif ($key eq 'delimiter') { }
1 10 elsif ($key eq 'include_fields') { }
8 2 elsif ($key eq 'field_aliases') { }
1 1 elsif ($key eq 'field_normalizer') { }
1 0 elsif ($key eq 'mutators') { }
157 0 7 if (not defined $value or ref $value)
163 0 7 if (not defined $value or ref $value or not length $value)
170 0 1 if (ref $value ne 'ARRAY')
176 0 8 if (ref $value ne 'HASH')
182 0 1 if (ref $value ne 'CODE')
188 0 1 if (ref $value ne 'HASH')
193 2 0 if (defined $mutator)
194 0 2 unless (ref $mutator eq 'CODE')
222 0 0 if ($err eq '2012')
237 8 0 if (my $row = $self->{'text_csv'}->getline($self->{'h'})) { }
241 0 64 unless (defined $name)
245 0 64 unless (length $name)
248 8 56 if ($opt_field_normalizer)
251 64 0 if (%opt_field_aliases)
253 8 56 if (defined $opt_field_aliases{$key})
257 6 58 if (%opt_include_fields and not exists $opt_include_fields{$name})
260 0 58 if (exists $self->{'field_cols'}{$name})
265 0 8 unless (%{$self->{'field_cols'};})
266 0 0 %opt_include_fields ? :
269 1 7 if (%opt_include_fields)
274 2 0 if (exists $self->{'field_cols'}{$key})
286 1 7 if (%opt_include_fields)
289 0 2 unless (exists $self->{'field_cols'}{$name})
293 0 1 if (@missing)
315 5 3 if ($self->{'own_h'})
335 27 9 if (my $csv_row = $self->{'text_csv'}->getline($self->{'h'})) { }
336 0 27 if ($self->{'debug'})
346 124 74 if (defined $v)
348 0 124 unless (length $v)
356 3 24 if (my $mutators = $self->{'mutators'})
358 6 0 if (exists $row{$k})
359 6 0 if (my $mutator = $mutators->{$k})
465 0 1 unless seek $self->{'h'}, 0, 0