Branch Coverage

blib/lib/XML/TreePP/Editor.pm
Criterion Covered Total %
branch 97 432 22.4


line true false branch
141 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
142 0 0 if (not defined $self) { }
146 0 0 if @_ >= 1 and ref $_[0] eq 'XML::TreePP'
148 0 0 if (defined $$self{'tppx'} and ref $$self{'tppx'} eq 'XML::TreePP::XMLPath')
199 10 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
200 0 10 if (not defined $self) { }
204 0 10 if @_ >= 1 and ref $_[0] eq 'XML::TreePP::XMLPath'
209 0 10 if (defined $$self{'tpp'} and ref $$self{'tpp'} eq 'XML::TreePP')
249 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or return undef
252 0 0 if (defined $val) { }
286 10 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or return undef
288 0 10 if exists $$self{$key}
331 0 1 if exists $args{'tpp'}
332 0 1 if exists $args{'tppx'}
368 0 1 if (@_ == 0)
369 0 0 unless defined $$self{'_debug'}
445 10 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
446 0 10 unless (@_ >= 3)
458 0 10 if (defined $self and defined $self->get('tpp')) { }
459 0 0 $self ? :
460 0 0 $self ? :
470 0 6 if ref $nodename
471 0 6 if $nodename eq $xml_text_id
472 2 4 if $nodename =~ /^$xml_attr_id\w+$/
473 0 4 if $nodename eq '..'
474 0 4 if $nodename eq '.'
480 1 5 if &$whatisnode($nodename) eq $compare
495 0 0 if (not ref $parentnode) { }
0 0 elsif (ref $parentnode eq 'ARRAY') { }
0 0 elsif (ref $parentnode eq 'HASH') { }
499 0 0 if (@{$parentnode;} == 0)
509 0 0 if (not ref $value and defined $value and defined $stringname) { }
0 0 elsif (not ref $value || defined $stringname) { }
0 0 elsif (ref $value) { }
514 0 0 if ref $value eq 'HASH'
515 0 0 if ref $value eq 'ARRAY'
520 0 0 if (ref $$parentnode{$childname} eq 'ARRAY') { }
521 0 0 if (defined $childpos and $childpos >= 1 and $childpos <= @{$$parentnode{$childname};}) { }
0 0 elsif (not defined $childpos) { }
522 0 0 if (defined $stringname and &$isnodetype($stringname, 'text')) { }
0 0 elsif (defined $stringname) { }
524 0 0 if (ref $$parentnode{$childname}[$childpos - 1] eq 'HASH') { }
0 0 elsif (not ref $$parentnode{$childname}[$childpos - 1]) { }
537 0 0 if (not exists $$parentnode{$childname}[$childpos - 1]{$vk}) { }
0 0 elsif (exists $$parentnode{$childname}[$childpos - 1]{$vk}) { }
541 0 0 if (&$isnodetype($vk, 'text')) { }
0 0 elsif (&$isnodetype($vk, 'attribute')) { }
0 0 elsif (ref $$parentnode{$childname}[$childpos - 1]{$vk} eq 'ARRAY') { }
549 0 0 if ref $$newchildnode[0]{$vk} ne 'ARRAY'
550 0 0 if ref $$newchildnode[0]{$vk} eq 'ARRAY'
554 0 0 if ref $$newchildnode[0]{$vk} ne 'ARRAY'
555 0 0 if ref $$newchildnode[0]{$vk} eq 'ARRAY'
564 0 0 if (defined $stringname and &$isnodetype($stringname, 'text')) { }
0 0 elsif (defined $stringname) { }
565 0 0 if (ref $$parentnode{$childname}[$childpos - 1] eq 'HASH') { }
0 0 elsif (not ref $$parentnode{$childname}[$childpos - 1]) { }
581 0 0 unless defined $stringname
582 0 0 if defined $stringname
586 0 0 if (not defined $childpos or $childpos == 1) { }
587 0 0 if (defined $stringname and &$isnodetype($stringname, 'text')) { }
0 0 elsif (defined $stringname) { }
589 0 0 if (ref $$parentnode{$childname} eq 'HASH') { }
0 0 elsif (not ref $$parentnode{$childname}) { }
604 0 0 unless defined $stringname
605 0 0 if defined $stringname
620 0 5 unless (ref $targetnode eq 'HASH' and ref $mergenode eq 'HASH' and defined $action)
624 2 6 if ($action eq 'mergeadd') { }
3 3 elsif ($action eq 'mergeappend') { }
2 1 elsif ($action eq 'mergereplace') { }
1 0 elsif ($action eq 'mergedelete') { }
625 0 2 if (exists $$targetnode{$vk} and ref $$targetnode{$vk}) { }
1 1 elsif (exists $$targetnode{$vk} and not ref $$targetnode{$vk} and defined $$targetnode{$vk} and $$targetnode{$vk} ne '') { }
639 2 1 if (&$isnodetype($vk, 'text') or &$isnodetype($vk, 'attribute') or not ref $$targetnode{$vk} and $$mergenode{$vk} =~ /\w+/)
649 1 0 if (exists $$targetnode{$vk})
668 0 5 if (not ref $parentnode) { }
0 5 elsif (ref $parentnode eq 'ARRAY') { }
5 0 elsif (ref $parentnode eq 'HASH') { }
672 0 0 if (@{$parentnode;} == 0)
682 0 5 if (not ref $value and defined $value and defined $stringname) { }
0 5 elsif (not ref $value || defined $stringname) { }
5 0 elsif (ref $value) { }
687 5 0 if ref $value eq 'HASH'
688 0 5 if ref $value eq 'ARRAY'
693 5 0 if (ref $$parentnode{$childname} eq 'ARRAY') { }
0 0 elsif (ref $$parentnode{$childname} eq 'HASH') { }
695 5 0 if (defined $childpos and $childpos >= 1 and $childpos <= @{$$parentnode{$childname};}) { }
0 0 elsif (not defined $childpos) { }
702 0 0 unless defined $stringname
703 0 0 if defined $stringname
707 5 0 if (ref $$parentnode{$childname}[$tchildpos - 1] eq 'HASH') { }
0 0 elsif (not ref $$parentnode{$childname}[$tchildpos - 1]) { }
708 0 5 if (defined $stringname) { }
714 0 0 if (defined $stringname and &$isnodetype($stringname, 'text')) { }
716 0 0 if ($action eq 'replace') { }
0 0 elsif ($action eq 'append') { }
0 0 elsif ($action eq 'add') { }
0 0 elsif ($action eq 'delete') { }
723 0 0 unless ($$parentnode{$childname}[$tchildpos - 1] =~ /\w+/)
732 0 0 if (defined $$parentnode{$childname}[$tchildpos - 1] and $$parentnode{$childname}[$tchildpos - 1] =~ /\w+/) { }
737 0 0 if (defined $stringname) { }
746 0 0 if (defined $childpos and $childpos == 1 or not defined $childpos) { }
747 0 0 if (defined $stringname) { }
753 0 0 unless defined $stringname
754 0 0 if defined $stringname
758 0 0 if (defined $childpos and $childpos == 1 or not defined $childpos) { }
759 0 0 if (defined $stringname and &$isnodetype($stringname, 'text')) { }
761 0 0 if ($action eq 'replace') { }
0 0 elsif ($action eq 'append') { }
0 0 elsif ($action eq 'add') { }
0 0 elsif ($action eq 'delete') { }
768 0 0 unless ($$parentnode{$childname} =~ /\w+/)
777 0 0 if (defined $$parentnode{$childname} and $$parentnode{$childname} =~ /\w+/) { }
782 0 0 if (defined $stringname) { }
789 0 0 unless defined $stringname
790 0 0 if defined $stringname
807 0 1 if (not ref $parentnode) { }
0 1 elsif (ref $parentnode eq 'ARRAY') { }
1 0 elsif (ref $parentnode eq 'HASH') { }
811 0 0 if (@{$parentnode;} == 0)
821 0 1 if (not ref $value and defined $value and defined $stringname) { }
0 1 elsif (not ref $value || defined $stringname) { }
1 0 elsif (ref $value) { }
826 1 0 if ref $value eq 'HASH'
827 0 1 if ref $value eq 'ARRAY'
832 0 1 if (not ref $$parentnode{$childname}) { }
0 1 elsif (ref $$parentnode{$childname} eq 'HASH') { }
1 0 elsif (ref $$parentnode{$childname} eq 'ARRAY') { }
833 0 0 if ($$parentnode{$childname} =~ /\w+/) { }
835 0 0 if ($childpos == 1) { }
847 0 0 if ($childpos == 1) { }
857 1 0 if ($childpos >= 1 and $childpos <= $size) { }
879 0 4 if (not ref $parentnode) { }
0 4 elsif (ref $parentnode eq 'ARRAY') { }
4 0 elsif (ref $parentnode eq 'HASH') { }
883 0 0 if (@{$parentnode;} == 0)
893 0 4 if (not ref $value and defined $value and defined $stringname) { }
0 4 elsif (not ref $value || defined $stringname) { }
898 4 0 if ref $value eq 'HASH'
899 0 4 if ref $value eq 'ARRAY'
902 4 0 if (ref $$parentnode{$childname} eq 'ARRAY') { }
903 4 0 if (defined $childpos and $childpos >= 1 and $childpos <= @{$$parentnode{$childname};}) { }
0 0 elsif (not defined $childpos) { }
904 0 4 if (defined $stringname) { }
906 0 0 if (ref $$parentnode{$childname}[$childpos - 1] eq 'HASH') { }
0 0 elsif ($$parentnode{$childname}[$childpos - 1] =~ /\w+/ and &$isnodetype($stringname, 'text')) { }
920 0 0 if (defined $stringname) { }
922 0 0 if $XML::TreePP::Editor::DEBUG
924 0 0 if (ref $$parentnode{$childname}[$i] eq 'HASH') { }
0 0 elsif ($$parentnode{$childname}[$i] =~ /\w+/ and &$isnodetype($stringname, 'text')) { }
934 0 0 if $XML::TreePP::Editor::DEBUG
939 0 0 unless defined $stringname
940 0 0 if defined $stringname
944 0 0 if (not defined $childpos or $childpos == 1) { }
945 0 0 if (defined $stringname) { }
947 0 0 if (ref $$parentnode{$childname} eq 'HASH') { }
0 0 elsif ($$parentnode{$childname} =~ /\w+/ and &$isnodetype($stringname, 'text')) { }
959 0 0 unless defined $stringname
960 0 0 if defined $stringname
976 0 4 if (not ref $parentnode) { }
0 4 elsif (ref $parentnode eq 'ARRAY') { }
4 0 elsif (ref $parentnode eq 'HASH') { }
980 0 0 if (@{$parentnode;} == 0)
988 4 0 if (ref $$parentnode{$childname} eq 'ARRAY') { }
989 4 0 if (defined $childpos and $childpos >= 1 and $childpos - 1 <= @{$$parentnode{$childname};}) { }
0 0 elsif (not defined $childpos) { }
990 0 4 if (defined $stringname) { }
991 0 0 if (ref $$parentnode{$childname}[$childpos - 1] eq 'HASH') { }
0 0 elsif ($$parentnode{$childname}[$childpos - 1] =~ /\w+/ and &$isnodetype($stringname, 'text')) { }
1005 0 0 if (defined $stringname) { }
1007 0 0 if (ref $$parentnode{$childname}[$i] eq 'HASH') { }
0 0 elsif ($$parentnode{$childname}[$i] =~ /\w+/ and &$isnodetype($stringname, 'text')) { }
1022 0 0 unless defined $stringname
1023 0 0 if defined $stringname
1027 0 0 if (not defined $childpos or $childpos == 1) { }
1028 0 0 if (defined $stringname) { }
1034 0 0 unless defined $stringname
1035 0 0 if defined $stringname
1052 0 2 if ($action ne 'insert' and $action ne 'replace' and $action ne 'delete' and $action ne 'mergeadd' and $action ne 'mergeappend' and $action ne 'mergereplace' and $action ne 'mergedelete')
1059 14 0 if ($$child_path[1])
1060 14 0 if ($$child_path[1][0][0] =~ /^\d*$/)
1066 14 0 if (ref $xref eq 'HASH') { }
0 0 elsif (ref $xref eq 'ARRAY') { }
1069 0 14 if (not defined $position and ref $$xref{$$child_path[0]} eq 'ARRAY' and defined $$child_path[1] and @{$$child_path[1];} > 0) { }
1072 0 0 if (my $pass = $tppx->filterXMLDoc($$xref{$$child_path[0]}[$ipos], [['.', $$child_path[1]]]))
1082 1 13 if $action eq 'insert'
1083 4 10 if $action eq 'replace'
1084 4 10 if $action eq 'delete'
1085 1 13 if $action eq 'mergeadd'
1086 2 12 if $action eq 'mergeappend'
1087 1 13 if $action eq 'mergereplace'
1088 1 13 if $action eq 'mergedelete'
1095 0 0 if (not defined $position and ref $$e{$$child_path[0]} eq 'ARRAY' and defined $$child_path[1] and @{$$child_path[1];} > 0) { }
1098 0 0 if (my $pass = $tppx->filterXMLDoc($$e{$$child_path[0]}[$ipos], [['.', $$child_path[1]]]))
1108 0 0 if $action eq 'insert'
1109 0 0 if $action eq 'replace'
1110 0 0 if $action eq 'delete'
1111 0 0 if $action eq 'mergeadd'
1112 0 0 if $action eq 'mergeappend'
1113 0 0 if $action eq 'mergereplace'
1114 0 0 if $action eq 'mergedelete'
1129 1 9 if ($action eq 'insert')
1135 2 7 if ($action eq 'delete')
1179 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
1183 0 0 if defined $self
1197 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
1201 0 0 if defined $self
1215 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
1219 0 0 if defined $self
1233 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
1237 0 0 if defined $self
1251 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
1255 0 0 if defined $self
1269 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
1273 0 0 if defined $self
1287 0 0 if ref $_[0] eq $XML::TreePP::Editor::REF_NAME or undef
1290 0 0 if defined $self