blib/lib/Devel/XSCover/Deparse.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 8 / 8 Conditioncond 50.0% 9 / 18 MC/DCmcdc 33.3% 3 / 9 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 81.0% 64 / 79 CC 11 SCAR 15.8
CC
11
Cov
85%
__ANON__
8.1
custom
6.0
BEGIN
1.0
CRAP 4.8
« blib/lib/Devel/XSCover/Build.pm ↑ Summary blib/lib/Devel/XSCover.pm »
1 package Devel::XSCover::Deparse;
2  
3 2 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use B ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use B::Deparse ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 our $VERSION = '0.09';
11  
12 2 our ($ORIGINAL, $CUSTOM);
13  
14 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.2
15 2 $CUSTOM = B::opnumber('custom');
16 2 $ORIGINAL = \&B::Deparse::AUTOLOAD;
17 package
18 B::Deparse;
19 2 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 3 ▶ *B::Deparse::AUTOLOAD = sub {
Subroutine __ANON__: called CC=6 SCAR=20.9
21 3 our $AUTOLOAD;
22 3 ▶ if ($AUTOLOAD =~ /::pp_/ && @_ > 1 && ref $_[1] && $_[1]->can('type') && $_[1]->type == $Devel::XSCover::Deparse::CUSTOM) {
Branch: 1 branch
BranchTrueFalseTotal
if ($B::Deparse::AUTOLOAD =~ /::pp_/u and @_ > 1 and ref $_[1] and $_[1]->can("type") and $_[1]->type == $Devel::XSCover::Deparse::CUSTOM) 2 1 3
Condition41%5/12
$B::Deparse::AUTOLOAD =~ /::pp_/u and @_ > 1 and ref $_[1] and $_[1]->can("type") and $_[1]->type == $Devel::XSCover::Deparse::CUSTOM
!ll&&!rl&&r
012
$B::Deparse::AUTOLOAD =~ /::pp_/u and @_ > 1 and ref $_[1] and $_[1]->can("type")
!ll&&!rl&&r
003
$B::Deparse::AUTOLOAD =~ /::pp_/u and @_ > 1 and ref $_[1]
!ll&&!rl&&r
003
$B::Deparse::AUTOLOAD =~ /::pp_/u and @_ > 1
!ll&&!rl&&r
003
MC/DC20%1/5
$B::Deparse::AUTOLOAD =~ /::pp_/u and @_ > 1 and ref $_[1] and $_[1]->can("type") and $_[1]->type == $Devel::XSCover::Deparse::CUSTOM
$B::Deparse::AUTOLOAD =~ /::pp_/u @_ > 1 ref $_[1] $_[1]->can("type") $_[1]->type == $Devel::XSCover::Deparse::CUSTOM
Truth table33%2/6
A and B and C and D and E
A= $B::Deparse::AUTOLOAD =~ /::pp_/uB= @_ > 1C= ref $_[1]D= $_[1]->can("type")E= $_[1]->type == $Devel::XSCover::Deparse::CUSTOM
ABCDEresult
0XXXX0
10XXX0
110XX0
1110X0
111100
111111
23 2 return Devel::XSCover::Deparse::custom(@_);
24 }
25 1 goto &$Devel::XSCover::Deparse::ORIGINAL;
26 2 };
27 }
28  
29 2 ▶sub custom {
Subroutine custom: called CC=6 SCAR=18.0
Pod documented
30 2 my ($self, $op, $cx) = @_;
31 2 my @kids;
32 2 ▶ if ($op->can('first') && ($op->flags & B::OPf_KIDS())) {
Branch: 1 branch
BranchTrueFalseTotal
if ($op->can("first") and $op->flags & 4) 1 1 2
Condition66%2/3
$op->can("first") and $op->flags & 4
!ll&&!rl&&r
011
MC/DC50%1/2
$op->can("first") and $op->flags & 4
$op->can("first") $op->flags & 4
Truth table66%2/3
A and B
A= $op->can("first")B= $op->flags & 4
ABresult
0X0
100
111
33 1 ▶ for (my $kid = $op->first; ref $kid && !$kid->isa('B::NULL'); $kid = $kid->sibling) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $kid and not $kid->isa("B::NULL")) 3 1 4
Condition66%2/3
ref $kid and not $kid->isa("B::NULL")
!ll&&!rl&&r
013
MC/DC50%1/2
ref $kid and not $kid->isa("B::NULL")
ref $kid not $kid->isa("B::NULL")
Truth table66%2/3
A and not(B)
A= ref $kidB= not $kid->isa("B::NULL")
ABresult
0X0
100
111
34 3 ▶ next if $kid->name eq 'pushmark';
Branch: 1 branch
BranchTrueFalseTotal
if $kid->name eq "pushmark" 1 2 3
35 2 push @kids, $self->deparse($kid, 6);
36 }
37 }
38 2 return $op->name . '(' . join(', ', @kids) . ')';
39 }
40  
41 2 1;
42  
43 __END__
« blib/lib/Devel/XSCover/Build.pm ↑ Summary blib/lib/Devel/XSCover.pm »