Branch Coverage

lib/B/DeparseTree/PPfns.pm
Criterion Covered Total %
branch 301 748 40.2


line true false branch
152 24 128 unless *{$_;}{'CODE'}
186 0 183 if ($name eq 'strict') { }
0 183 elsif ($name eq '$[') { }
0 183 elsif ($name eq 'integer' or $name eq 'bytes' or $name eq 'utf8') { }
0 183 elsif ($name eq 're') { }
0 183 elsif ($name eq 'warnings') { }
61 122 elsif ($name eq 'warning_bits') { }
61 61 elsif ($name eq 'hint_bits') { }
61 0 elsif ($name eq '%^H') { }
189 0 0 if ($val eq 'none')
195 0 0 if ($val eq 'all') { }
0 0 elsif (ref $val) { }
211 0 0 unless $val == 0
219 0 0 if ($val) { }
229 0 0 if ($val eq 'none')
235 0 0 if ($val eq 'all') { }
0 0 elsif (ref $val) { }
248 0 0 if ($val eq 'none')
254 0 0 if (ref $val) { }
261 0 0 unless defined $warning_bits
281 0 61 if (@_)
326 4 4377 if ($name eq 'concat' and $op->first->name eq 'concat')
330 26 1339 if ($name eq 'null' and B::class($op) eq 'UNOP' and $op->first->name =~ /^(and|x?or)$/ and B::Deparse::null($op->first->sibling))
341 2642 1709 $op->flags & 64 ? :
358 1348 30 if (scalar @_ > 5)
360 1301 47 if scalar @_ > 6
365 5 1373 if ($op->flags & 64 and $flags & 2)
369 1315 63 if ($flags & 1)
373 0 1378 if ($flags & 4 and not $lhs->{'text'} =~ /^(my|our|local|)[\@\(]/)
381 1315 63 if ($flags & 1) { }
426 0 0 if $cv
430 0 0 if ($op->name eq 'null' and $op->flags & 128) { }
440 0 0 $multiline ? :
442 0 0 $multiline ? :
463 1 5 if ($op->flags & 64 and $op->first->name ne 'concat')
490 0 2087 if (@texts)
496 1264 823 if ($stash ne $self->{'curstash'})
508 200 1887 if ($warnings->isa('B::SPECIAL') and $$warnings == 4) { }
1887 0 elsif ($warnings->isa('B::SPECIAL') and $$warnings == 5) { }
0 0 elsif ($warnings->isa('B::SPECIAL')) { }
521 1266 821 if (defined $warning_bits and !defined($self->{'warnings'}) || $self->{'warnings'} ne $warning_bits)
530 0 2087 $] < 5.008009 ? :
532 1321 766 if ($self->{'hints'} != $hints)
541 2087 0 if ($] > 5.009)
545 2087 0 if ($] >= 5.015006)
549 9 2078 if ($from != $to)
550 5 4 if ($to == $feature::hint_mask) { }
551 5 0 if ($self->{'hinthash'}) { }
571 2087 0 if ($] > 5.009)
585 0 2087 if ($self->{'linenums'} and $cx != 0.5)
587 0 0 if $self->{'opaddr'}
592 0 2087 if ($op->label)
606 14 1437 if ($left{assoc_class($op)} and $left{assoc_class($left)} and $left{assoc_class($op)} == $left{assoc_class($left)}) { }
655 0 0 if ($op->first->name eq 'stub' or $op->first->name eq 'nextstate')
676 0 0 if @body
702 0 0 if (scalar @args == 1 and substr($args[0], 0, 1) eq '(' and substr($args[0], -1, 1) eq ')') { }
713 0 1451 if ($right{assoc_class($op)} and $right{assoc_class($right)} and $right{assoc_class($op)} == $right{assoc_class($right)}) { }
730 298 573 if scalar @{$exprs;}
733 1642 0 if (defined $expr)
775 14 2 if ($type eq 'const') { }
0 2 elsif ($type eq 'concat') { }
0 2 elsif ($type eq 'join') { }
776 0 14 if $op->private & 0
789 0 0 unless $last->{'text'} =~ /^[A-Z\\\^\[\]_?]/ and $first->{'text'} =~ s/([\$\@])\^$/$1{^}/
800 0 0 if ($type eq 'uc') { }
0 0 elsif ($type eq 'lc') { }
0 0 elsif ($type eq 'ucfirst') { }
0 0 elsif ($type eq 'lcfirst') { }
0 0 elsif ($type eq 'quotemeta') { }
0 0 elsif ($type eq 'fc') { }
823 20 0 if ($op->flags & 4) { }
826 0 20 unless (B::Deparse::null($kid->sibling))
832 0 20 if ($pushmark_op)
837 0 0 unless $word_end > 0
846 0 0 if $op->flags & 128
858 0 0 if $self->{'unquote'}
873 0 1 unless ($array->name eq $padname)
880 1 0 if ($array_name) { }
881 1 0 unless ($array_name =~ /->\z/)
882 0 1 if ($array_name eq '#') { }
889 1 0 if $left
898 0 0 if (is_subscriptable($array)) { }
922 14 0 if (B::class($op) eq 'UNOP') { }
0 0 elsif (B::class($op) =~ /^(SV|PAD)OP$/) { }
925 6 8 if ($name =~ /^-/)
935 0 0 if ($self->func_needs_parens($gv_node->{'text'}, $cx, 16)) { }
953 0 0 $s->name eq 'unstack' ? :
976 0 0 if ($enterop->flags & 128) { }
1010 3 46 if ($op->flags & 64)
1013 3 0 if (B::Deparse::is_scope($indir_op)) { }
0 0 elsif ($indir_op->name eq 'const' and $indir_op->private & 64) { }
1015 0 3 if ($indir_info->{'text'} eq '') { }
1030 0 49 if ($name eq 'sort' and $op->private & 3) { }
0 83 elsif ($name eq 'sort' and $op->private & 16) { }
1032 0 0 $op->private & 16 ? :
1044 1 56 if (not $fmt and $kid == $firstkid and $name eq 'sort' and $firstkid->name =~ /^enter(xs)?sub/) { }
1052 57 0 if (defined $expr)
1061 0 49 if ($name eq 'sort' and $op->private & 4) { }
1067 2 47 if ($name eq 'sort' and $op->private & 8)
1078 0 47 if ($fmt ne '' and $name eq 'sort') { }
1 46 elsif (not $fmt and $name eq 'sort' and not B::Deparse::null($op->first->sibling) and $op->first->sibling->name eq 'entersub') { }
1110 42 4 if (@exprs) { }
1113 32 10 if ($self->func_needs_parens($exprs[0]{'text'}, $cx, 5)) { }
1121 3 39 if ($fmt) { }
1123 3 0 if ($indir_info)
1128 32 7 if (substr($args_fmt, 0, 1) eq '(') { }
1142 0 4 if 7 < $cx
1165 0 0 unless $op->name =~ /\A(?:introcv|clonecv)\z/
1175 2607 2647 if $kid->name eq 'pushmark'
1188 0 0 $kid->name eq 'pushmark' ? :
1201 0 97 if ($cx < 1 and B::Deparse::is_scope($right) and $blockname and $self->{'expand'} < 7) { }
35 62 elsif ($cx < 1 and $blockname and not $self->{'parens'} and $self->{'expand'} < 7) { }
16 46 elsif ($cx > $lowprec and $highop) { }
1242 0 0 if (@a == 0)
1245 0 0 if (@a == 1)
1251 0 0 if (@a > 2 and not grep((!/^-?\d+$/), @texts))
1255 0 0 unless grep(($i++ != $_), @texts)
1273 271 27 unless ($kid)
1282 24 274 if (B::Deparse::null($kid))
1284 2 22 $nollafr ? :
1292 74 200 if (defined $proto && $proto =~ /^;?\*/ || $name eq 'select' and $kid->name eq 'rv2gv' and not $kid->private & 128) { }
1304 0 274 if ($name eq 'chmod' and $first->{'text'} =~ /^\d+$/)
1314 0 274 if not $parens || $nollafr and substr($first->{'text'}, 0, 1) eq '('
1318 6 1 if (defined $proto and $proto =~ /^\*\*/ and $kid->name eq 'rv2gv' and not $kid->private & 128)
1327 0 274 if ($name eq 'reverse' and $op->private & 8)
1330 0 0 if ($parens) { }
1346 0 8 if ($name =~ /^(system|exec)$/ and $op->flags & 64 and @exprs > 1)
1352 0 0 if ($parens and $nollafr) { }
0 0 elsif ($parens) { }
1368 3 271 if ($parens and $nollafr) { }
242 29 elsif ($parens) { }
1379 0 274 if @new_nodes
1384 247 27 if (@skipped_ops)
1422 5 0 if ($kid->name eq 'lineseq') { }
0 0 elsif ($enter->name eq 'enteriter') { }
0 0 elsif ($kid->name eq 'null') { }
0 0 elsif ($kid->name eq 'stub') { }
1426 1 4 if ($kid->last->name eq 'unstack') { }
1440 0 0 if (B::Deparse::null($var)) { }
0 0 elsif ($var->name eq 'rv2gv') { }
0 0 elsif ($var->name eq 'gv') { }
1441 0 0 if ($enter->flags & 128 and $] < 5.009) { }
1453 0 0 if ($enter->private & 64) { }
1469 0 0 if ($ary->name eq 'null' and $enter->private & 2) { }
0 0 elsif ($enter->flags & 64 and not B::Deparse::null($ary->first->sibling->sibling)) { }
1491 0 0 unless (B::Deparse::is_state($body->first) or $body->first->name =~ /^(?:stub|leave|scope)$/)
1494 0 0 unless $var_info->{'text'} eq '_'
1531 0 5 if ($$cont_start != $$op and ${$cont_start;} != ${$body->last;}) { }
1534 0 0 if ($bare) { }
1549 0 0 if (defined $cond_info and not B::Deparse::is_scope($cont) and $self->{'expand'} < 3) { }
1553 0 0 if ($body_info->{'type'} eq 'statements')
1555 0 0 unless scalar @{$body_info->{'texts'};} == 1
1561 0 0 defined $init ? :
1576 0 5 unless defined $body
1578 0 5 if (defined $init)
1593 0 5 if (@cont_text)
1607 0 0 if (B::class($op) eq 'PVOP') { }
0 0 elsif (B::class($op) eq 'OP') { }
0 0 elsif (B::class($op) eq 'UNOP') { }
1619 0 0 if $text =~ /^(?!\d)\w/
1673 0 24 if (B::Deparse::is_scope($code_block)) { }
1705 24 0 if ($self->func_needs_parens($nodes[0]{'text'}, $cx, 5)) { }
1711 16 8 if (@nodes > 1)
1712 0 16 if ($is_block) { }
1729 0 24 if ($is_block) { }
1756 0 6 $] < 5.022 ? :
1769 4 2 if ($op->flags & 64) { }
0 2 elsif ($op->name eq 'match' and my $targ = $op->targ) { }
1787 0 6 if (not B::Deparse::null(my $code_list = $op->code_list)) { }
0 6 elsif (${$bregexp = $op->pmregexp;} and ${$cv = $bregexp->qr_anoncv;}) { }
1 5 elsif (not $have_kid) { }
0 5 elsif ($kid->name ne 'regcomp') { }
1788 0 0 $op->name eq 'qr' ? :
1810 0 0 if ($op->name eq 'split') { }
1821 0 5 if ($matchop->name eq 'regcrest')
1824 4 1 if ($matchop->name =~ /^(?:match|transr?|subst)\z/ and $matchop->flags & 128)
1830 0 6 if $pmflags & 33554432
1833 0 6 if $matchwords{$flags}
1835 0 6 if ($pmflags & 1048576) { }
2 4 elsif ($quote) { }
1847 2 4 if $quote
1849 4 2 if ($binop) { }
1851 4 0 if ($rhs_bound_to_defsv) { }
1874 0 0 if ($op->flags & 64)
1884 0 0 if (B::Deparse::null($kid)) { }
0 0 elsif ($kid->name ne 'regcomp') { }
1886 0 0 if ($extended) { }
1898 0 0 if ($matchop->name eq 'regcrest')
1901 0 0 if ($matchop->name =~ /^(?:match|transr?|subst)\z/ and $matchop->flags & 128)
1907 0 0 if $pmflags & 33554432
1910 0 0 if $matchwords{$flags}
1912 0 0 if ($pmflags & 1048576) { }
0 0 elsif ($quote) { }
1922 0 0 if $quote
1924 0 0 if ($binop) { }
1925 0 0 if ($rhs_bound_to_defsv) { }
1945 0 0 if (ref $expr eq 'ARRAY' and scalar @$expr == 2) { }
1973 94 1353 if (ref $info and $info->isa('B::DeparseTree::TreeNode')) { }
1981 1390 57 $op->name =~ /^(gv|rv2)[ash]v$/ ? :
1983 7 1440 if ($op->private & (128 | $our_intro) and not $self->{'avoid_local'}{$$op}) { }
1985 3 4 $op->private & 128 ? :
1986 4 3 if ($our_local eq 'our')
1989 0 0 unless ($text =~ /^\W(\w+::)*\w+\z/ or utf8::decode($text) and $text =~ /^\W(\w+::)*\w+\z/)
1995 4 0 if ($] >= 5.024)
1996 0 4 if ($type = $self->B::Deparse::find_our_type($text))
2001 0 4 if (not B::Deparse::want_scalar($op) and $self->func_needs_parens($text, $cx, 16)) { }
2010 21 9 $is_node ? :
2021 3 0 if (B::Deparse::want_scalar($op)) { }
2025 0 0 if (not B::Deparse::want_scalar($op) and $self->func_needs_parens($text, $cx, 16)) { }
2036 88 1352 if (ref $info and $info->isa('B::DeparseTree::TreeNode')) { }
2046 4400 0 $] >= 5.026 ? :
2059 0 4400 if (not $need_parens and $self->{'in_refgen'})
2062 29 4371 if ($op->private & 128 and not $self->{'avoid_local'}{$$op}) { }
2065 0 29 unless (defined $padname)
2069 2 27 $padname->FLAGS & 11 ? :
2071 0 29 if ($padname->FLAGS & 8)
2074 0 29 if ($need_parens) { }
21 8 elsif ($forbid_parens or B::Deparse::want_scalar($op)) { }
0 8 elsif ($self->func_needs_parens($text, $cx, 16)) { }
2084 0 4371 $need_parens ? :
2092 0 0 if ($op->private & 128 and not $self->{'avoid_local'}{$$op}) { }
2093 0 0 $op->private & 64 ? :
2096 0 0 if ($forbid_parens or B::Deparse::want_scalar($op)) { }
2113 1 1 if (&B::DeparseTree::TreeNode::parens_test($self, $cx, $prec)) { }
2117 0 1 if $cx == 16
2128 0 1 if ($prec <= $cx or substr($params, 0, 1) eq '(' or $self->{'parens'}) { }
2141 28 226 unless $opts
2145 0 254 if ($name eq 'umask' and $info->{'text'} =~ /^\d+$/)
2153 3 251 if ($cx > 16 or $self->{'parens'}) { }
2166 0 251 if (substr($info->{'text'}, 0, 1) eq '(') { }
2183 46 1751 $prefix eq '$#' ? :
2184 1 1796 if not $prefix or $name =~ /::/
2191 13 1783 if $name =~ /^(?!\d)\w/ and not $v =~ /^\$[ab]\z/ and not $globalnames{$name} and $self->{'hints'} & $strict_bits{'vars'} and not $self->B::Deparse::lex_in_scope($v, 1) or $self->B::Deparse::lex_in_scope($v)
2201 0 10 if ($op->private & 16) { }
2221 0 0 if B::class($kid) eq 'NULL'
2235 0 0 if ($lopname =~ /^pad[sah]v$/) { }
0 0 elsif ($lopname eq 'entersub') { }
2236 0 0 unless $loppriv & 128
2239 0 0 $padname->FLAGS & 8 ? :
2244 0 0 unless $thisclass eq $class
2248 0 0 $loppriv & 64 ? :
2249 0 0 if (defined $decl)
2250 0 0 unless $this eq $decl
2264 0 0 unless @padops and @padops == @entersubops
2278 0 0 unless $esop->flags & 4
2282 0 0 unless $kid->type == 3
2286 0 0 unless $$kid and $kid->type == 5
2287 0 0 unless $self->const_sv($kid)->PV eq 'attributes'
2291 0 0 unless $$kid and $kid->type == 5
2295 0 0 unless $$kid and $kid->name eq 'srefgen' and $kid->flags & 4 and $kid->first->flags & 4 and $kid->first->first->name =~ /^pad[sah]v$/ and $kid->first->first->targ == $padop->targ
2306 0 0 if $kid->type != 5
2311 0 0 unless @attr
2319 0 0 unless $attr_text eq $thisattr
2321 0 0 unless $kid->name eq 'method_named'
2322 0 0 unless $self->meth_sv($kid)->PV eq 'import'
2325 0 0 if $$kid
2329 0 0 if $class ne 'main'
2330 0 0 @varnames > 1 ? :
2346 0 2 if ($kid->name eq 'list' and B::Deparse::want_list($kid)) { }
2378 2 0 if ($meth->name eq 'method_named') { }
0 0 elsif ($meth->name eq 'method_super') { }
0 0 elsif ($meth->name eq 'method_redir') { }
0 0 elsif ($meth->name eq 'method_redir_super') { }
2379 0 2 if ($] < 5.018) { }
2397 0 0 if ($meth->name eq 'const')
2406 2 0 if ($method_name)
2411 2 0 if $op
2429 0 2 unless ($minfo->{'method_node'})
2440 0 2 if ($minfo->{'object'}->name eq 'scope' and B::Deparse::want_list($minfo->{'object'}))
2447 0 0 if ($need_paren) { }
2461 1 1 if (@{$minfo->{'args'};}) { }
2485 0 0 if (B::class($op) eq 'OP') { }
0 0 elsif (B::class($op) eq 'COP') { }
2486 0 0 if ($op->targ == 5) { }
2498 0 0 if ($self->is_list_older($kid)) { }
0 0 elsif ($kid->name eq 'enter') { }
0 0 elsif ($kid->name eq 'leave') { }
0 0 elsif ($kid->name eq 'scope') { }
0 0 elsif ($op->targ == 67) { }
0 0 elsif ($op->targ == 25) { }
0 0 elsif (not B::Deparse::null($kid->sibling) and $kid->sibling->name eq 'readline' and $kid->sibling->flags & 64) { }
0 0 elsif (not B::Deparse::null($kid->sibling) and $kid->sibling->name eq 'trans' and $kid->sibling->flags & 64) { }
0 0 elsif ($op->flags & 128 and $cx < 1 and not $op->targ) { }
0 0 elsif (not B::Deparse::null($kid->sibling) and $kid->sibling->name eq 'null' and B::class($kid->sibling) eq 'UNOP' and $kid->sibling->first->flags & 64 and $kid->sibling->first->name eq 'rcatline') { }
2563 0 2611 if ($node->{'parens'}) { }
1247 1364 elsif (exists $node->{'fmt'}) { }
2567 1200 47 if ($node->{'fmt'} =~ /^(.*)%[cCF]/)
2572 1356 8 if ($node->{'text'} =~ /^(.*)\W/)
2576 2556 55 if (defined $l)
2577 2512 44 $l > 0 ? :
2591 0 5255 if ($] >= 5.028 and $op->targ == 157)
2593 0 0 if defined $my_attr
2596 1 5254 if (B::class($op) eq 'OP') { }
0 5254 elsif (B::class($op) eq 'COP') { }
2599 1 0 if $op->targ == 5
2601 0 0 if $op->targ == 67
2608 2611 2643 if ($self->is_list_newer($op)) { }
0 2643 elsif ($kid->name eq 'enter') { }
0 2643 elsif ($kid->name eq 'leave') { }
0 2643 elsif ($kid->name eq 'scope') { }
0 2643 elsif ($op->targ == 67) { }
0 2643 elsif ($op->targ == 25) { }
0 2643 elsif (not B::Deparse::null($kid->sibling) and $kid->sibling->name eq 'readline' and $kid->sibling->flags & 64) { }
0 2643 elsif (not B::Deparse::null($kid->sibling) and $kid->sibling->name =~ /^transr?\z/ and $kid->sibling->flags & 64) { }
0 2643 elsif ($op->flags & 128 and $cx < 1 and not $op->targ) { }
0 2643 elsif (not B::Deparse::null($kid->sibling) and $kid->sibling->name eq 'null' and B::class($kid->sibling) eq 'UNOP' and $kid->sibling->first->flags & 64 and $kid->sibling->first->name eq 'rcatline') { }
2671 2556 55 if ($position)
2684 4400 0 $] >= 5.026 ? :
2719 0 5 if ($op->flags & 64)
2724 0 5 if (B::Deparse::null($right)) { }
2737 1 4 $dolist ? :
2739 1 4 if ($dolist)
2753 0 5 if (@skipped_ops)
2761 0 0 if ($start >= 0) { }
2792 0 0 if ($kid->name =~ /^(?:const|padsv|rv2sv|av2arylen|gvsv|multideref |aelemfast(?:_lex)?|[ah]elem|join|concat)\z/x) { }
2828 0 0 if ($op->flags & 64)
2835 0 0 if (B::Deparse::null($op->pmreplroot)) { }
2849 0 0 if ($pmflags & 67108864) { }
2856 0 0 if (B::Deparse::null($kid)) { }
2858 0 0 if ($extended) { }
2868 0 0 if $pmflags & 134217728
2869 0 0 if $pmflags & 67108864
2872 0 0 if $substwords{$flags}
2879 0 0 if @other_ops
2880 0 0 if ($binop) { }
2897 2 0 if (B::class($op) eq 'LISTOP') { }
2906 0 2 if $array->name eq $regname or $array->name eq 'null'
2911 0 2 if ($kid->name eq 'list') { }
2922 0 2 if $op->name =~ /^kv/i
2925 2 0 if ($array_info) { }
2957 0 0 if (ref $replroot eq 'B::GV') { }
0 0 elsif (not ref $replroot and $replroot > 0) { }
0 0 elsif ($kid->targ) { }
0 0 elsif ($stacked) { }
2968 0 0 if $gv
2976 0 0 $stacked ? :
2988 0 0 if ($op->flags & 128)
2995 0 0 if ($ary) { }
3015 0 18 if ($op->flags & 64) { }
0 18 elsif (my $targ = $op->targ) { }
3026 14 4 if (B::Deparse::null($op->pmreplroot)) { }
3040 4 14 if ($pmflags & 67108864) { }
3046 0 18 if (not B::Deparse::null(my $code_list = $op->code_list)) { }
18 0 elsif (B::Deparse::null($kid)) { }
3054 1 17 if $pmflags & 134217728
3055 4 14 if $pmflags & 67108864
3058 0 18 if $substwords{$flags}
3063 4 14 if @other_ops
3066 0 18 if ($binop) { }
3085 231 60 if ($op->flags & 4) { }
3088 0 231 unless ($name)
3096 231 0 unless $builtinname =~ /^CORE::/
3097 24 168 if (defined prototype $builtinname and $builtinname ne 'CORE::readline' and prototype($builtinname) =~ /^;?\*/ and $kid->name eq 'rv2gv')
3107 5 226 if ($nollafr)
3120 8 52 if $op->flags & 128
3135 0 6 if ($flags & 1) { }
0 6 elsif ($operator eq '-' and $operand->{'text'} =~ /^[a-zA-Z](?!\w)/) { }
3171 0 75 if (B::class($op) eq 'NULL' or not $op->can('first'))
3178 75 0 if ($kid->name eq 'gv') { }
0 0 elsif (B::Deparse::is_scalar($kid)) { }
3185 0 0 if ($str =~ /^\$([^\w\d])\z/)
3217 7 5 if $real_block
3219 7 5 if ($real_block) { }
3222 0 7 if (B::Deparse::is_miniwhile($kid))
3225 0 0 if ($name eq 'and') { }
0 0 elsif ($name eq 'or') { }
3252 0 12 if ($cx > 0) { }
3256 0 0 if (is_lexical_subs(@kids)) { }
3267 7 5 if @other_ops
3275 31 0 if $default and index($str, $default) == -1
3280 0 0 if ($q ne 'qr')
3282 0 0 if $succeed
3286 0 0 if index($str, $delim) == -1
3289 0 0 if ($default) { }