Branch Coverage

blib/lib/TreePath.pm
Criterion Covered Total %
branch 118 138 85.5


line true false branch
141 1 6 if defined $self->config->{'rules'}
148 1 0 if $self->can('_populate_backend')
157 43 0 unless $self->debug
196 2 43 unless defined $nodes_sorted_by_id[0]
205 25 15 unless $self->_backend and $self->_sync
215 11 4 unless $self->_backend and $self->_sync
227 40 9 unless $self->_backend and $self->_sync
236 1 120 unless defined $$node{'id'}
239 113 8 if not defined $self->config && defined $self->config->{'rules'} or $$node{'id'} == 1
245 8 0 if (defined $$node{$self->_type_field}) { }
246 8 0 if (defined $$rules{$$node{$self->_type_field}}) { }
247 5 3 if (defined $$rules{$$node{$self->_type_field}}{$$parent{$self->_type_field}}) { }
263 41 37 if (not defined $$child{$self->_position_field} or $$child{$self->_position_field} != $n)
266 18 23 defined $$child{$self->_position_field} ? :
287 23 20 if ($$child{$self->_search_field} eq $$node{$self->_search_field} and $$child{'parent'} eq $$node{'parent'})
302 24 60 if ($k eq 'parent') { }
303 22 2 if ($$node{'parent'}) { }
322 22 202 if (defined $$parent{$self->_type_field}) { }
325 19 3 if (defined $$node{$self->_type_field}) { }
328 14 5 if ($$node{$self->_type_field} eq $$parent{$self->_type_field}) { }
343 0 202 if (defined $$node{$self->_type_field}) { }
362 214 414 if ($key =~ /(.*)\.(.*)/) { }
364 167 47 if (defined $$tree{$id}{$1} and ref $$tree{$id}{$1}) { }
370 410 4 if (defined $$tree{$id}{$key}) { }
378 444 133 if ($current ne $value)
384 78 444 if ($found)
385 9 69 if (wantarray) { }
395 20 0 unless wantarray or $$results[0]
407 16 0 unless defined $$opts{'by'}
409 0 16 unless $path =~ m[^/]
420 44 16 if $result
422 44 16 if ($result) { }
431 4 12 if (wantarray) { }
435 4 8 if ($not_found[-1]) { }
455 0 0 unless defined $var
465 0 71 unless $node
467 23 48 unless defined $$args{'_count'}
470 19 52 unless ($funcref)
473 19 32 unless defined $$args{'_each_nodes'}
475 51 0 if (defined $node)
482 23 48 if ($$args{'_count'} == 1)
483 0 23 unless &$funcref($node, $args)
487 26 45 if (defined $$node{$key_children})
490 0 48 unless &$funcref($child, $args)
496 19 52 if $nofunc
513 8 7 if defined $$node{$self->_position_field}
528 44 71 unless defined $$node{'id'}
531 5 110 if (not $position and defined $$node{$self->_position_field})
535 13 102 unless ($parent)
536 4 9 if ($self->root)
545 1 110 unless $self->_check_rules($node, $parent)
549 70 40 if $self->tree->{$$node{'id'}}
558 101 9 if (defined $parent and $parent)
562 101 0 if ($parent)
563 9 92 if ($position) { }
569 11 81 if (defined ${$$parent{$key_children};}[0] and ${$$parent{$key_children};}[0]{$self->_position_field})
576 40 70 unless $is_exist_in_backend
579 9 101 unless $parent
582 20 81 if $update_children
590 0 3 unless (defined $$sibling{$self->_position_field})
603 0 14 if (not defined $$node{$k}) { }
0 14 elsif ($$node{$k} eq $$datas{$k}) { }
616 2 12 if ($k eq $self->_position_field) { }
1 11 elsif ($k eq $self->_type_field) { }
9 2 elsif ($k eq 'parent') { }
621 2 0 if defined $$node{$self->_position_field}
626 1 0 unless $self->_check_rules({'type', $$datas{$k}}, $$node{'parent'})
630 1 8 unless $self->_check_rules($node, $$datas{'parent'})
643 2 6 if (defined $$node{$self->_position_field})