| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition33%1/3
$store and $store->name eq "paramstore"
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"
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 5 | my $mode = '='; | |||||||||||||||||||||||||||||||||||||||||
| 69 | 5 | ▶ | $mode = '//=' if $op->private == B::OPpPARAM_IF_UNDEF; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 5 | ▶ | $mode = '||=' if $op->private == B::OPpPARAM_IF_FALSE; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition33%1/3
$expr and $expr->name ne "stub"
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"
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition50%3/6
defined $param->{"name"} and defined $name and $param->{"name"} eq $name
defined $param->{"name"} and defined $name
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
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 5 | return; | |||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | 13 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | __END__ | ||||||||||||||||||||||||||||||||||||||||||