Branch Coverage

lib/Parse/Taxonomy/MaterializedPath.pm
Criterion Covered Total %
branch 134 140 95.7


line true false branch
177 2 55 unless ref $args and &reftype($args) eq 'HASH'
180 29 26 if $args->{'file'}
181 26 29 if $args->{'components'}
182 1 54 if $argscount == 0
184 1 53 if $argscount == 2
187 4 49 if (exists $args->{'path_col_idx'})
189 1 3 unless $args->{'path_col_idx'} =~ /^\d+$/
194 5 47 exists $args->{'path_col_sep'} ? :
195 5 47 if (exists $args->{'path_col_sep'}) { }
203 25 27 if ($args->{'components'}) { }
205 2 23 unless ref $args->{'components'} and &reftype($args->{'components'}) eq 'HASH'
208 2 41 unless exists $args->{'components'}{$k}
211 3 38 unless ref $args->{'components'}{$k} and &reftype($args->{'components'}{$k}) eq 'ARRAY'
214 2 229 unless ref $row and &reftype($row) eq 'ARRAY'
229 1 26 unless -f $args->{'file'}
236 0 26 unless my $csv = 'Text::CSV_XS'->new($args)
239 0 26 unless open my $IN, '<', $data->{'file'}
244 0 23 unless close $IN
262 26 16 if (not $components) { }
274 10 180 if $fields_seen{$reserved}
278 2 36 if @bad_fields
288 16 26 $components ? :
292 2 40 if $data->{'path_col_idx'} > $#{$fields_ref;}
306 6 470 unless ($$rec[$data->{'path_col_idx'}] =~ /^\Q$data->{'path_col_sep'}\E/)
311 5 471 if ($this_row_count != $field_count)
323 2 34 if @bad_path_cols
327 5 438 if $paths_seen{$path} > 1
336 3 31 if @dupe_paths
344 2 29 if @bad_count_records
349 0 29 unless my $path_csv = 'Text::CSV_XS'->new($path_args)
355 281 105 if (@columns > 2)
358 4 277 unless (exists $paths_seen{$parent})
370 2 27 if scalar keys %missing_parents
593 698 182 if ($i != $self->{'path_col_idx'}) { }
639 130 26 if ($i != $self->{'path_col_idx'}) { }
708 5 4 if (defined $args)
709 2 3 unless ref $args and &reftype($args) eq 'HASH'
712 2 1 unless $args->{'generations'} and $args->{'generations'} =~ /^[0-9]+$/
722 61 169 if ($q =~ /^\Q$p$self->{'path_col_sep'}\E/)
723 48 13 if (not $args->{'generations'}) { }
730 9 4 if scalar(@d) - scalar(@c) <= $args->{'generations'}
784 15 11 if (defined $args)
785 2 13 unless ref $args and &reftype($args) eq 'HASH'
788 2 11 unless $args->{'generations'} and $args->{'generations'} =~ /^[0-9]+$/
790 6 16 if (exists $self->{'descendant_counts'}) { }
792 2 4 unless exists $descendant_counts->{$node}
798 1 15 unless exists $hashified->{$node}
805 36 74 if ($q =~ /^\Q$p$self->{'path_col_sep'}\E/)
806 10 26 if (not $args->{'generations'}) { }
813 17 9 if scalar(@d) - scalar(@c) <= $args->{'generations'}
910 8 25 if (defined $args)
911 2 6 unless ref $args and &reftype($args) eq 'HASH'
919 39 388 if ($args->{'root_str'}) { }
923 26 362 if ($args->{'remove_leading_path_col_sep'}) { }
930 52 375 if ($args->{'key_delim'})
991 9 6 if (defined $args)
992 2 7 unless ref $args and &reftype($args) eq 'HASH'
995 8 5 if (exists $args->{$w})
997 2 6 unless $args->{$w} =~ /^\d+$/
1019 156 342 if (scalar @{$components_by_row[$r];} == $depth)
1027 120 36 length $parent_of_name ? :
1038 120 36 if length $parent_of_name
1127 13 1 if (defined $args) { }
1128 2 11 unless ref $args and &reftype($args) eq 'HASH'
1131 1 10 unless exists $args->{'adjacentified'}
1134 2 8 unless ref $args->{'adjacentified'} and &reftype($args->{'adjacentified'}) eq 'ARRAY'
1153 7 1 defined $args->{'csvfile'} ? :
1165 0 8 unless open my $OUT, '>:encoding(utf8)', $csvfile
1167 1 7 defined $csv_args->{'eol'} ? :
1175 0 8 unless close $OUT