Branch Coverage

blib/lib/Treex/PML/Instance.pm
Criterion Covered Total %
branch 49 342 14.3


line true false branch
131 0 0 if (&blessed($filename) and $filename->isa('URI') and $filename->scheme eq 'file')
139 0 0 if ($filename and not &blessed($filename) && $filename->isa('URI'))
178 0 0 ref $refs ? :
191 0 0 $refs ? :
196 0 0 unless $refs
208 102 0 if ($references)
211 50 0 if ($refids) { }
212 0 50 ref $refids ? :
214 50 0 if ($href) { }
239 0 25 defined $selected ? :
0 25 if defined $selected ? $selected == 0 : $ctxt->{'_no_references'}
241 25 0 if (defined $readas)
242 17 8 if ($readas eq 'dom') { }
2 6 elsif ($readas eq 'trees') { }
6 0 elsif ($readas eq 'pml') { }
0 0 elsif (length $readas) { }
267 6 0 $opts ? :
287 0 26 unless $ref_fh
290 26 0 if ($ref_fh) { }
294 0 26 if $@
295 26 0 if $ref_data and $ref_data->can('setBaseURI')
302 10 16 if ($href ne $local_file and $remove_file)
307 0 0 if ($href ne $local_file and $remove_file)
323 0 36 if (ref $opts and $parser->can('set_options'))
335 0 71 if ref $class
361 0 0 unless defined $id and length $id
365 0 0 if ($check_uniq)
367 0 0 if (defined $current and $current != $object)
371 0 0 if (ref $object) { }
404 54 703 if (UNIVERSAL::DOES::does($node, 'Treex::PML::Instance'))
408 0 757 unless (defined $path)
413 0 815 if $step eq '.'
415 1 814 if ($is_list or UNIVERSAL::DOES::does($val, 'Treex::PML::Alt')) { }
0 814 elsif (UNIVERSAL::DOES::does($val, 'Treex::PML::Seq')) { }
760 54 elsif (ref $val) { }
0 54 elsif (defined $val) { }
416 0 1 if ($step =~ /^\[([-+]?\d+)\]/) { }
0 1 elsif ($strict) { }
417 0 0 $1 < 0 ? :
0 0 $1 > 0 ? :
425 1 0 $is_list ? :
1 0 unless $step eq ($is_list ? 'LM' : 'AM')
428 0 0 if ($step =~ /^\[([-+]?\d+)\](.*)/) { }
0 0 elsif ($step =~ /^([^\[]+)(?:\[([-+]?\d+)\])?/) { }
429 0 0 $1 < 0 ? :
0 0 $1 > 0 ? :
432 0 0 if ($val)
433 0 0 if (defined $2 and length $2)
434 0 0 if $val->[0] ne $2
441 0 0 if ($i ne '')
442 0 0 $i < 0 ? :
0 0 $i > 0 ? :
462 0 0 if (UNIVERSAL::DOES::does($node, 'Treex::PML::Instance'))
469 0 0 ref $path ? :
471 0 0 if $dot
476 0 0 if ($is_list or UNIVERSAL::DOES::does($val, 'Treex::PML::Alt')) { }
0 0 elsif (UNIVERSAL::DOES::does($val, 'Treex::PML::Seq')) { }
0 0 elsif (ref $val) { }
477 0 0 if ($step =~ /^\[([-+]?\d+)\]/) { }
478 0 0 $1 < 0 ? :
0 0 $1 > 0 ? :
481 0 0 $is_list ? :
0 0 unless $step eq ($is_list ? 'LM' : 'AM')
486 0 0 if ($step =~ /^\[([-+]?\d+)\](.*)/) { }
0 0 elsif ($step =~ /^([^\[]+)(?:\[([-+]?\d+)\])?/) { }
487 0 0 $1 < 0 ? :
0 0 $1 > 0 ? :
490 0 0 $val->[0] eq $2 ? :
0 0 defined $2 && length $2 ? :
0 0 $val ? :
498 0 0 if (defined $i and length $i) { }
499 0 0 $i < 0 ? :
0 0 $i > 0 ? :
511 0 0 if $redo
513 0 0 if $dot
514 0 0 UNIVERSAL::DOES::does($_, 'Treex::PML::List') || UNIVERSAL::DOES::does($_, 'Treex::PML::Alt') ? :
517 0 0 UNIVERSAL::DOES::does($_, 'Treex::PML::List') || UNIVERSAL::DOES::does($_, 'Treex::PML::Alt') ? :
522 0 0 if (UNIVERSAL::DOES::does($node, 'Treex::PML::Instance'))
529 0 0 if (UNIVERSAL::DOES::does($val, 'Treex::PML::List') or UNIVERSAL::DOES::does($val, 'Treex::PML::Alt')) { }
0 0 elsif (UNIVERSAL::DOES::does($val, 'Treex::PML::Seq')) { }
0 0 elsif (ref $val) { }
0 0 elsif (defined $val) { }
530 0 0 if ($step =~ /^\[([-+]?\d+)\]/) { }
0 0 elsif ($strict) { }
531 0 0 if (@steps) { }
532 0 0 $1 < 0 ? :
0 0 $1 > 0 ? :
537 0 0 $1 < 0 ? :
0 0 $1 > 0 ? :
542 0 0 if $strict == 2
546 0 0 if (@steps) { }
554 0 0 if ($step =~ /^\[([-+]?\d+)\](.*)/) { }
0 0 elsif ($step =~ /^([^\[]+)(?:\[([-+]?\d+)\])?/) { }
556 0 0 $i < 0 ? :
0 0 $i > 0 ? :
558 0 0 if (defined $el and defined $2 and length $2 and $el->[0] ne $2)
560 0 0 if $strict == 2
564 0 0 if (@steps) { }
567 0 0 if (UNIVERSAL::DOES::does($value, 'Treex::PML::Seq::Element')) { }
0 0 elsif (ref $$val[$i - 1]) { }
570 0 0 $i < 0 ? :
0 0 $i > 0 ? :
577 0 0 if $strict == 2
585 0 0 unless (@steps)
586 0 0 $1 < 0 ? :
0 0 $1 > 0 ? :
588 0 0 if (defined $val) { }
589 0 0 if (UNIVERSAL::DOES::does($value, 'Treex::PML::Seq::Element')) { }
599 0 0 if $strict == 2
608 0 0 if (@steps) { }
609 0 0 unless (defined $val->{$step} or $steps[0] =~ /^\[/)
619 0 0 if $strict == 2
638 0 0 if (defined $m_step and length $m_step == 0) { }
0 0 elsif ($m_step eq $step or $m_step eq '*') { }
0 0 elsif (not $m_step =~ /^\[/) { }
644 0 0 if (not length $s) { }
0 0 elsif ($s eq $m_step) { }
656 0 0 if (@p > 0 and length $p[0] == 0)
664 0 0 if (UNIVERSAL::isa($paths, 'HASH')) { }
671 0 0 if (UNIVERSAL::DOES::does($obj, 'Treex::PML::Instance')) { }
0 0 elsif (exists $opts->{'type'}) { }
672 0 0 if (exists $opts->{'type'}) { }
681 0 0 if @match_paths
686 0 0 $path eq '/' ? :
689 0 0 if (defined $type)
691 0 0 if ($dt == 11 or $dt == 12 or $dt == 13)
698 0 0 if (@{$m->[0];} > 0) { }
703 0 0 if (UNIVERSAL::isa($cb, 'ARRAY'))
709 0 0 if @m
714 0 0 if ($val)
716 0 0 if (defined $type and $dt == 7 and not UNIVERSAL::DOES::does($val, 'Treex::PML::Alt'))
720 0 0 if (UNIVERSAL::DOES::does($val, 'Treex::PML::List') || UNIVERSAL::DOES::does($val, 'Treex::PML::Alt') and !defined($dt) || $dt == 6 || $dt == 7) { }
0 0 elsif (UNIVERSAL::DOES::does($val, 'Treex::PML::Seq') and !defined($dt) || $dt == 5) { }
0 0 elsif (UNIVERSAL::isa($val, 'HASH') and !defined($dt) || $dt == 3 || $dt == 4) { }
737 0 0 if (not defined $type or defined $content_type)
749 0 0 if (not defined $type or defined $content_type)
760 0 0 unless (UNIVERSAL::isa($path_list, 'ARRAY'))
761 0 0 if (ref $path_list) { }
770 0 0 wantarray ? :
775 0 0 unless (UNIVERSAL::isa($path_list, 'ARRAY'))
776 0 0 if (ref $path_list) { }
792 0 0 unless &blessed($value) and $decl->isa('Treex::PML::Schema::Decl') and ref $callback eq 'CODE' and ref $opts eq 'HASH'
804 0 0 if ($decl_is == 3) { }
0 0 elsif ($decl_is == 4) { }
0 0 elsif ($decl_is == 5) { }
0 0 elsif ($decl_is == 6 or $decl_is == 7) { }
0 0 elsif ($decl_is == 9 or $decl_is == 10 or $decl_is == 8) { }
806 0 0 if ($opts->{'no_childnodes'})
809 0 0 unless not defined $role
812 0 0 if ($opts->{'no_trees'})
815 0 0 unless not defined $role
821 0 0 if defined $v
828 0 0 if defined $v
832 0 0 if $v
839 0 0 if $v and $e
842 0 0 if ($decl_is == 7 and not UNIVERSAL::DOES::does($value, 'Treex::PML::Alt'))
847 0 0 if defined $v
868 0 22 unless (ref $fsfile)
875 0 22 if ($schema->isa('Treex::PML::Schema') and not UNIVERSAL::DOES::does($schema, 'Treex::PML::Schema'))
900 0 22 if ($ctxt->{'_pi'})
904 0 0 unless defined $_
913 22 0 if $ctxt->{'_trees'}
919 0 97 unless $node_decl
925 7 12 if not $uniq{$_}
927 0 0 if not $uniq{$_}
928 0 22 if (@order > 1)
932 0 22 if (@hide > 1)
937 7 15 if @order
938 0 22 if @hide
950 10 0 unless (ref $ctxt)
981 0 10 if (defined $hint and length $hint)