Condition Coverage

lib/PHP/Decode/Transformer.pm
Criterion Covered Total %
condition 552 842 65.5


and 2 conditions

line l !l condition
564 0 784 exists $ctx->{'varmap'}{'stdout'} and scalar @{$ctx->{'varmap'}{'stdout'}{'buf'};}

and 3 conditions

line !l l&&!r l&&r condition
92 1524 0 0 exists $self->{'with'}{'getenv'} and $self->{'toplevel'}
237 0 0 0 exists $ctx->{'with'}{'getenv'} and scalar @$args == 1
275 0 0 1 exists $ctx->{'globals'} and exists $ctx->{'globals'}{'stdout'}
0 0 1 exists $ctx->{'globals'} and exists $ctx->{'globals'}{'stdout'} and defined $name
299 0 0 0 exists $ctx->{'globals'} and exists $ctx->{'globals'}{'stdout'}
315 0 0 1 exists $ctx->{'globals'} and exists $ctx->{'globals'}{'stdout'}
326 0 0 1 is_strval($s) and $handler ne "#null"
357 0 0 0 exists $ctx->{'globals'} and exists $ctx->{'globals'}{'stdout'}
378 1262 264 10 $k =~ /^#stmt\d+$/ and $parser->{'strmap'}{$k}[0] eq "namespace"
418 951 129 10 $k =~ /^#stmt\d+$/ and $parser->{'strmap'}{$k}[0] eq "namespace"
511 62 0 722 $ctx->{'toplevel'} and exists $ctx->{'varmap'}{'stdout'}
527 62 0 722 $ctx->{'toplevel'} and exists $ctx->{'varmap'}{'stdout'}
672 5 2 99 is_strval($s) and not is_const($s)
675 2 1 26 is_strval($seq->[$i]) and not is_const($seq->[$i])
911 0 0 0 scalar @list == 1 and $list[0] eq 1
986 1 1 5 is_symbol($name) and lc $name ne "eval"
2 0 5 is_symbol($name) and lc $name ne "eval" and scalar @$arglist == scalar @$a
1014 54 0 0 $op eq "=" and defined $v2
1027 28 841 7 not is_variable($rhs) || is_flat_elem($rhs, $parser) and $ctx->unresolvable_var($info)
1042 2 0 15 defined $val and $val eq "#unresolved"
1069 50 0 1070 $op eq "=" and defined $v2
1084 0 0 50 defined $val and is_array($val)
1130 38 65 53 is_variable($v) and $v eq $vp
1187 0 0 10 $all_str and $prev_all_str
1217 0 0 0 is_variable($k) and not $ctx->is_superglobal($k)
1222 0 0 0 is_variable($k) and not $ctx->is_superglobal($k)
1235 0 0 6 is_variable($k) and not $ctx->is_superglobal($k)
1249 0 5 82 is_variable($k) and not $ctx->is_superglobal($k)
1263 0 0 15 is_variable($k) and not $ctx->is_superglobal($k)
1277 0 31 114 is_variable($k) and not $ctx->is_superglobal($k)
1352 873 2 178 is_variable($k) and not $ctx2->is_superglobal($k)
1360 1177 2 294 is_variable($k) and not $ctx2->is_superglobal($k)
1419 369 782 9 not $ctx->{'infunction'} and $ctx->{'class_scope'}
1432 1071 35 0 defined $inst and exists $ctx->{'varmap'}{'inst'}{$inst}
1447 0 1 3 $ctx->{'infunction'} and $ctx->{'incall'}
1519 24 112 60 exists $ctx->{'varmap'}{'inst'}{$inst} and exists $ctx->{'varmap'}{'inst'}{$inst}{$prop}
1592 1601 69 0 defined $inst and exists $ctx->{'varmap'}{'inst'}{$inst}
1620 0 4 9 $ctx->{'infunction'} and $ctx->{'incall'}
1629 5 0 0 exists $ctx->{'class_scope'} and $ctx->{'varmap'}{'inst'}{$ctx->{'class_scope'}}{$instvar}
1687 7 7 97 $op eq "=" and is_variable($v1)
7 4 3 $op eq "=" and $v1 =~ /^#elem\d+$/
1693 72 12 6 defined $inst and $inst eq "GLOBALS"
0 84 0 $ctx->{'infunction'} and exists $ctx->{'varmap'}{'static'}{$ctx->{'infunction'}}{$v1}
69 0 12 defined $inst and exists $ctx->{'class_scope'}
0 0 12 defined $inst and exists $ctx->{'class_scope'} and lc $inst eq $ctx->{'class_scope'}
1715 3 0 50 is_array($v2) and PHP::Decode::Op::array_is_const($parser, $v2)
1786 19 16 9 defined $inst and $inst eq "GLOBALS"
0 35 0 $ctx->{'infunction'} and exists $ctx->{'varmap'}{'static'}{$ctx->{'infunction'}}{$s}
16 0 16 defined $inst and exists $ctx->{'class_scope'}
0 0 16 defined $inst and exists $ctx->{'class_scope'} and lc $inst eq $ctx->{'class_scope'}
1850 28 7 67 defined $var and $k =~ /^#expr\d+$/
1852 0 65 2 $op eq "=" and $var eq $v1
1911 6 10 0 defined $inst and $inst ne "GLOBALS"
1948 0 0 0 defined $inst and $inst eq "GLOBALS"
0 0 0 $ctx->{'infunction'} and exists $ctx->{'varmap'}{'static'}{$ctx->{'infunction'}}{$s}
0 0 0 defined $inst and exists $ctx->{'class_scope'}
0 0 0 defined $inst and exists $ctx->{'class_scope'} and lc $inst eq $ctx->{'class_scope'}
2046 1 0 13 $allow and defined $v2
2059 0 0 6 $allow and defined $i
2099 2 10 0 defined $inst and $inst ne "GLOBALS"
2 0 10 defined $inst and not $inst =~ /^#inst\d+$/
2251 126 2 0 $val =~ /^#expr\d+$/ and scalar keys %{$$info{"assigns"};} > 0
126 1 1 $val =~ /^#expr\d+$/ and $parser->{'strmap'}{$val}[0] eq "\$"
2360 11 17 174 scalar keys %{$$resinfo{"remaining_locals"};} == 0 and scalar keys %{$$resinfo{"remaining_statics"};} == 0
2391 0 0 0 $ctx->{'infunction'} and not $ctx->{'incall'}
2404 2 0 2 $ctx->{'infunction'} and not $ctx->{'incall'}
2527 13 0 42 $op eq "\$" and not defined $v1
13 0 42 $op eq "\$" and not defined $v1 and defined $v2
2555 13 2 50 defined $basevar and not $has_index
2573 2 23 40 defined $basestr and $basestr =~ /^#inst\d+$/
2582 39 0 1 is_strval($sym) and not is_null($sym)
2610 1 0 0 is_strval($s) and not is_null($s)
2641 0 0 22 defined $basevar and is_variable($basevar)
2650 24 0 0 is_strval($sym) and not is_null($sym)
2678 4 0 0 is_strval($s) and not is_null($s)
2706 24 0 140 defined $i and not $v =~ /^#elem\d+$/
2713 0 2 0 $val ne $v and not is_variable($val)
2724 2 73 65 defined $val and is_variable($val)
2778 29 54 40 defined $val and is_strval($val)
83 2 38 defined $val and is_strval($val) and $parser->get_strval_or_str($val) eq ""
2787 67 56 0 defined $val and is_null($val)
2895 0 0 0 defined $scope and is_variable($val)
2947 13 0 27 $val ne $var and not $val =~ /^#expr\d+$/
2964 473 126 27 $i < scalar @$param and $$param[$i++] =~ /^#ref\d+$/
2987 0 2 2 $i < scalar @$param and $$param[$i++] =~ /^#ref\d+$/
3041 6864 89 1096 is_strval($var) and not is_const($var)
3059 291 1031 266 defined $val and $val eq "#unresolved"
3100 0 74 0 exists $ctx->{'globals'} and exists $ctx->{'globals'}{$v}
3200 4 10 191 is_int_index($k) || is_strval($k) and !defined($val) || defined $val && is_strval($val)
3240 1 1 11 defined $basestr and $basestr ne "#unresolved"
3259 8 3 2 defined $basestr and $basestr ne "#unresolved"
3274 0 0 0 $ctx->{'incall'} and $c =~ /^(self|parent)$/
3296 0 0 4 defined $sym and exists $ctx->{'defines'}{$sym}
3336 14 40 9 defined $basestr and $basestr eq "#unresolved"
3362 20 273 7 defined $basestr and $basestr eq "#unresolved"
20 242 31 defined $basestr and is_strval($basestr)
262 0 31 defined $basestr and is_strval($basestr) and not is_null($basestr)
242 0 31 defined $basestr and is_strval($basestr) and not is_null($basestr) and defined $idxstr
0 0 31 defined $basestr and is_strval($basestr) and not is_null($basestr) and defined $idxstr and is_strval($idxstr)
20 73 169 defined $basestr and is_array($basestr)
93 0 169 defined $basestr and is_array($basestr) and defined $idxstr
73 20 0 not exists $ctx->{'skip'}{'null'} || defined $basestr and !$ctx->is_superglobal($basevar) || $basevar =~ /^\$GLOBALS$/
3421 588 0 1030 $op eq "=" and defined $v2
3434 0 0 9 defined $scope and is_variable($val)
3444 0 3 10 defined $basevar and $basevar ne $v1
3459 0 859 6 defined $op2 and $op2 =~ /^#ref\d+$/
0 856 3 defined $v2 and $v2 =~ /^\$GLOBALS$/
0 851 5 defined $v2 and $ctx->is_superglobal($v2)
3487 4 0 1 defined $a and is_array($a)
3561 0 138 10 defined $basestr and is_null($basestr)
3564 10 138 0 defined $basestr and $basestr eq "#unresolved"
3574 0 120 3 defined $basestr and is_strval($basestr)
120 0 3 defined $basestr and is_strval($basestr) and not is_null($basestr)
120 0 3 defined $basestr and is_strval($basestr) and not is_null($basestr) and defined $idxstr
3646 24 52 19 defined $idxstr and $i ne $idxstr
3768 447 0 141 not defined $v1 and defined $v2
447 102 39 not defined $v1 and defined $v2 and $op eq "new"
447 0 102 not defined $v1 and defined $v2
0 113 334 defined $v1 and is_strval($op1)
113 285 49 defined $v1 and is_strval($op1) and not defined $v2
0 14 384 defined $v1 and defined $v2
3781 4 1 34 defined $class and exists $ctx->{'varmap'}{'inst'}{$name}
3810 0 0 26 defined $f and is_symbol($f)
3856 34 1 19 $op eq '--' || $op eq '++' and is_variable($v2)
3862 1 0 5 is_variable($op2) and $v2 ne $op2
3927 0 22 27 defined $res and not $res =~ /^#expr\d+$/
3942 42 342 0 not $in_block and $op eq '||' || $op eq 'or' || $op eq '&&' || $op eq 'and' || $op eq '?' || $op eq ':'
3949 95 35 254 is_strval($op1) || is_array($op1) and is_strval($op2) || is_array($op2)
115 0 0 $op eq "===" and $op1 eq "#null"
115 0 0 $op eq "===" and $op2 eq "#null"
109 6 0 $op eq "==" and $op1 eq "#null"
109 5 1 $op eq "==" and $op2 eq "#null"
3950 0 12 242 $op ne "?" and $op ne ":"
3960 8 0 7 is_strval($op1) || is_array($op1) and $op2 =~ /^#expr\d+$/
8 0 7 is_strval($op1) || is_array($op1) and $op2 =~ /^#expr\d+$/ and $parser->{'strmap'}{$op2}[0] eq ":"
4094 472 0 56 lc $cmd eq "eval" and scalar @$arglist == 1
468 0 4 $cmd eq "assert" and scalar @$arglist == 1
4109 0 0 0 scalar @$args == 1 and is_strval($args->[0])
4160 49 1 6 $cmd =~ /^#fun\d+$/ and is_variable($name)
4176 24 2 173 defined $code and not $in_block
4189 4 0 0 is_strval($key) || is_array($key) || _anon_func_call($parser, $key) and defined $code
4 0 0 is_strval($key) || is_array($key) || _anon_func_call($parser, $key) and defined $code and $parser->is_empty_block($code)
4288 45 0 0 not $resolved_eval and scalar @seq == 1
4332 227 217 24 defined $f and exists $f->{'param'}
4385 2 118 2018 $type ne "brace" and $type ne "expr"
4400 2 118 2018 $type ne "brace" and $type ne "expr"
4430 725 564 10 scalar @args == 1 and is_strval($args[0]) || $args[0] =~ /^#fun\d+$/
4463 188 1 4 is_const($arglist->[$_]) && !$parser->is_magic_const($arglist->[$_]) && !exists($ctx->{'defines'}{$parser->{'strmap'}{$arglist->[$_]}})
4470 31 149 4 $all_str and scalar @param > 1
4477 0 2 117 exists $ctx->{'globals'} and exists $ctx->{'globals'}{'stdout'}
4501 0 0 0 exists $ctx->{'globals'} and exists $ctx->{'globals'}{'stdout'}
4620 0 147 107 defined $res and $arg ne $res
4651 0 1 2 defined $basestr and is_array($basestr)
1 0 2 defined $basestr and is_array($basestr) and defined $idxstr
4739 0 149 1 defined $cond and is_strval($cond) || is_array($cond)
4800 26 4 4 defined $else and $else ne $else1
4804 34 36 2 $then ne $then1 and not is_block($then1)
4807 62 1 9 defined $else and $else ne $else1
63 9 0 defined $else and $else ne $else1 and not is_block($else1)
4842 8 9 1 $i == 0 and is_strval($cond) || is_array($cond)
4891 9 2 0 defined $f and !defined($r) || $f ne $r
4914 8 0 0 loop_level($parser) > 1 and loop_val($parser, $i) >= 2 * $ctx->{'max_loop'}
4918 8 0 0 $i >= $ctx->{'max_loop_const'} and is_strval($expr)
5030 4 0 0 defined $f and !defined($r) || $f ne $r
5053 4 0 0 loop_level($parser) > 1 and loop_val($parser, $i) >= 2 * $ctx->{'max_loop'}
5057 4 0 0 $i >= $ctx->{'max_loop_const'} and is_strval($expr)
5176 30 0 0 defined $f and !defined($r) || $f ne $r
5204 30 0 0 loop_level($parser) > 1 and loop_val($parser, $i) >= 2 * $ctx->{'max_loop'}
5307 11 0 0 scalar @$keys == 0 and not $ctx->{'tainted'}
5312 6 0 17 defined $key and defined $keyvar
6 0 17 defined $key and defined $keyvar and is_variable($keyvar)
5320 0 0 23 defined $valvar and is_variable($valvar)
5333 21 1 0 defined $f and !defined($r) || $f ne $r
5353 4 0 17 defined $key and defined $keyvar
4 8 9 defined $key and defined $keyvar and $keyvar ne $key
5357 0 10 11 defined $valvar and $valvar ne $value
5413 0 2 0 defined $valvar and $value ne $valvar
1 0 1 defined $key and defined $keyvar
1 1 0 defined $key and defined $keyvar and $key ne $keyvar
5444 0 2 3 defined $result and $result
5467 0 0 3 defined $found and $found >= 0
5534 0 6 2 defined $c0 and $c0 ne $c
5580 0 0 2 $op eq "=" and is_variable($v1)
5612 25 129 18 defined $f and not $ctx->getfun($f)
5666 0 41 2 defined $c and not $ctx->getclass($c)

