Branch Coverage

lib/Parse/Taxonomy/AdjacentList.pm
Criterion Covered Total %
branch 103 108 95.3


line true false branch
178 2 49 unless ref $args and &reftype($args) eq 'HASH'
181 26 23 if $args->{'file'}
182 23 26 if $args->{'components'}
183 1 48 if $argscount == 0
185 1 47 if $argscount == 2
190 10 37 $args->{'id_col'} ? :
193 10 37 $args->{'parent_id_col'} ? :
196 8 39 $args->{'leaf_col'} ? :
198 22 25 if ($args->{'components'}) { }
200 2 20 unless ref $args->{'components'} and &reftype($args->{'components'}) eq 'HASH'
203 2 35 unless exists $args->{'components'}{$k}
206 3 32 unless ref $args->{'components'}{$k} and &reftype($args->{'components'}{$k}) eq 'ARRAY'
209 2 171 unless ref $row and &reftype($row) eq 'ARRAY'
219 1 24 unless -f $args->{'file'}
222 0 24 unless my $csv = 'Text::CSV_XS'->new($args)
225 0 24 unless open my $IN, '<', $data->{'file'}
230 0 20 unless close $IN
242 24 13 if (not $components) { }
260 6 99 unless (exists $col2idx{$data->{$c}})
268 6 29 if scalar keys %missing_columns
287 2 371 unless ($$rec[$data->{'id_col_idx'}] =~ /^\d+$/)
290 2 371 if (length $$rec[$data->{'parent_id_col_idx'}] and not $$rec[$data->{'parent_id_col_idx'}] =~ /^\d+$/)
300 6 367 if ($this_row_count != $field_count)
304 3 370 unless (length $$rec[$data->{'leaf_col_idx'}])
315 1 28 if @non_numeric_id_records
319 4 352 if $ids_seen{$id} > 1
328 2 26 if @dupe_ids
338 2 24 if @bad_count_records
348 1 23 if @nameless_component_records
353 4 291 if (length $parent_id and not $ids_seen{$parent_id})
366 2 21 if scalar keys %ids_missing_parents
370 200 69 if (length $$rec[$data->{'parent_id_col_idx'}])
383 5 190 if ($families{$k}{$l} > 1)
389 3 18 if $same_names
685 12 8 if (defined $args)
686 2 10 unless (ref $args and &reftype($args) eq 'HASH')
692 1 13 unless $permissible_args{$k}
694 1 8 if ($args->{'path_col_sep'} and not $args->{'as_string'})
698 4 12 defined $args->{'path_col'} ? :
699 6 10 if ($args->{'as_string'})
700 2 4 defined $args->{'path_col_sep'} ? :
707 46 32 unless ($f eq $self->id_col or $f eq $self->parent_id_col or $f eq $self->leaf_col)
730 249 198 if (length $parent_id) { }
742 62 136 if ($args->{'as_string'}) { }
837 7 1 if (defined $args) { }
838 2 5 unless ref $args and &reftype($args) eq 'HASH'
841 1 4 unless exists $args->{'pathified'}
844 2 2 unless ref $args->{'pathified'} and &reftype($args->{'pathified'}) eq 'ARRAY'
854 1 1 !ref($pathified->[1][0]) ? :
872 1 1 defined $args->{'csvfile'} ? :
884 0 2 unless open my $OUT, '>:encoding(utf8)', $csvfile
886 1 1 defined $csv_args->{'eol'} ? :
895 9 9 $path_as_string ? :
899 0 2 unless close $OUT