Branch Coverage

blib/lib/Data/SimplePath.pm
Criterion Covered Total %
branch 112 112 100.0


line true false branch
38 4 964 unless exists $config{$key}
39 6 958 if (defined $value)
54 66 272 unless $num =~ /$valid_number/
55 86 186 $num == 0 ? :
67 1 4 unless _global($key, $value)
297 137 176 _hashref($config) ? :
304 106 207 if _valid_root($init)
305 180 133 if defined $init and not $$self{'DATA'}
309 868 1120 ref shift() eq 'ARRAY' ? :
310 776 950 ref shift() eq 'HASH' ? :
313 124 110 if warnings::enabled()
321 46 250 unless ($number = _number($number))
334 3 1030 if ref $root eq 'Data::SimplePath'
335 644 389 _arrayref($root) || _hashref($root) ? :
370 49 758 if not exists $$self{$key} or $key eq 'DATA'
371 731 27 unless defined $new
399 1 1 if $$self{'DATA'}
400 1 1 $$self{'DATA'} ? :
429 120 127 unless $$self{'DATA'}
430 2 125 if (wantarray)
433 1 1 _hashref($new) ? :
484 174 456 unless $root = $self->_find_element($root, $top)
500 335 366 if (_hashref($root)) { }
263 103 elsif (_arrayref($root)) { }
501 38 297 unless exists $$root{$key}
502 244 53 if _valid_root($$root{$key})
506 32 231 unless $key = _is_number($key)
507 21 210 unless @{$root;} > $key
508 148 62 if _valid_root($$root[$key])
537 137 92 unless $ref
538 45 47 if (_valid_root($ref))
539 39 6 unless wantarray
542 3 3 _hashref($new) ? :
587 6 29 unless (@path)
588 5 1 unless _valid_root($value)
594 4 25 unless ($$self{'DATA'})
595 1 3 $self->auto_array && _number($path[0]) ? :
606 4 80 unless (_valid_root($root))
612 23 57 unless (@path)
613 5 18 if (_arrayref($root)) { }
614 2 3 unless $top = _is_number($top)
632 22 35 if (not $child or $self->replace_leaf and not _valid_root($child))
641 8 14 if (_arrayref($root)) { }
645 2 6 unless $top = _number($top)
650 1 5 if ($self->auto_array and _number($path[0])) { }
660 3 11 if ($self->auto_array and _number($path[0])) { }
700 2 14 unless (@path)
705 13 14 unless (@path)
706 5 8 if (_hashref($root)) { }
7 1 elsif (_arrayref($root)) { }
710 2 5 unless $top = _is_number($top)
711 4 1 if @$root > $top
715 1 13 unless $root = $self->_find_element($root, $top)
757 56 56 if _arrayref($path[0])
787 178 251 if ($key and _arrayref($key))
790 403 28 if defined $_ and not ref $_ and $_ ne ''