lib/Pod/Coverage/More/Analyzer/Perl5_44.pm

filter: Statementstmt 100% 45 / 45 Branchbran 87.5% 14 / 16 Conditioncond 66.6% 8 / 12 MC/DCmcdc 42.8% 3 / 7 Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 88.8% 80 / 90 CC 15 SCAR 19.4
CC
15
Cov
92%
_on_paramtest
11.6
_on_multiparam
4.0
finish_sub
2.0
CRAP 6.9
« lib/Pod/Coverage/More/Declared/TypeParams.pm ↑ Summary lib/Pod/Coverage/More/Analyzer/Perl5_38.pm »
1 # ABSTRACT: Op tree analysis for perl 5.44 and later
2 # PODNAME: Pod::Coverage::More::Analyzer::Perl5_44
3  
4 package Pod::Coverage::More::Analyzer::Perl5_44 0.005;
5  
6 13 ▶use 5.036;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 13 ▶use warnings FATAL => q{all};
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 13 ▶use B ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 13 ▶use parent 'Pod::Coverage::More::Analyzer::Perl5_38';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 27 ▶sub op_handlers {
Subroutine op_handlers: called CC=1 SCAR=0.0
Pod documented
15 27 my ($self) = @_;
16 27 my %handlers = %{ $self->SUPER::op_handlers() };
17 27 delete @handlers{qw{argcheck argelem}};
18 return {
19 27 %handlers,
20 multiparam => \&_on_multiparam,
21 paramtest => \&_on_paramtest,
22 };
23 }
24  
25 # The placeholders that Perl5_36 fills in from argcheck are listed in multiparam itself,
26 # and so is the implicit $self of a method of the core class feature.
27 458 ▶sub finish_sub {
Subroutine finish_sub: called CC=2 SCAR=6.9
Pod documented
28 458 my ( $self, $record ) = @_;
29 458 ▶ return if !( $self->{cv}->CvFLAGS & B::CVf_IsMETHOD );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"cv"}->CvFLAGS & 1048576 456 2 458
30 2 $record->{method} = 1;
31 2 $self->_add_invocant($record);
32 2 return;
33 }
34  
35 87 ▶sub _on_multiparam {
Subroutine _on_multiparam: called CC=4 SCAR=13.9
36 87 my ( $self, $op ) = @_;
37 87 my ( $min, $max, $slurpy, @rest ) = $op->aux_list( $self->{cv} );
38 87 $self->{rec}{signature} = 1;
39 87 my @padix = splice( @rest, 0, $max );
40 87 my ($slurpy_padix) = @rest;
41  
42 87 foreach my $index ( 0 .. $#padix ) {
43 126 ▶ $self->_add_param(
Branch: 1 branch
BranchTrueFalseTotal
$index >= $min ? : 7 119 126
44 name => $self->_padname( $padix[$index] ),
45 index => $index,
46 source => 'signature',
47 optional => ( $index >= $min ) ? 1 : 0,
48 );
49 }
50 87 ▶ if ($slurpy) {
Branch: 1 branch
BranchTrueFalseTotal
if ($slurpy) 26 61 87
51 26 $self->_add_param(
52 name => $self->_padname($slurpy_padix),
53 index => $max,
54 source => 'signature',
55 slurpy => 1,
56 optional => 1,
57 );
58 }
59 87 return;
60 }
61  
62 # The default of the parameter whose pad entry is the op's own.
63 7 ▶sub _on_paramtest {
Subroutine _on_paramtest: called CC=11 SCAR=24.5
64 7 my ( $self, $op ) = @_;
65 7 my ($store) = $self->op_kids($op);
66 7 ▶ return unless $store && $store->name eq 'paramstore';
Branch: 1 branch
BranchTrueFalseTotal
unless $store and $store->name eq "paramstore" 0 7 7
Condition33%1/3
$store and $store->name eq "paramstore"
!ll&&!rl&&r
007
MC/DC0%0/2
$store and $store->name eq "paramstore"
$store $store->name eq "paramstore"
Truth table33%1/3
A and B
A= $storeB= $store->name eq "paramstore"
ABresult
0X0
100
111
67  
68 7 my $mode = '=';
69 7 ▶ $mode = '//=' if $op->private == B::OPpPARAM_IF_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if $op->private == 128 1 6 7
70 7 ▶ $mode = '||=' if $op->private == B::OPpPARAM_IF_FALSE;
Branch: 1 branch
BranchTrueFalseTotal
if $op->private == 64 1 6 7
71  
72 7 my ($expr) = $self->op_kids($store);
73 7 ▶ my $default = { mode => $mode, value => ( $expr && $expr->name ne 'stub' ) ? [ $self->classify($expr) ] : [] };
Branch: 1 branch
BranchTrueFalseTotal
$expr && $expr->name ne 'stub' ? : 7 0 7
Condition33%1/3
$expr and $expr->name ne "stub"
!ll&&!rl&&r
007
MC/DC0%0/2
$expr and $expr->name ne "stub"
$expr $expr->name ne "stub"
Truth table33%1/3
A and B
A= $exprB= $expr->name ne "stub"
ABresult
0X0
100
111
74  
75 7 my $name = $self->_padname( $op->targ );
76 7 foreach my $param ( @{ $self->{rec}{params} } ) {
77 17 ▶ $param->{default} = $default if defined $param->{name} && defined $name && $param->{name} eq $name;
Branch: 1 branch
BranchTrueFalseTotal
if defined $param->{"name"} and defined $name and $param->{"name"} eq $name 5 12 17
Condition100%6/6
defined $param->{"name"} and defined $name and $param->{"name"} eq $name
!ll&&!rl&&r
485
defined $param->{"name"} and defined $name
!ll&&!rl&&r
2213
MC/DC100%3/3
defined $param->{"name"} and defined $name and $param->{"name"} eq $name
defined $param->{"name"} defined $name $param->{"name"} eq $name
Truth table100%4/4
A and B and C
A= defined $param->{"name"}B= defined $nameC= $param->{"name"} eq $name
ABCresult
0XX0
10X0
1100
1111
78 }
79 7 return;
80 }
81  
82 13 1;
83  
84 __END__
« lib/Pod/Coverage/More/Declared/TypeParams.pm ↑ Summary lib/Pod/Coverage/More/Analyzer/Perl5_38.pm »