Branch Coverage

lib/Parse/File/Taxonomy/Index.pm
Criterion Covered Total %
branch 81 84 96.4


line true false branch
178 2 43 unless ref $args and reftype $args eq 'HASH'
180 1 42 unless $$args{'file'} or $$args{'components'}
182 1 41 if $$args{'file'} and $$args{'components'}
185 8 33 $$args{'id_col'} ? :
188 8 33 $$args{'parent_id_col'} ? :
191 8 33 $$args{'component_col'} ? :
195 22 19 if ($$args{'components'}) { }
196 2 20 unless ref $$args{'components'} and reftype($$args{'components'}) eq 'HASH'
199 2 35 unless exists $$args{'components'}{$k}
201 3 32 unless ref $$args{'components'}{$k} and reftype($$args{'components'}{$k}) eq 'ARRAY'
206 2 171 unless ref $row and reftype $row eq 'ARRAY'
215 1 18 unless -f $$args{'file'}
219 0 18 unless my $csv = 'Text::CSV'->new($args)
221 0 18 unless open my $IN, '<', $$data{'file'}
227 0 14 unless close $IN
239 18 13 if (not $components) { }
257 6 81 unless (exists $col2idx{$$data{$c}})
265 6 23 if scalar keys %missing_columns
284 2 293 unless ($$rec[$$data{'id_col_idx'}] =~ /^\d+$/)
287 2 293 if (length $$rec[$$data{'parent_id_col_idx'}] and not $$rec[$$data{'parent_id_col_idx'}] =~ /^\d+$/)
297 6 289 if ($this_row_count != $field_count)
301 3 292 unless (length $$rec[$$data{'component_col_idx'}])
312 1 22 if @non_numeric_id_records
316 4 274 if $ids_seen{$id} > 1
325 2 20 if @dupe_ids
335 2 18 if @bad_count_records
345 1 17 if @nameless_component_records
350 4 213 if (length $parent_id and not $ids_seen{$parent_id})
363 2 15 if scalar keys %ids_missing_parents
367 133 58 if (length $$rec[$$data{'parent_id_col_idx'}])
380 4 125 if ($families{$k}{$l} > 1)
386 2 13 if $same_names
688 10 5 if (defined $args)
689 2 8 unless (ref $args and reftype $args eq 'HASH')
694 1 11 unless $permissible_args{$k}
697 1 6 if ($$args{'path_col_sep'} and not $$args{'as_string'})
701 4 7 defined $$args{'path_col'} ? :
702 4 7 if ($$args{'as_string'})
703 2 2 defined $$args{'path_col_sep'} ? :
710 39 22 unless ($f eq $self->id_col or $f eq $self->parent_id_col or $f eq $self->component_col)
733 131 127 if (length $parent_id) { }
745 44 83 if ($$args{'as_string'}) { }