| 1 | # ABSTRACT: Op tree analysis for perl 5.38 to 5.42 | ||||||||||||||||||||||||
| 2 | # PODNAME: Pod::Coverage::More::Analyzer::Perl5_38 | ||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||
| 4 | package Pod::Coverage::More::Analyzer::Perl5_38 0.001; | ||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||
| 6 | 10 | ▶ | use 5.036; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 7 | 10 | ▶ | use warnings FATAL => q{all}; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||
| 9 | 10 | ▶ | use B (); | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||
| 11 | 10 | ▶ | use parent 'Pod::Coverage::More::Analyzer::Perl5_36'; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||
| 14 | 20 | ▶ | sub op_handlers { | ||||||||||||||||||||||
|
Subroutine
op_handlers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||
| 15 | 20 | my ($self) = @_; | |||||||||||||||||||||||
| 16 | return { | ||||||||||||||||||||||||
| 17 | 20 | %{ $self->SUPER::op_handlers() }, | |||||||||||||||||||||||
| 18 | padsv_store => \&_on_padsv_store, | ||||||||||||||||||||||||
| 19 | }; | ||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||
| 22 | 20 | ▶ | sub op_classifiers { | ||||||||||||||||||||||
|
Subroutine
op_classifiers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||
| 23 | 20 | my ($self) = @_; | |||||||||||||||||||||||
| 24 | return { | ||||||||||||||||||||||||
| 25 | 20 | %{ $self->SUPER::op_classifiers() }, | |||||||||||||||||||||||
| 26 | padsv_store => \&_classify_padsv_store, | ||||||||||||||||||||||||
| 27 | emptyavhv => \&_classify_emptyavhv, | ||||||||||||||||||||||||
| 28 | }; | ||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||
| 31 | 0 | ▶ | sub default_mode { | ||||||||||||||||||||||
|
Subroutine
default_mode: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||
| 32 | 0 | my ( $self, $argdefelem ) = @_; | |||||||||||||||||||||||
| 33 | 0 | ▶ | return '//=' if $argdefelem->private & B::OPpARG_IF_UNDEF; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 34 | 0 | ▶ | return '||=' if $argdefelem->private & B::OPpARG_IF_FALSE; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 35 | 0 | return '='; | |||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||
| 38 | # A method of the core class feature takes an implicit $self, which argcheck does not count. | ||||||||||||||||||||||||
| 39 | 0 | ▶ | sub finish_sub { | ||||||||||||||||||||||
|
Subroutine
finish_sub: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||
| 40 | 0 | my ( $self, $record ) = @_; | |||||||||||||||||||||||
| 41 | 0 | $self->SUPER::finish_sub($record); | |||||||||||||||||||||||
| 42 | 0 | ▶ | return if !( $self->{cv}->CvFLAGS & B::CVf_IsMETHOD ); | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 43 | 0 | $record->{method} = 1; | |||||||||||||||||||||||
| 44 | 0 | foreach my $param ( @{ $record->{params} } ) { | |||||||||||||||||||||||
| 45 | 0 | ▶ | $param->{index}++ if $param->{source} eq q{signature}; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||
| 47 | 0 | $self->_add_invocant($record); | |||||||||||||||||||||||
| 48 | 0 | return; | |||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||
| 51 | # Makes parameter 0 of a method its implicit $self. | ||||||||||||||||||||||||
| 52 | 2 | ▶ | sub _add_invocant { | ||||||||||||||||||||||
|
Subroutine
_add_invocant: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||
| 53 | 2 | my ( $self, $rec ) = @_; | |||||||||||||||||||||||
| 54 | 2 | ▶ | my ($invocant) = grep { $_->{index} == 0 && ( $_->{name} // q{} ) eq q{$self} } @{ $rec->{params} }; | ||||||||||||||||||||||
|
Condition60%3/5
$_->{'index'} == 0 && ($_->{'name'} // '') eq '$self'
$_->{"name"} // ""
MC/DC50%1/2
$_->{'index'} == 0 && ($_->{'name'} // '') eq '$self'
$_->{'index'} == 0
$_->{"name"}
Truth table66%2/3
A && B
A= $_->{'index'} == 0B= $_->{"name"}
| |||||||||||||||||||||||||
| 55 | 2 | ▶ | if ($invocant) { | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 56 | 1 | $invocant->{source} = q{invocant}; | |||||||||||||||||||||||
| 57 | 1 | return; | |||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||
| 59 | 1 | unshift @{ $rec->{params} }, { name => q{$self}, index => 0, source => q{invocant}, slurpy => 0, optional => 0 }; | |||||||||||||||||||||||
| 60 | 1 | return; | |||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||
| 63 | # The assignment of one value to a lexical scalar, whose target is the op's own pad entry. | ||||||||||||||||||||||||
| 64 | 49 | ▶ | sub _on_padsv_store { | ||||||||||||||||||||||
|
Subroutine
_on_padsv_store: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||
| 65 | 49 | my ( $self, $op ) = @_; | |||||||||||||||||||||||
| 66 | 49 | my ($value) = $self->op_kids($op); | |||||||||||||||||||||||
| 67 | 49 | ▶ | return unless $value; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 68 | 49 | $self->_assign_from_args( $value, $self->_padname( $op->targ ) ); | |||||||||||||||||||||||
| 69 | 49 | return; | |||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||
| 72 | # The value of an assignment is the value assigned. | ||||||||||||||||||||||||
| 73 | 0 | ▶ | sub _classify_padsv_store { | ||||||||||||||||||||||
|
Subroutine
_classify_padsv_store: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||
| 74 | 0 | my ( $self, $op ) = @_; | |||||||||||||||||||||||
| 75 | 0 | my ($value) = $self->op_kids($op); | |||||||||||||||||||||||
| 76 | 0 | ▶ | return { type => 'unknown', op => 'padsv_store' } if !$value; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 77 | 0 | return $self->classify($value); | |||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||
| 80 | 13 | ▶ | sub _classify_emptyavhv { | ||||||||||||||||||||||
|
Subroutine
_classify_emptyavhv: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||
| 81 | 13 | my ( $self, $op ) = @_; | |||||||||||||||||||||||
| 82 | 13 | ▶ | return { type => ( $op->private & B::OPpEMPTYAVHV_IS_HV ) ? 'hashref' : 'arrayref' }; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||
| 85 | 10 | 1; | |||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||
| 87 | __END__ | ||||||||||||||||||||||||