Branch Coverage

lib/B/DeparseTree/PPfns.pm
Criterion Covered Total %
branch 301 684 44.0


line true false branch
151 24 128 unless *{$_;}{'CODE'}
185 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') { }
188 0 0 if ($val eq 'none')
194 0 0 if ($val eq 'all') { }
0 0 elsif (ref $val) { }
210 0 0 unless $val == 0
218 0 0 if ($val) { }
228 0 0 if ($val eq 'none')
234 0 0 if ($val eq 'all') { }
0 0 elsif (ref $val) { }
247 0 0 if ($val eq 'none')
253 0 0 if (ref $val) { }
260 0 0 unless defined $warning_bits
280 0 61 if (@_)
325 4 4377 if ($name eq 'concat' and $op->first->name eq 'concat')
329 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))
340 2642 1709 $op->flags & 64 ? :
357 1348 30 if (scalar @_ > 5)
359 1301 47 if scalar @_ > 6
364 5 1373 if ($op->flags & 64 and $flags & 2)
368 1315 63 if ($flags & 1)
372 0 1378 if ($flags & 4 and not $lhs->{'text'} =~ /^(my|our|local|)[\@\(]/)
380 1315 63 if ($flags & 1) { }
425 0 0 if $cv
429 0 0 if ($op->name eq 'null' and $op->flags & 128) { }
439 0 0 $multiline ? :
441 0 0 $multiline ? :
462 1 5 if ($op->flags & 64 and $op->first->name ne 'concat')
489 0 2087 if (@texts)
495 1264 823 if ($stash ne $self->{'curstash'})
507 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')) { }
520 1266 821 if (defined $warning_bits and !defined($self->{'warnings'}) || $self->{'warnings'} ne $warning_bits)
529 0 2087 $] < 5.008009 ? :
531 1321 766 if ($self->{'hints'} != $hints)
540 2087 0 if ($] > 5.009)
544 2087 0 if ($] >= 5.015006)
548 9 2078 if ($from != $to)
549 5 4 if ($to == $feature::hint_mask) { }
550 5 0 if ($self->{'hinthash'}) { }
570 2087 0 if ($] > 5.009)
584 0 2087 if ($self->{'linenums'} and $cx != 0.5)
586 0 0 if $self->{'opaddr'}
591 0 2087 if ($op->label)
605 14 1437 if ($left{assoc_class($op)} and $left{assoc_class($left)} and $left{assoc_class($op)} == $left{assoc_class($left)}) { }
654 0 0 if ($op->first->name eq 'stub' or $op->first->name eq 'nextstate')
675 0 0 if @body
701 0 0 if (scalar @args == 1 and substr($args[0], 0, 1) eq '(' and substr($args[0], -1, 1) eq ')') { }
712 0 1451 if ($right{assoc_class($op)} and $right{assoc_class($right)} and $right{assoc_class($op)} == $right{assoc_class($right)}) { }
729 298 573 if scalar @{$exprs;}
732 1642 0 if (defined $expr)
774 14 2 if ($type eq 'const') { }
0 2 elsif ($type eq 'concat') { }
0 2 elsif ($type eq 'join') { }
775 0 14 if $op->private & 0
788 0 0 unless $last->{'text'} =~ /^[A-Z\\\^\[\]_?]/ and $first->{'text'} =~ s/([\$\@])\^$/$1{^}/
799 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') { }
822 20 0 if ($op->flags & 4) { }
825 0 20 unless (B::Deparse::null($kid->sibling))
831 0 20 if ($pushmark_op)
836 0 0 unless $word_end > 0
845 0 0 if $op->flags & 128
857 0 0 if $self->{'unquote'}
872 0 1 unless ($array->name eq $padname)
879 1 0 if ($array_name) { }
880 1 0 unless ($array_name =~ /->\z/)
881 0 1 if ($array_name eq '#') { }
888 1 0 if $left
897 0 0 if (is_subscriptable($array)) { }
921 14 0 if (B::class($op) eq 'UNOP') { }
0 0 elsif (B::class($op) =~ /^(SV|PAD)OP$/) { }
924 6 8 if ($name =~ /^-/)
934 0 0 if ($self->func_needs_parens($gv_node->{'text'}, $cx, 16)) { }
952 0 0 $s->name eq 'unstack' ? :
975 0 0 if ($enterop->flags & 128) { }
1009 3 46 if ($op->flags & 64)
1012 3 0 if (B::Deparse::is_scope($indir_op)) { }
0 0 elsif ($indir_op->name eq 'const' and $indir_op->private & 64) { }
1014 0 3 if ($indir_info->{'text'} eq '') { }
1029 0 49 if ($name eq 'sort' and $op->private & 3) { }
0 83 elsif ($name eq 'sort' and $op->private & 16) { }
1031 0 0 $op->private & 16 ? :
1043 1 56 if (not $fmt and $kid == $firstkid and $name eq 'sort' and $firstkid->name =~ /^enter(xs)?sub/) { }
1051 57 0 if (defined $expr)
1060 0 49 if ($name eq 'sort' and $op->private & 4) { }
1066 2 47 if ($name eq 'sort' and $op->private & 8)
1077 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') { }
1109 42 4 if (@exprs) { }
1112 32 10 if ($self->func_needs_parens($exprs[0]{'text'}, $cx, 5)) { }
1120 3 39 if ($fmt) { }
1122 3 0 if ($indir_info)
1127 32 7 if (substr($args_fmt, 0, 1) eq '(') { }
1141 0 4 if 7 < $cx
1164 0 0 unless $op->name =~ /\A(?:introcv|clonecv)\z/
1174 2607 2647 if $kid->name eq 'pushmark'
1187 0 0 $kid->name eq 'pushmark' ? :
1200 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 271 27 unless ($kid)
1251 24 274 if (B::Deparse::null($kid))
1253 2 22 $nollafr ? :
1261 74 200 if (defined $proto && $proto =~ /^;?\*/ || $name eq 'select' and $kid->name eq 'rv2gv' and not $kid->private & 128) { }
1273 0 274 if ($name eq 'chmod' and $first->{'text'} =~ /^\d+$/)
1283 0 274 if not $parens || $nollafr and substr($first->{'text'}, 0, 1) eq '('
1287 6 1 if (defined $proto and $proto =~ /^\*\*/ and $kid->name eq 'rv2gv' and not $kid->private & 128)
1296 0 274 if ($name eq 'reverse' and $op->private & 8)
1299 0 0 if ($parens) { }
1315 0 8 if ($name =~ /^(system|exec)$/ and $op->flags & 64 and @exprs > 1)
1321 0 0 if ($parens and $nollafr) { }
0 0 elsif ($parens) { }
1337 3 271 if ($parens and $nollafr) { }
242 29 elsif ($parens) { }
1348 0 274 if @new_nodes
1353 247 27 if (@skipped_ops)
1391 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') { }
1395 1 4 if ($kid->last->name eq 'unstack') { }
1409 0 0 if (B::Deparse::null($var)) { }
0 0 elsif ($var->name eq 'rv2gv') { }
0 0 elsif ($var->name eq 'gv') { }
1410 0 0 if ($enter->flags & 128 and $] < 5.009) { }
1422 0 0 if ($enter->private & 64) { }
1438 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)) { }
1460 0 0 unless (B::Deparse::is_state($body->first) or $body->first->name =~ /^(?:stub|leave|scope)$/)
1498 0 5 if ($$cont_start != $$op and ${$cont_start;} != ${$body->last;}) { }
1501 0 0 if ($bare) { }
1516 0 0 if (defined $cond_info and not B::Deparse::is_scope($cont) and $self->{'expand'} < 3) { }
1520 0 0 defined $init ? :
1535 0 5 unless defined $body
1537 0 5 if (defined $init)
1552 0 5 if (@cont_text)
1566 0 0 if (B::class($op) eq 'PVOP') { }
0 0 elsif (B::class($op) eq 'OP') { }
0 0 elsif (B::class($op) eq 'UNOP') { }
1578 0 0 if $text =~ /^(?!\d)\w/
1632 0 24 if (B::Deparse::is_scope($code_block)) { }
1664 24 0 if ($self->func_needs_parens($nodes[0]{'text'}, $cx, 5)) { }
1670 16 8 if (@nodes > 1)
1671 0 16 if ($is_block) { }
1688 0 24 if ($is_block) { }
1715 0 6 $] < 5.022 ? :
1728 4 2 if ($op->flags & 64) { }
0 2 elsif ($op->name eq 'match' and my $targ = $op->targ) { }
1746 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') { }
1747 0 0 $op->name eq 'qr' ? :
1769 0 0 if ($op->name eq 'split') { }
1780 0 5 if ($matchop->name eq 'regcrest')
1783 4 1 if ($matchop->name =~ /^(?:match|transr?|subst)\z/ and $matchop->flags & 128)
1789 0 6 if $pmflags & 33554432
1792 0 6 if $matchwords{$flags}
1794 0 6 if ($pmflags & 1048576) { }
2 4 elsif ($quote) { }
1806 2 4 if $quote
1808 4 2 if ($binop) { }
1810 4 0 if ($rhs_bound_to_defsv) { }
1833 0 0 if ($op->flags & 64)
1843 0 0 if (B::Deparse::null($kid)) { }
0 0 elsif ($kid->name ne 'regcomp') { }
1845 0 0 if ($extended) { }
1857 0 0 if ($matchop->name eq 'regcrest')
1860 0 0 if ($matchop->name =~ /^(?:match|transr?|subst)\z/ and $matchop->flags & 128)
1866 0 0 if $pmflags & 33554432
1869 0 0 if $matchwords{$flags}
1871 0 0 if ($pmflags & 1048576) { }
0 0 elsif ($quote) { }
1881 0 0 if $quote
1883 0 0 if ($binop) { }
1884 0 0 if ($rhs_bound_to_defsv) { }
1904 0 0 if (ref $expr eq 'ARRAY' and scalar @$expr == 2) { }
1932 94 1353 if (ref $info and $info->isa('B::DeparseTree::TreeNode')) { }
1940 1390 57 $op->name =~ /^(gv|rv2)[ash]v$/ ? :
1942 7 1440 if ($op->private & (128 | $our_intro) and not $self->{'avoid_local'}{$$op}) { }
1944 3 4 $op->private & 128 ? :
1945 4 3 if ($our_local eq 'our')
1948 0 0 unless ($text =~ /^\W(\w+::)*\w+\z/ or utf8::decode($text) and $text =~ /^\W(\w+::)*\w+\z/)
1954 4 0 if ($] >= 5.024)
1955 0 4 if ($type = $self->B::Deparse::find_our_type($text))
1960 0 4 if (not B::Deparse::want_scalar($op) and $self->func_needs_parens($text, $cx, 16)) { }
1969 21 9 $is_node ? :
1980 3 0 if (B::Deparse::want_scalar($op)) { }
1984 0 0 if (not B::Deparse::want_scalar($op) and $self->func_needs_parens($text, $cx, 16)) { }
1995 88 1352 if (ref $info and $info->isa('B::DeparseTree::TreeNode')) { }
2005 4400 0 $] >= 5.026 ? :
2018 0 4400 if (not $need_parens and $self->{'in_refgen'})
2021 29 4371 if ($op->private & 128 and not $self->{'avoid_local'}{$$op}) { }
2024 0 29 unless (defined $padname)
2028 2 27 $padname->FLAGS & 11 ? :
2030 0 29 if ($padname->FLAGS & 8)
2033 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)) { }
2043 0 4371 $need_parens ? :
2051 0 0 if ($op->private & 128 and not $self->{'avoid_local'}{$$op}) { }
2052 0 0 $op->private & 64 ? :
2055 0 0 if ($forbid_parens or B::Deparse::want_scalar($op)) { }
2072 1 1 if (&B::DeparseTree::TreeNode::parens_test($self, $cx, $prec)) { }
2076 0 1 if $cx == 16
2087 0 1 if ($prec <= $cx or substr($params, 0, 1) eq '(' or $self->{'parens'}) { }
2100 28 226 unless $opts
2104 0 254 if ($name eq 'umask' and $info->{'text'} =~ /^\d+$/)
2112 3 251 if ($cx > 16 or $self->{'parens'}) { }
2125 0 251 if (substr($info->{'text'}, 0, 1) eq '(') { }
2142 46 1751 $prefix eq '$#' ? :
2143 1 1796 if not $prefix or $name =~ /::/
2150 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)
2159 0 10 if ($op->private & 16) { }
2178 0 2 if ($kid->name eq 'list' and B::Deparse::want_list($kid)) { }
2210 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') { }
2211 0 2 if ($] < 5.018) { }
2229 0 0 if ($meth->name eq 'const')
2238 2 0 if ($method_name)
2243 2 0 if $op
2261 0 2 unless ($minfo->{'method_node'})
2272 0 2 if ($minfo->{'object'}->name eq 'scope' and B::Deparse::want_list($minfo->{'object'}))
2279 0 0 if ($need_paren) { }
2293 1 1 if (@{$minfo->{'args'};}) { }
2317 0 0 if (B::class($op) eq 'OP') { }
0 0 elsif (B::class($op) eq 'COP') { }
2318 0 0 if ($op->targ == 5) { }
2330 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') { }
2395 0 2611 if ($node->{'parens'}) { }
1247 1364 elsif (exists $node->{'fmt'}) { }
2399 1200 47 if ($node->{'fmt'} =~ /^(.*)%[cCF]/)
2404 1356 8 if ($node->{'text'} =~ /^(.*)\W/)
2408 2556 55 if (defined $l)
2409 2512 44 $l > 0 ? :
2423 0 5255 if ($] >= 5.028 and $op->targ == 157)
2429 1 5254 if (B::class($op) eq 'OP') { }
0 5254 elsif (B::class($op) eq 'COP') { }
2432 1 0 if $op->targ == 5
2434 0 0 if $op->targ == 67
2441 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') { }
2504 2556 55 if ($position)
2517 4400 0 $] >= 5.026 ? :
2552 0 5 if ($op->flags & 64)
2557 0 5 if (B::Deparse::null($right)) { }
2570 1 4 $dolist ? :
2572 1 4 if ($dolist)
2586 0 5 if (@skipped_ops)
2594 0 0 if ($start >= 0) { }
2625 0 0 if ($kid->name =~ /^(?:const|padsv|rv2sv|av2arylen|gvsv|multideref |aelemfast(?:_lex)?|[ah]elem|join|concat)\z/x) { }
2661 0 0 if ($op->flags & 64)
2668 0 0 if (B::Deparse::null($op->pmreplroot)) { }
2682 0 0 if ($pmflags & 67108864) { }
2689 0 0 if (B::Deparse::null($kid)) { }
2691 0 0 if ($extended) { }
2701 0 0 if $pmflags & 134217728
2702 0 0 if $pmflags & 67108864
2705 0 0 if $substwords{$flags}
2712 0 0 if @other_ops
2713 0 0 if ($binop) { }
2730 2 0 if (B::class($op) eq 'LISTOP') { }
2739 0 2 if $array->name eq $regname or $array->name eq 'null'
2744 0 2 if ($kid->name eq 'list') { }
2755 0 2 if $op->name =~ /^kv/i
2758 2 0 if ($array_info) { }
2790 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) { }
2801 0 0 if $gv
2809 0 0 $stacked ? :
2821 0 0 if ($op->flags & 128)
2828 0 0 if ($ary) { }
2848 0 18 if ($op->flags & 64) { }
0 18 elsif (my $targ = $op->targ) { }
2859 14 4 if (B::Deparse::null($op->pmreplroot)) { }
2873 4 14 if ($pmflags & 67108864) { }
2879 0 18 if (not B::Deparse::null(my $code_list = $op->code_list)) { }
18 0 elsif (B::Deparse::null($kid)) { }
2887 1 17 if $pmflags & 134217728
2888 4 14 if $pmflags & 67108864
2891 0 18 if $substwords{$flags}
2896 4 14 if @other_ops
2899 0 18 if ($binop) { }
2918 231 60 if ($op->flags & 4) { }
2921 0 231 unless ($name)
2929 231 0 unless $builtinname =~ /^CORE::/
2930 24 168 if (defined prototype $builtinname and $builtinname ne 'CORE::readline' and prototype($builtinname) =~ /^;?\*/ and $kid->name eq 'rv2gv')
2940 5 226 if ($nollafr)
2953 8 52 if $op->flags & 128
2968 0 6 if ($flags & 1) { }
0 6 elsif ($operator eq '-' and $operand->{'text'} =~ /^[a-zA-Z](?!\w)/) { }
3004 0 75 if (B::class($op) eq 'NULL' or not $op->can('first'))
3011 75 0 if ($kid->name eq 'gv') { }
0 0 elsif (B::Deparse::is_scalar($kid)) { }
3018 0 0 if ($str =~ /^\$([^\w\d])\z/)
3050 7 5 if $real_block
3052 7 5 if ($real_block) { }
3055 0 7 if (B::Deparse::is_miniwhile($kid))
3058 0 0 if ($name eq 'and') { }
0 0 elsif ($name eq 'or') { }
3085 0 12 if ($cx > 0) { }
3089 0 0 if (is_lexical_subs(@kids)) { }
3101 7 5 if @other_ops
3109 31 0 if $default and index($str, $default) == -1
3114 0 0 if ($q ne 'qr')
3116 0 0 if $succeed
3120 0 0 if index($str, $delim) == -1
3123 0 0 if ($default) { }