Branch Coverage

web/cgi-bin/yatt.lib/YATT/Translator/Perl.pm
Criterion Covered Total %
branch 358 494 72.4


line true false branch
63 31 0 ref $widget_path ? :
71 142 19 if (@elpath == 1)
72 0 142 if (ref $elpath[0]) { }
80 0 161 if not defined $elpath[0] or $elpath[0] eq ''
90 161 0 if (wantarray) { }
96 0 141 unless (@result)
100 141 0 wantarray ? :
109 0 156 unless my $widget = $trans->get_widget(@elpath)
113 117 25 if (my $script = $trans->emit)
114 0 117 if $$trans{'cf_debug_translator'}
127 0 141 unless wantarray
137 344 92 wantarray ? :
145 577 16 unless wantarray
159 0 0 if (my $widget = $gen->get_widget(@$elempath)) { }
0 0 elsif (my $ns = $gen->get_ns($elempath)) { }
185 0 246 if (ref $id_or_obj) { }
191 3 243 if (my $baseid = $$tmpl{'cf_base_template'})
194 141 105 unless ($$gen{'target_cache'}{$tmplid}++)
200 0 232 if (my(@delayed) = keys %{$$gen{'delayed_target'};})
202 0 0 if $$gen{'target_cache'}{$nsid}
211 146 0 if ref $tmplid
212 0 146 delete $$gen{'target_cache'}{$tmplid} ? :
219 0 141 if $$gen{'cf_debug_translator'}
223 141 0 if (not defined $_) { }
226 0 0 ref $_ ? :
230 1 140 if ($$gen{'cf_pagevars'}) { }
250 356 50 if $$gen{'cf_no_lineinfo'}
269 3 203 unless @body
300 161 42 if ($$widget{'arg_order'} and @{$$widget{'arg_order'};})
313 850 0 if (my $sub = $gen->can('trans_' . (my $t = $cursor->node_type_name))) { }
329 0 460 unless @_
332 326 134 if ($last =~ s/(\n+)$//) { }
345 0 35 if (ref $trans) { }
364 44 546 unless ($i =~ /\S/)
365 44 0 if push @result, $i
368 306 240 if ($line eq '') { }
370 86 220 if ($i =~ s/^(\s+)//)
373 306 0 if ($i ne '')
380 246 300 if ($i =~ /\n/)
386 60 219 if $line ne ''
393 546 143 if ($str =~ /\S/) { }
403 279 127 if ($$me{'printable'}) { }
404 20 259 if $$me{'last_ws'}
405 279 0 if @{$$me{'queue'};}
406 20 259 if $$me{'last_ws'}
408 87 40 if $$me{'queue'}
420 150 689 if (ref $trans) { }
428 256 0 wantarray ? :
444 233 294 if ($node->node_is_beginning) { }
211 83 elsif ($node->node_is_end) { }
445 210 23 if $body =~ s/^($CRLF+)//
447 35 176 if (not $node->has_parent and $node->metainfo->caller_widget->no_last_newline) { }
451 31 145 if $body =~ s/($CRLF)($CRLF+)$/$1/s
455 146 381 if ($body eq '') { }
129 252 elsif ($body =~ /^$CRLF$/) { }
469 0 17 if ($node->node_nsname ne 'perl')
474 3 14 if (not $body =~ s/^(=+)//) { }
6 8 elsif (length $1 >= 3) { }
486 22 31 ref $_ ? :
503 9 2 if ($node->is_empty_element) { }
513 2 22 unless $item->is_primary_attribute
515 0 22 if (my $var = $trans->has_pass_through_var($scope, $item, $name))
526 12 15 if ($type == 0) { }
15 0 elsif ($type == 4) { }
540 11 0 if $tagc ne ''
542 2 2 if ($item->node_type == 0) { }
549 2 9 if $end
550 11 0 if $string ne ''
562 23 114 if (my $macro = $trans->has_element_macro($tmpl, $node, $node->node_path))
568 5 109 if (my(@arm) = $trans->collect_arms($node, 'else', \%control))
590 2 3 if ($cond) { }
607 0 119 unless (my(@elempath) = $node->node_path)
612 30 89 if (my $codevar = $trans->find_codearg($scope, @elempath))
620 2 87 unless ($widget)
628 68 19 unless $$callee{'argmacro_dict'}
631 8 11 unless my(@order) = grep({not $suppress{$_->call_spec};} @{$$callee{'argmacro_order'};})
645 11 76 if (my($dict, $order) = $trans->has_unique_argmacro($widget, $node->metainfo->caller_widget))
657 124 3 defined $_ ? :
666 5 1 unless $parent->is_bare_attribute and $parent->node_size == 1
668 0 1 unless @expr and ref $expr[0] eq 'SCALAR'
674 15 118 if $args->node_size >= 2
675 20 98 if ($args->node_size == 1 and ($args->node_flag || 0) == 0) { }
43 55 elsif ($args->node_size == 0) { }
689 75 102 unless ($args->is_attribute)
695 2 100 unless (defined $name)
696 0 2 unless $name = $$arg_order[$nth++]
700 0 102 unless ($argdecl)
707 38 64 if (my $var = $trans->has_pass_through_var($scope, $args, $name)) { }
60 4 elsif (defined $args->node_body) { }
3 1 elsif ($argdecl->isa($trans->t_scalar)) { }
709 2 36 $argdecl->early_escaped ? :
719 35 81 if ($body->array_size and my $bodydecl = $$arg_dict{'body'})
728 133 79 if defined $actual[$i]
730 17 62 if ($$delegate_vars{$name}) { }
1 61 elsif ($$arg_dict{$name}->is_required) { }
740 80 33 if ($args->parent->is_empty_element) { }
743 3 77 if $diff
756 109 5 unless $cond
759 5 4 if ($args->is_attribute and $args->node_name eq $key) { }
773 0 119 if (@cond >= 2)
780 7 112 if defined $cond[0]
790 0 137 if (@elempath > 2)
798 114 137 if $shift
800 23 228 if (my $sub = $pkg->can($macro_name) || $trans->can($macro_name))
815 2 5 $subtype ? :
818 0 7 unless ($base)
822 0 7 if ($$tmpl{'cf_nsid'} != $base->template_nsid)
826 1 6 if ($$base{'arg_dict'}{$argname})
839 0 6 if ($widget->has_virtual_var($argname))
851 154 19 unless ($target->has_arg('body'))
862 10 6 unless ($has_body)
869 0 6 if ($type eq 'var') { }
6 0 elsif ($type eq 'call') { }
870 0 0 if (@args) { }
880 0 6 if ($type ne 'text') { }
0 6 elsif ($rename_spec) { }
904 35 16 if ($is_sysns and @$entns == 1)
905 35 0 if ($widget->can_configure($$entns[0]))
917 0 16 unless my $sub = $pkg->can($macro_name)
921 0 16 unless ($macro_class->can('handle'))
946 0 987 unless defined $varName
947 275 712 if (defined(my $value = $$scope[0]{$varName}))
956 0 145 if @elempath >= 3
958 0 145 unless @elempath == 1
959 105 40 unless my $var = $trans->find_var($scope, $elempath[0])
961 2 38 unless ref $var and $var->can('arg_specs')
968 161 42 $$widget{'arg_order'} ? :
985 0 0 $targetNode ? :
989 0 0 if (my $var = $gen->has_pass_through_var($scope, $node, $name)) { }
998 0 0 if (node_size($rawNode) == 1 and node_flag($rawNode) == 0 and (my $nm = node_body($rawNode)) =~ /^\w+$/) { }
0 0 elsif (node_size($rawNode) == 0) { }
1003 0 0 if (my $var = $trans->find_var($scope, $nm)) { }
1012 0 0 if (my $var = $trans->find_var($scope, my $nm = node_name($rawNode))) { }
0 0 elsif (defined $defaultFlag) { }
1028 109 40 if ($node->node_type == 0) { }
0 40 elsif ($node->node_type == 6) { }
1042 0 283 unless @$array >= 1
1043 193 90 unless $$array[0][0] eq $name
1045 90 0 wantarray ? :
1053 2 48 is_nested_entpath($item) ? :
1064 16 74 if (my($name, @args) = $trans->feed_array_if('call', \@_)) { }
35 39 elsif (($name) = $trans->feed_array_if('var', \@_)) { }
11 28 elsif (($name) = $trans->feed_array_if('expr', \@_)) { }
2 26 elsif (my(@items) = $trans->feed_array_if('array', \@_)) { }
0 26 elsif (my(@pairs) = $trans->feed_array_if('hash', \@_)) { }
26 0 elsif (($name) = $trans->feed_array_if('text', \@_)) { }
1070 8 8 if ($pkg->can(my $en = "entity_$name")) { }
1 7 elsif ($var = $trans->find_codearg($scope, $name)) { }
1 6 elsif ($var = $trans->find_var($scope, $name)) { }
6 0 elsif (my $handler = $trans->can("entmacro_$name")) { }
1075 1 0 if (my $handler = $var->can('entmacro_')) { }
1095 7 9 $dont_call || ref $call ? :
1098 0 35 if (not $var = $trans->find_var($scope, $name)) { }
1121 20 13 if ($type eq 'call') { }
2 11 elsif ($type eq 'var') { }
11 0 elsif ($type eq 'aref') { }
1124 19 1 if ($var and not ref $name and my $handler = $var->can("entmacro_$name")) { }
1133 2 0 ref $name ? :
1138 11 0 ref $name ? :
1147 9 81 @expr > 1 ? :
1153 1 155 unless $trans->strip_ns(\@entns)
1154 131 24 if @entns
1155 6 18 unless @$entpath == 1
1156 0 18 unless $$entpath[0][0] eq 'call'
1158 11 7 unless my $codearg = $trans->find_codearg($scope, $name)
1166 213 16 unless ($has_entns)
1170 7 222 if defined $body and not defined $node->node_name
1175 53 174 $body ? :
1177 16 211 $has_entns ? :
1186 7 204 if ($escaped == 2 and my($codearg, @args) = $trans->find_if_codearg($scope, $node, \@entpath))
1195 40 164 if ($has_body or @$entns > 1)
1200 2 38 if ref $expr
1201 30 8 $escaped ? :
1205 7 157 if (not my $vardecl = $trans->find_var($scope, $varName)) { }
1208 125 32 $escaped ? :
1219 0 0 if (ref $type)
1222 0 0 unless (defined $targetNode and node_body($targetNode))
1236 0 2 $targetNode ? :
1238 0 2 unless my $sub = $trans->can("t_$type")
1246 0 0 unless (defined $targetNode and node_body($targetNode))
1251 0 0 defined $ent_flag ? :
1260 379 12 unless defined $$var{'cf_default'} and defined(my $mode = $$var{'cf_default_mode'})
1263 2 10 if ($mode eq '!')
1269 2 8 if ($mode eq '|') { }
6 2 elsif ($mode eq '?') { }
2 0 elsif ($mode eq '/') { }
1280 2 8 ref $_ ? :
1293 10 57 $is_opened ? :
1299 3 59 if defined $$var{'cf_default_mode'}
1324 0 0 if (my $mode = $$var{'cf_default_mode'})
1326 0 0 if (defined(my $default = $$var{'cf_default'}))
1327 0 0 ref $_ ? :
0 0 ref $_ ? :
1361 7 46 if (ref $_) { }
1369 39 6 if (@items == 1 and not $nvars) { }
1387 2 4 $is_opened ? :
1388 1 5 if (my $expr = $trans->has_single_bare_varexpr($scope, $n)) { }
1404 0 1 if (@$restExpr)
1407 0 1 if (ref $$var{'cf_subtype'})
1418 0 4 if (ref $$var{'cf_subtype'})
1429 8 13 ref $_ ? :
1434 3 22 ref $_ ? :
1484 30 9 unless $$argdecl{'arg_order'} and my(@args) = @{$$argdecl{'arg_order'};}
1492 0 40 unless $node->array_size
1493 1 39 if ($is_expr) { }
1505 34 6 $is_opened ? :
1534 18 154 if $node
1546 5 0 if ($body_spec->type_name eq 'code') { }
1555 18 0 defined $_ ? :
1579 8 101 if ($args->is_attribute and $args->is_quoted_by_element)
1583 0 109 @path >= 2 ? :
1591 14 17 unless $args->is_primary_attribute
1593 4 13 unless (defined $name)
1594 0 4 unless $name = $$arg_order[$nth++]
1597 0 17 unless defined(my $argno = $$arg_dict{$name})
1615 0 6 unless $trans->feed_arg_spec($args, \%arg_dict, \@arg_order, my($list, $my, $ith))
1619 0 6 unless (defined $list)
1626 5 1 if ($my) { }
1647 3 3 if (my $var = $trans->has_pass_through_var($scope, my $fc = $trans->fake_cursor_from($args, $list), 'list')) { }
1649 1 2 unless ($var->type_name eq 'list')
1661 0 5 if ($fragment) { }
1676 5 3 if ($primary) { }
1678 5 0 if ($if) { }
0 0 elsif ($unless) { }
1687 1 2 if ($if) { }
0 2 elsif ($unless) { }
1691 2 1 if (not defined $cond) { }
1697 1 0 $true ? :
1711 0 5 unless $trans->feed_arg_spec($args, \%arg_dict, \@arg_order, my($if, $unless))
1717 3 9 if ($args->is_attribute and $args->node_name eq 'else') { }
1752 1 7 unless $args->is_primary_attribute
1754 1 5 $args->next_is_body ? :
1755 0 7 if (my $old = $$scope[0]{$name})
1767 5 2 $args->node_size ? :
1772 1 5 if ($args->readable)
1781 6 1 if defined $value
1793 0 3 unless ($args->readable and $args->is_primary_attribute)
1800 1 2 if (my $var = $trans->has_pass_through_var($scope, $args, $name)) { }
1825 0 0 unless $args->is_primary_attribute
1827 0 0 unless (defined $name)
1828 0 0 unless $name = $$arg_order[$nth++]
1831 0 0 if ($name =~ /^-(.*)/)
1837 0 0 unless (defined(my $argno = $$arg_dict{$name}))
1845 0 0 @$_ ? :
1856 0 12 ref $_ ? :
1871 0 352 unless (defined $_[0])
1897 0 31 unless defined $_[0]