Branch Coverage

blib/lib/Treex/PML/Instance/Writer.pm
Criterion Covered Total %
branch 151 276 54.7


line true false branch
68 5 15 if ($cached and $handler_cache[-1][1] ne $subkey)
80 0 15 if (@handler_cache > $MAX_SCHEMA_CACHE_SIZE)
93 539 3 if ($INDENT >= 0) { }
100 118 1 if ($INDENT > 0) { }
108 118 1 if ($INDENT > 0) { }
120 0 21 if exists $opts->{'validate_cdata'}
122 0 21 if $opts->{'filename'}
125 0 21 if $href eq "-" and not $fh
127 0 21 if ($config and ref(my $load_opts = $config->get_data("options/save")))
131 0 21 if $opts->{'keep_knit'}
132 0 21 if $opts->{'write_single_LM'}
133 0 21 if $opts->{'write_single_children_LM'}
134 0 21 if defined $opts->{'indent'}
135 1 20 unless ($fh)
136 1 0 if (defined $href and length $href) { }
138 1 0 unless $href =~ /^ntred:/
145 1 0 if ($fh)
152 0 1 unless ($ok)
155 0 0 unless $href =~ /^ntred:/
157 0 0 if $err
165 20 0 if $fh
170 0 10 if ($config and defined $transform_id and length $transform_id)
172 0 0 if ($transform) { }
174 0 0 if ($out_xsl->{'type'} ne "xslt")
179 0 0 unless (defined $out_xsl_href and length $out_xsl_href)
183 0 0 unless open my $pml_fh, ">", \$xsl_source
194 0 12 unless ($_->{'readas'} || '') eq "dom"
195 0 20 if (ref $refs_to_save) { }
198 0 0 unless (defined $$refs_to_save{$_->{'id'}})
211 12 0 if ($ref->{'readas'} eq "dom")
224 20 0 if $fh
225 0 20 $ctxt->{'_no_read_trees'} ? :
227 0 20 if $opts->{'dump_handlers'} or $ENV{'PML_COMPILE_DUMP'}
231 10 10 if ($ctxt->{'_pi'})
243 0 20 if defined $orig_fh
244 0 20 if $@
246 0 20 if ($xsl_source and $out_xsl_href)
247 0 0 if XSLT_BUG()
251 0 0 if $params
256 0 0 if (UNIVERSAL::can($result, 'toFH')) { }
265 13 7 if (ref $ctxt->{'_ref'})
267 12 0 if ($ref->{'readas'} eq 'dom') { }
0 0 elsif ($ref->{'readas'} eq 'pml') { }
270 0 12 if (defined $$refs_to_save{$ref->{'id'}}) { }
275 12 0 if (ref $dom)
277 12 0 unless $href =~ /^ntred:/
282 12 0 if ($ref_fh)
289 0 12 unless ($ok)
292 0 0 unless $href =~ /^ntred:/
294 0 0 if $err
300 0 0 if ($pml)
302 0 0 if (exists $refs_to_save->{$ref_id}) { }
309 0 0 $k =~ s[^\Q$ref_id\E/][] ? :
327 5 15 if ($cached) { }
331 15 0 if $CACHE_HANDLERS
337 0 0 unless -d $dir or mkdir $dir
341 0 0 unless open my $fh, ">:utf8", $dump_file
353 1 35 if $decl->is_mixed
369 6 3 if $path
388 1 0 if $path
398 7 0 if $path
401 0 7 if defined $tag
410 0 7 if defined $tag
421 5 0 if $path
424 3 2 if (defined $tag)
425 3 0 unless ($WRITE_SINGLE_LM or $WRITE_SINGLE_CHILDREN_LM)
439 3 2 if (defined $tag)
442 3 0 unless $WRITE_SINGLE_LM or $WRITE_SINGLE_CHILDREN_LM
454 14 0 if ($idM) { }
534 215 251 if $path
535 100 238 if $decl_type == 11 or $decl_type == 12 or $decl_type == 1 or $decl_type == 13
539 15 223 if ($decl_type == 2) { }
38 185 elsif ($decl_type == 3) { }
18 167 elsif ($decl_type == 4) { }
18 149 elsif ($decl_type == 5) { }
29 120 elsif ($decl_type == 6) { }
5 115 elsif ($decl_type == 7) { }
101 14 elsif ($decl_type == 8) { }
14 0 elsif ($decl_type == 9) { }
0 0 elsif ($decl_type == 10) { }
553 5 10 if ($cdecl_type == 10 or $cdecl_type == 3)
556 0 0 if ($attr->is_required) { }
578 1 14 $no_end_indent ? :
633 15 0 $INDENT > 0 ? :
637 0 15 if $@
656 22 2 if ($attr->is_required) { }
677 24 91 if $m->is_attribute
685 3 88 if ($WITH_TREES and $decl->get_role eq '#NODE' and $m->get_role eq '#CHILDNODES') { }
1 87 elsif ($WITH_TREES and $m->get_role eq '#TREES' || $mdecl->get_role eq '#TREES') { }
690 0 3 if ($mdecl_type == 5) { }
3 0 elsif ($mdecl_type == 6) { }
704 1 0 if ($m->is_required)
712 0 1 if ($mdecl_type == 5) { }
1 0 elsif ($mdecl_type == 6) { }
722 0 91 if ($mdecl_type == 10 and not $m->is_required) { }
0 91 elsif ($m->get_role eq '#KNIT') { }
7 84 elsif ($mdecl_type == 6 and $mdecl->get_role eq '#KNIT') { }
738 0 0 unless ($name eq $knit_name)
745 0 0 if ($KEEP_KNIT) { }
753 0 0 if ($m->is_required)
762 0 0 if $close_brace
769 7 0 if ($name ne $knit_name)
777 0 7 if ($m->is_required) { }
788 0 7 if ($KEEP_KNIT) { }
789 0 0 unless ($WRITE_SINGLE_LM)
799 0 0 unless $WRITE_SINGLE_LM
802 7 0 unless ($WRITE_SINGLE_LM)
817 7 0 unless $WRITE_SINGLE_LM
823 7 0 if ($name ne $knit_name)
827 0 7 if $close_brace
840 25 59 if ($m->is_required and not $ignore_required)
848 4 87 if $close_brace
858 0 38 if $@
873 12 6 if (@attributes) { }
879 8 5 if ($attr->is_required) { }
903 18 0 if ($cdecl) { }
908 9 9 if ($WITH_TREES and $decl->get_role eq "#NODE" and $cdecl->get_role eq "#CHILDNODES")
922 7 2 if ($cdecl_type == 5) { }
2 0 elsif ($cdecl_type == 6) { }
939 0 18 $WRITE_SINGLE_LM ? :
949 9 9 if $close_brace
962 0 18 if $@
968 1 17 if $decl->is_mixed
974 9 9 if ($WITH_TREES and $decl->get_role eq '#TREES') { }
998 0 18 if $@
999 1 17 if $decl->is_mixed
1012 0 29 if ($WITH_TREES and $decl->get_role eq '#TREES') { }
1028 29 0 unless ($WRITE_SINGLE_LM)
1048 0 29 if $@
1086 0 5 if $@
1102 0 101 if $@
1105 0 14 unless ($value_hash)
1124 0 14 if $@
1141 0 0 if $@
1149 159 307 if ($decl_type == 11 or $decl_type == 12 or $decl_type == 13)
1155 159 0 if $path
1157 47 112 if (not exists $handlers{$path})
1160 47 0 if $mpath