Branch Coverage

blib/lib/Metabrik/File/Csv.pm
Criterion Covered Total %
branch 0 150 0.0


line true false branch
71 0 0 unless my $sb = 'Metabrik::String::Base64'->new_from_brik_init($self)
72 0 0 unless my $sc = 'Metabrik::String::Compress'->new_from_brik_init($self)
84 0 0 unless $self->brik_help_run_undef_arg('read', $input)
85 0 0 unless $self->brik_help_run_file_not_found('read', $input)
87 0 0 unless my $csv = 'Text::CSV_XS'->new({'binary', 1, 'sep_char', $self->separator, 'allow_loose_quotes', 1, 'allow_loose_escapes', 1, 'escape_char', $self->escape})
95 0 0 unless my $fr = 'Metabrik::File::Read'->new_from_brik_init($self)
97 0 0 unless my $fd = $fr->open($input)
104 0 0 if (defined $encoded_fields)
110 0 0 if (defined $object_fields)
126 0 0 if ($self->first_line_is_header) { }
127 0 0 if ($first_line)
137 0 0 if ($encoded_fields or $object_fields) { }
141 0 0 unless defined $v
144 0 0 if ($encoded_fields and exists $encoded_fields->{$k} and length $v)
146 0 0 unless (defined $decoded)
152 0 0 unless (defined $gunzipped)
160 0 0 if ($object_fields and exists $object_fields->{$k} and length $v and $v =~ /$object_re/ || $v =~ /$base64_re/)
163 0 0 unless (defined $decoded)
187 0 0 unless ($csv->eof)
206 0 0 unless $self->brik_help_run_undef_arg('write', $csv_struct)
207 0 0 unless $self->brik_help_run_invalid_arg('write', $csv_struct, 'ARRAY')
208 0 0 unless $self->brik_help_run_empty_array_arg('write', $csv_struct, 'ARRAY')
209 0 0 unless $self->brik_help_run_undef_arg('write', $output)
211 0 0 if (ref $csv_struct->[0] ne 'HASH')
215 0 0 unless my $fw = 'Metabrik::File::Write'->new_from_brik_init($self)
228 0 0 if (defined $encoded_fields)
234 0 0 if (defined $object_fields)
246 0 0 if ($self->header) { }
268 0 0 unless my $fd = $fw->open
273 0 0 if ($self->write_header and $is_new_file || $self->overwrite)
276 0 0 unless (defined $r)
292 0 0 if ($encoded_fields or $object_fields) { }
295 0 0 unless defined $order{$key}
298 0 0 unless defined $v
300 0 0 if ($encoded_fields and exists $encoded_fields->{$k} and length $v)
303 0 0 unless (defined $gzipped)
308 0 0 unless (defined $v)
314 0 0 if ($object_fields and exists $object_fields->{$k} and length $v)
317 0 0 if (ref $v eq 'ARRAY' and @$v > 0 or ref $v eq 'HASH' and keys %$v > 0) { }
0 0 elsif (ref $v eq '' and length $v) { }
321 0 0 unless (defined $v)
341 0 0 unless defined $order{$key}
346 0 0 defined $_ ? :
350 0 0 if ($field_count < $header_count)
357 0 0 if ($self->use_quoting)
367 0 0 unless (defined $r)
376 0 0 unless (length $written)
387 0 0 unless $self->brik_help_run_undef_arg('get_column_values', $data)
388 0 0 unless $self->brik_help_run_invalid_arg('get_column_values', $data, 'ARRAY')
389 0 0 unless $self->brik_help_run_undef_arg('get_column_values', $column)
393 0 0 if ($self->first_line_is_header) { }
0 0 elsif ($column =~ /^\d+$/) { }
394 0 0 if (@{$self->header;} == 0)
399 0 0 if (ref $row ne 'HASH')
403 0 0 if (exists $row->{$column})
411 0 0 if (ref $row ne 'ARRAY')
415 0 0 if (exists $row->[$column])
429 0 0 unless $self->brik_help_run_undef_arg('read_next', $input)
430 0 0 unless $self->brik_help_run_file_not_found('read_next', $input)
434 0 0 unless (defined $csv)
436 0 0 unless $csv = 'Text::CSV_XS'->new({'binary', 1, 'sep_char', $self->separator, 'allow_loose_quotes', 1, 'allow_loose_escapes', 1, 'escape_char', $self->escape})
445 0 0 unless my $fr = 'Metabrik::File::Read'->new_from_brik_init($self)
447 0 0 unless $fd = $fr->open($input)
450 0 0 if ($self->first_line_is_header)
461 0 0 if (defined $encoded_fields)
467 0 0 if (defined $object_fields)
480 0 0 if (defined $header)
484 0 0 if ($encoded_fields or $object_fields) { }
488 0 0 unless defined $v
491 0 0 if ($encoded_fields and exists $encoded_fields->{$k} and length $v)
493 0 0 unless (defined $decoded)
499 0 0 unless (defined $gunzipped)
507 0 0 if ($object_fields and exists $object_fields->{$k} and length $v and $v =~ /$object_re/ || $v =~ /$base64_re/)
510 0 0 unless (defined $decoded)
529 0 0 if ($csv->eof)