or 3 conditions

line l !l&&r !l&&!r condition
812 0 0 0 is_strval($p) or is_array($p)
862 0 0 50 scalar @$arglist > 1 or not is_strval($arglist->[0])
1027 17 11 848 is_variable($rhs) || is_flat_elem($rhs, $parser)
1056 29 1 20 $op eq '++' || $op eq '--'
1114 0 0 10 is_strval($prev) or is_array($prev)
1124 117 39 1 is_strval($lhsp) or is_array($lhsp)
1236 4 1 1 not exists $ctx->{'globals'}{$k} or $ctx->{'globals'}{$k} ne "#unresolved"
1250 26 19 37 not exists $ctx->{'varmap'}{$k} or $ctx->{'varmap'}{$k} ne "#unresolved"
1304 1 0 145 exists $info->{'globals'}{$_} || exists $info->{'unresolved'}{$_}
1336 0 0 33 exists $info->{'globals'}{$_} || exists $info->{'unresolved'}{$_}
1353 0 34 144 not exists $ctx->{'globals'}{$k} or $ctx->{'globals'}{$k} ne $ctx2->{'globals'}{$k}
1361 0 37 257 not exists $ctx->{'varmap'}{$k} or $ctx->{'varmap'}{$k} ne $ctx2->{'varmap'}{$k}
1421 9 0 0 not defined $inst or $inst ne "GLOBALS"
1599 8 23 0 $ctx->{'incall'} or not exists $ctx->{'skip'}{'null'}
1643 0 5 0 $ctx->{'incall'} or not exists $ctx->{'skip'}{'null'}
1661 10 228 0 $ctx->{'incall'} or not exists $ctx->{'skip'}{'null'}
2068 4 9 0 defined $inst or is_symbol($name)
13 0 0 defined $inst or is_symbol($name) or is_strval($name)
9 0 0 defined $inst or is_symbol($name) or is_strval($name) or $name =~ /^#fun\d+$/
2176 130 0 73 exists $info->{'returns'} or exists $info->{'calls'}{'eval'}
0 0 73 exists $info->{'returns'} or exists $info->{'calls'}{'eval'} or exists $info->{'calls'}{'create_function'}
2382 10 10 176 defined $u or defined $f
2408 0 0 2 $keep_call or $unresolved_param
2420 7 0 119 $keep_call or $unresolved_param
2448 9 3 54 $keep_call or $unresolved_param
2579 0 1 39 is_block($m) or is_variable($m)
2773 15 14 0 not $ctx->is_superglobal($val) or $superglobals_writable
2790 67 52 4 not defined $val or is_array($val)
2833 18 3 1 not defined $nextval or is_array($nextval)
2851 22 0 0 $elem ne $v or $idx ne $i
2964 255 0 344 not is_strval($p) or is_const($p)
3200 187 14 4 is_int_index($k) || is_strval($k)
0 191 10 !defined($val) || defined $val && is_strval($val)
3216 4 6 4 $k ne $k2 or $val ne $newmap{$k2}
3323 132 31 200 not is_strval($i) or is_const($i)
3362 0 73 20 exists $ctx->{'skip'}{'null'} || defined $basestr
20 0 0 !$ctx->is_superglobal($basevar) || $basevar =~ /^\$GLOBALS$/
3409 15 21 80 $v ne $basevar or $i ne $idxstr
3504 120 0 13 $in_block or not exists $ctx->{'varhist'}
3506 2 23 95 $v1 ne $vv1_sim or $v2 ne $op2
3535 13 205 451 $v1 ne $vv1_sim or $v2 ne $op2
3574 0 118 2 not defined $basestr or is_array($basestr)
3646 23 32 63 $v ne $parent or defined $idxstr and $i ne $idxstr
3649 1 1 40 is_instvar($parent) or is_instvar($basevar)
3653 108 0 10 $in_block or not exists $ctx->{'varhist'}
3654 40 21 47 $v1 ne $op1 or $v2 ne $op2
3664 0 3 7 $v1 ne $op1 or $v2 ne $op2
3671 9 0 1 is_strval($op2) or is_array($op2)
3726 4 0 3 $in_block or not exists $ctx->{'varhist'}
3741 0 2 0 is_variable($vv1) or $vv1 =~ /^#elem\d+$/
3748 2 2 459 $v1 ne $vv1_sim or $v2 ne $op2
3856 8 12 34 $op eq '--' || $op eq '++'
3890 14 7 14 is_strval($op2) or is_array($op2)
3942 15 0 319 $op eq '||' || $op eq 'or' || $op eq '&&' || $op eq 'and' || $op eq '?' || $op eq ':'
3949 285 4 95 is_strval($op1) || is_array($op1)
250 4 35 is_strval($op2) || is_array($op2)
3960 7 0 8 is_strval($op1) || is_array($op1)
4006 29 11 96 $v1 ne $op1 or $v2 ne $op2
4021 18 5 710 is_variable($name) or $name =~ /^#elem\d+$/
23 2 708 is_variable($name) or $name =~ /^#elem\d+$/ or $name =~ /^#expr\d+$/
7 0 708 is_variable($name) or $name =~ /^#elem\d+$/ or $name =~ /^#expr\d+$/ or $name =~ /^#stmt\d+$/
2 1 707 is_variable($name) or $name =~ /^#elem\d+$/ or $name =~ /^#expr\d+$/ or $name =~ /^#stmt\d+$/ or is_block($name)
4179 11 2 13 $name_changed or $arg_changed
4189 0 0 4 is_strval($key) || is_array($key) || _anon_func_call($parser, $key)
4343 0 0 3 $name ne $cmdsim or $arg_changed
4370 10 59 219 $name ne $cmdsim or $arg_changed
4387 780 30 1208 defined $rhs or _is_increment_op($parser, $p)
4430 82 10 482 is_strval($args[0]) || $args[0] =~ /^#fun\d+$/
4448 90 17 86 not is_strval($p) or is_const($p)
4739 47 1 102 is_strval($cond) || is_array($cond)
4800 44 24 34 $cond ne $expr or $then ne $then1
68 15 19 $cond ne $expr or $then ne $then1 or defined $else and $else ne $else1
4842 5 1 4 is_strval($cond) || is_array($cond)
4857 12 2 4 is_strval($cond) or is_array($cond)
4891 2 0 0 !defined($r) || $f ne $r
0 0 11 defined $u or defined $f and !defined($r) || $f ne $r
4972 0 0 6 $expr ne $expr0 or $block ne $block0
5001 10 0 1 is_strval($cond) or is_array($cond)
5030 0 0 0 !defined($r) || $f ne $r
0 0 4 defined $u or defined $f and !defined($r) || $f ne $r
5110 0 0 1 $expr ne $expr0 or $block ne $block0
5144 48 0 5 is_strval($cond) or is_array($cond)
5176 0 0 0 !defined($r) || $f ne $r
3 0 30 defined $u or defined $f and !defined($r) || $f ne $r
5268 0 0 8 $pre ne $pre0 or $expr ne $expr0
0 0 8 $pre ne $pre0 or $expr ne $expr0 or $post ne $post0
0 1 7 $pre ne $pre0 or $expr ne $expr0 or $post ne $post0 or $block ne $block0
5333 1 0 0 !defined($r) || $f ne $r
1 0 22 defined $u or defined $f and !defined($r) || $f ne $r
5413 4 4 2 $expr ne $expr0 or $block ne $block0
8 0 2 $expr ne $expr0 or $block ne $block0 or defined $valvar and $value ne $valvar
0 0 2 $expr ne $expr0 or $block ne $block0 or defined $valvar and $value ne $valvar or defined $key and defined $keyvar and $key ne $keyvar
5534 2 0 6 defined $c0 and $c0 ne $c or $b0 ne $b
5543 0 2 4 $expr ne $op1 or $changed
5731 82 111 202 scalar @ass > 0 or scalar @blk > 0