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

filter: Statementstmt 100% 45 / 45 Branchbran 87.5% 14 / 16 Conditioncond 41.6% 5 / 12 MC/DCmcdc 14.2% 1 / 7 Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 83.3% 75 / 90 CC 15 SCAR 20.4
CC
15
Cov
88%
_on_paramtest
13.1
_on_multiparam
4.0
finish_sub
2.0
CRAP 7.7
« lib/Pod/Coverage/More.pm ↑ Summary lib/Pod/Coverage/More/Declared/TypeParams.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.003;
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 25 ▶sub op_handlers {
Subroutine op_handlers: called CC=1 SCAR=0.0
Pod documented
15 25 my ($self) = @_;
16 25 my %handlers = %{ $self->SUPER::op_handlers() };
17 25 delete @handlers{qw{argcheck argelem}};
18 return {
19 25 %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 346 ▶sub finish_sub {
Subroutine finish_sub: called CC=2 SCAR=6.9
Pod documented
28 346 my ( $self, $record ) = @_;
29 346 ▶ return if !( $self->{cv}->CvFLAGS & B::CVf_IsMETHOD );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"cv"}->CvFLAGS & 1048576 344 2 346
30 2 $record->{method} = 1;
31 2 $self->_add_invocant($record);
32 2 return;
33 }
34  
35 66 ▶sub _on_multiparam {
Subroutine _on_multiparam: called CC=4 SCAR=13.9
36 66 my ( $self, $op ) = @_;
37 66 my ( $min, $max, $slurpy, @rest ) = $op->aux_list( $self->{cv} );
38 66 $self->{rec}{signature} = 1;
39 66 my @padix = splice( @rest, 0, $max );
40 66 my ($slurpy_padix) = @rest;
41  
42 66 foreach my $index ( 0 .. $#padix ) {
43 90 ▶ $self->_add_param(
Branch: 1 branch
BranchTrueFalseTotal
$index >= $min ? : 5 85 90
44 name => $self->_padname( $padix[$index] ),
45 index => $index,
46 source => 'signature',
47 optional => ( $index >= $min ) ? 1 : 0,
48 );
49 }
50 66 ▶ if ($slurpy) {
Branch: 1 branch
BranchTrueFalseTotal
if ($slurpy) 12 54 66
51 12 $self->_add_param(
52 name => $self->_padname($slurpy_padix),
53 index => $max,
54 source => 'signature',
55 slurpy => 1,
56 optional => 1,
57 );
58 }
59 66 return;
60 }
61  
62 # The default of the parameter whose pad entry is the op's own.
63 5 ▶sub _on_paramtest {
Subroutine _on_paramtest: called CC=11 SCAR=25.7
64 5 my ( $self, $op ) = @_;
65 5 my ($store) = $self->op_kids($op);
66 5 ▶ return unless $store && $store->name eq 'paramstore';
Branch: 1 branch
BranchTrueFalseTotal
unless $store and $store->name eq "paramstore" 0 5 5
Condition33%1/3
$store and $store->name eq "paramstore"
!ll&&!rl&&r
005
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 5 my $mode = '=';
69 5 ▶ $mode = '//=' if $op->private == B::OPpPARAM_IF_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if $op->private == 128 1 4 5
70 5 ▶ $mode = '||=' if $op->private == B::OPpPARAM_IF_FALSE;
Branch: 1 branch
BranchTrueFalseTotal
if $op->private == 64 1 4 5
71  
72 5 my ($expr) = $self->op_kids($store);
73 5 ▶ my $default = { mode => $mode, value => ( $expr && $expr->name ne 'stub' ) ? [ $self->classify($expr) ] : [] };
Branch: 1 branch
BranchTrueFalseTotal
$expr && $expr->name ne 'stub' ? : 5 0 5
Condition33%1/3
$expr and $expr->name ne "stub"
!ll&&!rl&&r
005
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 5 my $name = $self->_padname( $op->targ );
76 5 foreach my $param ( @{ $self->{rec}{params} } ) {
77 13 ▶ $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 8 13
Condition50%3/6
defined $param->{"name"} and defined $name and $param->{"name"} eq $name
!ll&&!rl&&r
085
defined $param->{"name"} and defined $name
!ll&&!rl&&r
0013
MC/DC33%1/3
defined $param->{"name"} and defined $name and $param->{"name"} eq $name
defined $param->{"name"} defined $name $param->{"name"} eq $name
Truth table50%2/4
A and B and C
A= defined $param->{"name"}B= defined $nameC= $param->{"name"} eq $name
ABCresult
0XX0
10X0
1100
1111
78 }
79 5 return;
80 }
81  
82 13 1;
83  
84 __END__
« lib/Pod/Coverage/More.pm ↑ Summary lib/Pod/Coverage/More/Declared/TypeParams.pm »