Branch Coverage

blib/lib/Treex/PML/Schema.pm
Criterion Covered Total %
branch 129 280 46.0


line true false branch
257 0 63 unless (ref $opts)
266 16 47 if (defined $base and length $base) { }
24 23 elsif ($opts->{'use_resources'}) { }
276 0 63 if (defined $file and ref($schema = $opts->{'schemas'}{$file}))
277 0 0 if $Treex::PML::Debug
289 0 63 unless ($reader->nextElement('pml_schema', 'http://ufal.mff.cuni.cz/pdt/pml/schema/') == 1)
296 0 63 if ($@)
300 63 0 if (defined $version and length $version) { }
301 0 63 unless (cmp_revisions($version, '1.2') <= 0)
457 1 0 $root ? :
468 0 0 $types ? :
481 50 52 if ($self->{'reference'})
497 0 0 if ($self->{'reference'})
499 0 0 if defined $_->{'name'}
535 0 9 unless ref $type
537 9 0 if ($ref) { }
539 9 0 if (ref $rtype) { }
561 138 1 if (ref $self->{'root'})
565 125 153 if (ref $self->{$d})
580 0 93 unless ref $type
581 9 0 if (defined $type->{'type'} and length $type->{'type'} and not exists $$referred{$type->{'type'}})
585 9 0 if ref $resolved
594 0 0 unless (exists $src_schema->{'type'}{$name})
601 0 0 if (exists $self->{'type'}{$n}) { }
603 0 0 if (defined $parent) { }
617 0 0 exists $fmt->{$1} ? :
0 0 $1 eq '%' ? :
641 0 63 if ($opts->{'revision'} and $self->_match_revision($opts->{'revision'}) != 0) { }
646 0 63 if ($opts->{'minimal_revision'} and $self->_match_revision($opts->{'minimal_revision'}) < 0)
651 0 63 if ($opts->{'maximal_revision'} and $self->_match_revision($opts->{'maximal_revision'}) > 0)
671 0 2 if (ref $class) { }
681 0 2 if (ref $schema_hash->{'reference'})
690 2 0 if (defined $root)
701 2 0 if ($types)
741 99 0 if (defined $path and length $path) { }
0 0 elsif (not $decl) { }
742 2 97 if ($path =~ s[^!([^/]+)/?][]) { }
97 0 elsif ($path =~ s[^/][] or not $decl) { }
744 2 0 if (defined $decl) { }
753 0 495 if $step eq '.'
754 495 0 if (ref $decl) { }
756 97 356 if ($decl_is == 11 or $decl_is == 12 or $decl_is == 13 or $decl_is == 1)
761 0 139 unless defined $step and length $step
764 54 302 if ($decl_is == 6 or $decl_is == 7)
767 54 0 $decl_is == 6 ? :
54 0 if $step =~ /^\[[-+]?\d+\]$/ or $decl_is == 6 ? $step eq 'LM' || $step eq '[LIST]' : $step eq 'AM' || $step eq '[ALT]'
773 42 260 if ($decl_is == 3) { }
97 163 elsif ($decl_is == 4) { }
163 0 elsif ($decl_is == 5) { }
0 0 elsif ($decl_is == 2) { }
775 42 0 if ($member) { }
779 0 0 unless $member
780 0 0 if ($member->get_knit_name eq $step) { }
787 97 0 if ($step eq '#content')
797 0 0 if (not defined $step && length $step or $step eq $decl->get_name) { }
814 66 33 $decl && ($decl_is == 11 || $decl_is == 12 || $decl_is == 13 || $decl_is == 1 || $decl_is == 2) ? :
0 99 $noresolve ? :
840 0 0 if $_[0]{'role'} eq $role
841 0 0 if (defined $start_decls) { }
869 22 0 if (not $decl and wantarray)
878 280 1546 if defined $_[0]{'role'}
911 0 12 $first ? :
920 0 1859 unless ref $decl
923 33 1826 if ($cache->{'#RECURSE'}{$decl})
928 0 0 if (ref $opts and $opts->{'no_childnodes'} and defined $decl->{'role'} and $decl->{'role'} eq '#CHILDNODES')
932 76 1750 if (&$test($decl))
933 0 76 if ($first) { }
941 0 1826 $opts->{'with_Seq_brackets'} ? :
943 367 1459 if ($type_ref)
945 109 258 unless ($cached)
949 0 367 if ($decl_is == 4) { }
81 286 elsif ($decl_is == 6) { }
24 262 elsif ($decl_is == 7) { }
950 0 0 defined $_ && length $_ ? :
952 8 26 defined $_ && length $_ ? :
954 0 0 defined $_ && length $_ ? :
958 0 367 if $first and @result
960 132 1694 if ($decl_is == 3) { }
48 1646 elsif ($decl_is == 4) { }
34 1612 elsif ($decl_is == 5) { }
134 1478 elsif ($decl_is == 6) { }
28 1450 elsif ($decl_is == 7) { }
821 629 elsif ($decl_is == 1 or $decl_is == 2 or $decl_is == 11 or $decl_is == 12 or $decl_is == 13) { }
962 37 0 defined $_ && length $_ ? :
964 0 624 if $first and @res
970 0 0 defined $_ && length $_ ? :
972 0 28 if $first and @res
975 48 0 if ($cdecl)
976 51 0 defined $_ && length $_ ? :
978 0 48 if $first and @result
982 56 41 defined $_ && length $_ ? :
984 0 55 if $first and @res
988 19 15 defined $_ && length $_ ? :
991 0 0 defined $_ && length $_ ? :
1002 0 0 @result ? :
537 96 if not $uniq{$_}
0 1826 $first ? :
1036 0 0 if (UNIVERSAL::DOES::does($decl, 'Treex::PML::Schema::Decl')) { }
1070 0 0 if (defined $log and UNIVERSAL::isa($log, 'ARRAY'))
1074 0 0 unless (ref $type)
1099 0 0 if (defined $log and UNIVERSAL::isa($log, 'ARRAY'))
1102 0 0 unless (ref $type)
1104 0 0 unless $named_type
1108 0 0 unless (defined $path and length $path)
1112 0 0 unless $type
1154 0 0 unless (defined $types)
1170 0 0 if $seen->{$type}
1172 0 0 if $no_children and $type->get_role eq '#CHILDNODES'
1173 0 0 if ($decl_is == 1 or $decl_is == 2 or $decl_is == 11 or $decl_is == 12 or $decl_is == 13 or not $with_LM and $decl_is == 6 or not $with_AM and $decl_is == 7)
1181 0 0 if $no_nodes and $type->get_role eq '#NODE'
1184 0 0 unless ref $type
1186 0 0 if ($decl_is == 3) { }
0 0 elsif ($decl_is == 4) { }
0 0 elsif ($decl_is == 5) { }
0 0 elsif ($decl_is == 6) { }
0 0 elsif ($decl_is == 7) { }
1190 0 0 $cdecl ? :
1193 0 0 if ($with_Seq_brackets) { }
1205 0 0 if (@members)
1209 0 0 defined $_ && length $_ ? :
1215 0 0 if not $uniq{$_}
1234 0 0 @types ? :
1254 14 8 if defined $_->[1]
1282 986 1215 if ($decl_is == 3 or $decl_is == 4 or $decl_is == 5 or $decl_is == 6 or $decl_is == 7 or $decl_is == 9 or $decl_is == 10 or $decl_is == 8) { }
544 671 elsif ($decl_is == 12) { }
1293 369 617 if ($parent_is == 1) { }
27 590 elsif ($parent_is == 2) { }
450 140 elsif ($parent_is == 11 or $parent_is == 12 or $parent_is == 13) { }
92 48 elsif ($parent_is == 4 and $decl_is != 11) { }
47 1 elsif ($parent_is == 6) { }
1 0 elsif ($parent_is == 7) { }
1308 0 106 if ($decl_is == 6 and not $decl->{'-decl'} and $decl->{'role'} eq '#KNIT')
1313 0 544 if (not $decl->{'-decl'} and $decl->{'role'} eq '#KNIT')
1331 0 0 if (defined $path) { }
0 0 elsif ($decl->{'-parent'} and $decl->{'-name'}) { }
1341 337 370 if (UNIVERSAL::isa($data, 'ARRAY')) { }
370 0 elsif (UNIVERSAL::isa($data, 'HASH')) { }
1342 0 337 unless $hashes_only
1344 0 499 if (ref $val and not exists $seen->{$val})
1351 625 2323 if (ref $val and not exists $seen->{$val})