Branch Coverage

blib/lib/XML/MyXML.pm
Criterion Covered Total %
branch 108 170 63.5


line true false branch
104 0 91 unless defined $string
135 0 186 unless defined $string
155 1 7 $reference =~ /\&\#/ ? :
2 8 if ($reference =~ /\&\#x/) { }
174 0 3 unless defined $object
193 1 42 if ($flags->{'file'})
194 0 1 unless open my $fh, "<", $xml
199 5 38 if ($flags->{'bytes'} or $flags->{'file'})
201 5 0 if not defined $encoding or $encoding =~ /^utf\-?8\z/i
202 0 5 unless my $encoding_obj = &find_encoding($encoding)
203 1 4 unless eval { do { $xml = $encoding_obj->decode($xml, 1); 1 } }
216 0 373 if ($item =~ /\A\z/)
220 0 1 unless ($item =~ /\?>\z/)
228 42 4 if ($item =~ /\S/) { }
235 0 42 unless @items = grep(defined($_), @items)
245 0 366 if ($item =~ m[^\\z]) { }
113 253 elsif ($item =~ m[^\]+)\>\z]) { }
124 129 elsif ($item =~ m[^\<[^>]+?(/)?\>\z]) { }
129 0 elsif ($item =~ /^[^<>]*\z/) { }
249 0 113 unless $stack[-1]{'el_name'} eq $el_name
252 1 112 unless @{$stack_entry->{'content'};}
257 0 124 unless defined $el_name
266 0 52 unless defined $attr_name
269 10 114 $is_self_closing ? :
277 114 10 unless $is_self_closing
279 114 10 unless $is_self_closing
291 1 41 if @stack
302 32 46 if (not defined $stuff->{'el_name'} and defined $stuff->{'text'}) { }
309 7 39 if (not defined $stuff->{'content'} && @{$stuff->{'content'};}) { }
342 11 8 exists $flags->{'indentstring'} ? :
344 10 9 unless defined $object->{'content'} and @{$object->{'content'};}
349 5 6 if (defined $child->{'text'} and $child->{'text'} =~ /\S/)
354 5 4 if $hastext
356 0 6 unless not defined $_->{'text'}
539 9 12 ref $arref eq 'HASH' ? :
541 0 21 if @residue
543 0 21 unless defined $el_name
545 12 9 if (not ref $value) { }
546 0 12 if ($key eq '!as_is') { }
12 0 elsif (defined $value and length $value) { }
547 0 0 unless $value->check_xml
557 0 21 if ($flags->{'tidy'})
559 0 0 exists $flags->{'indentstring'} ? :
563 0 21 if $flags->{'complete'}
564 0 21 if $flags->{'xslt'}
567 1 20 if (defined $flags->{'save'})
568 0 1 unless open my $fh, ">", $flags->{'save'}
574 1 20 if $flags->{'bytes'}
581 90 37 if (not ref $thing) { }
13 24 elsif (ref $thing eq 'HASH') { }
24 0 elsif (ref $thing eq 'ARRAY') { }
590 19 18 if (not ref $key) { }
604 4 7 if (ref $arref eq "HASH")
610 0 16 unless defined $el_name
613 0 16 if ($key eq '!as_is') { }
14 2 elsif (not ref $value) { }
614 0 0 unless $value->check_xml
617 14 0 if (defined $value and length $value) { }
637 0 4 unless defined $el_name
639 0 4 if ($key eq '!as_is') { }
4 0 elsif (not ref $value) { }
640 0 0 unless $value->check_xml
643 2 2 if (defined $value and length $value) { }
680 7 0 if defined $object
689 0 57 unless defined $object
692 0 57 $flags->{'arrayref'} ? :
700 0 57 unless defined $object
705 44 58 if (defined(my $key = $stuff->{'el_name'})) { }
58 0 elsif (defined(my $value = $stuff->{'text'})) { }
706 1 43 if $flags->{'strip_ns'}
710 0 58 if $flags->{'strip'}
711 25 33 if $value =~ /\S/
715 32 0 %$hashref ? :
722 0 0 unless defined $object
727 0 0 if (defined(my $key = $stuff->{'el_name'})) { }
0 0 elsif (defined(my $value = $stuff->{'text'})) { }
728 0 0 if $flags->{'strip_ns'}
731 0 0 if $flags->{'strip'}
732 0 0 if $value =~ /\S/
736 0 0 @$arrayref ? :