Branch Coverage

blib/lib/XML/MyXML.pm
Criterion Covered Total %
branch 107 170 62.9


line true false branch
104 0 91 unless defined $string
135 0 184 unless defined $string
154 0 7 $reference =~ /\&\#/ ? :
1 7 $reference =~ /\&\#x/ ? :
173 0 3 unless defined $object
192 1 42 if ($flags->{'file'})
193 0 1 unless open my $fh, "<", $xml
198 5 38 if ($flags->{'bytes'} or $flags->{'file'})
200 5 0 if not defined $encoding or $encoding =~ /^utf\-?8\z/i
201 0 5 unless my $encoding_obj = &find_encoding($encoding)
202 1 4 unless eval { do { $xml = $encoding_obj->decode($xml, 1); 1 } }
215 0 373 if ($item =~ /\A\z/)
219 0 1 unless ($item =~ /\?>\z/)
227 42 4 if ($item =~ /\S/) { }
234 0 42 unless @items = grep(defined($_), @items)
244 0 366 if ($item =~ m[^\\z]) { }
113 253 elsif ($item =~ m[^\]+)\>\z]) { }
124 129 elsif ($item =~ m[^\<[^>]+?(/)?\>\z]) { }
129 0 elsif ($item =~ /^[^<>]*\z/) { }
248 0 113 unless $stack[-1]{'el_name'} eq $el_name
251 1 112 unless @{$stack_entry->{'content'};}
256 0 124 unless defined $el_name
265 0 52 unless defined $attr_name
268 10 114 $is_self_closing ? :
276 114 10 unless $is_self_closing
278 114 10 unless $is_self_closing
290 1 41 if @stack
301 32 46 if (not defined $stuff->{'el_name'} and defined $stuff->{'text'}) { }
308 7 39 if (not defined $stuff->{'content'} && @{$stuff->{'content'};}) { }
341 11 8 exists $flags->{'indentstring'} ? :
343 10 9 unless defined $object->{'content'} and @{$object->{'content'};}
348 5 6 if (defined $child->{'text'} and $child->{'text'} =~ /\S/)
353 5 4 if $hastext
355 0 6 unless not defined $_->{'text'}
538 9 12 ref $arref eq 'HASH' ? :
540 0 21 if @residue
542 0 21 unless defined $el_name
544 12 9 if (not ref $value) { }
545 0 12 if ($key eq '!as_is') { }
12 0 elsif (defined $value and length $value) { }
546 0 0 unless $value->check_xml
556 0 21 if ($flags->{'tidy'})
558 0 0 exists $flags->{'indentstring'} ? :
562 0 21 if $flags->{'complete'}
563 0 21 if $flags->{'xslt'}
566 1 20 if (defined $flags->{'save'})
567 0 1 unless open my $fh, ">", $flags->{'save'}
573 1 20 if $flags->{'bytes'}
580 90 37 if (not ref $thing) { }
13 24 elsif (ref $thing eq 'HASH') { }
24 0 elsif (ref $thing eq 'ARRAY') { }
589 19 18 if (not ref $key) { }
603 4 7 if (ref $arref eq "HASH")
609 0 16 unless defined $el_name
612 0 16 if ($key eq '!as_is') { }
14 2 elsif (not ref $value) { }
613 0 0 unless $value->check_xml
616 14 0 if (defined $value and length $value) { }
636 0 4 unless defined $el_name
638 0 4 if ($key eq '!as_is') { }
4 0 elsif (not ref $value) { }
639 0 0 unless $value->check_xml
642 2 2 if (defined $value and length $value) { }
679 7 0 if defined $object
688 0 57 unless defined $object
691 0 57 $flags->{'arrayref'} ? :
699 0 57 unless defined $object
704 44 58 if (defined(my $key = $stuff->{'el_name'})) { }
58 0 elsif (defined(my $value = $stuff->{'text'})) { }
705 1 43 if $flags->{'strip_ns'}
709 0 58 if $flags->{'strip'}
710 25 33 if $value =~ /\S/
714 32 0 %$hashref ? :
721 0 0 unless defined $object
726 0 0 if (defined(my $key = $stuff->{'el_name'})) { }
0 0 elsif (defined(my $value = $stuff->{'text'})) { }
727 0 0 if $flags->{'strip_ns'}
730 0 0 if $flags->{'strip'}
731 0 0 if $value =~ /\S/
735 0 0 @$arrayref ? :