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

filter: Statementstmt 67.3% 35 / 52 Branchbran 31.2% 5 / 16 Conditioncond 60.0% 3 / 5 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 75.0% 9 / 12 Podpod 100% 4 / 4 totaltotal 62.6% 57 / 91 CC 12 SCAR 19.3
CC
12
Cov
59%
finish_sub
20.0
default_mode
12.0
_classify_padsv_store
6.0
CRAP 6.9
« lib/Pod/Coverage/More/Declared/TypeParams.pm ↑ Summary lib/Pod/Coverage/More/Documentation.pm »
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.003;
5  
6 14 ▶use 5.036;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 14 ▶use warnings FATAL => q{all};
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 14 ▶use B ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 14 ▶use parent 'Pod::Coverage::More::Analyzer::Perl5_36';
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 return {
17 25 %{ $self->SUPER::op_handlers() },
18 padsv_store => \&_on_padsv_store,
19 };
20 }
21  
22 25 ▶sub op_classifiers {
Subroutine op_classifiers: called CC=1 SCAR=0.0
Pod documented
23 25 my ($self) = @_;
24 return {
25 25 %{ $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
BranchTrueFalseTotal
if $argdefelem->private & 128 0 0 0
34 0 ▶ return '||=' if $argdefelem->private & B::OPpARG_IF_FALSE;
Branch: 1 branch
BranchTrueFalseTotal
if $argdefelem->private & 64 0 0 0
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
BranchTrueFalseTotal
unless $self->{"cv"}->CvFLAGS & 1048576 0 0 0
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
BranchTrueFalseTotal
if $param->{"source"} eq "signature" 0 0 0
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'
!ll&&!rl&&r
201
$_->{"name"} // ""
l!l
10
MC/DC50%1/2
$_->{'index'} == 0 && ($_->{'name'} // '') eq '$self'
$_->{'index'} == 0 $_->{"name"}
Truth table66%2/3
A && B
A= $_->{'index'} == 0B= $_->{"name"}
ABresult
0X0
100
111
55 2 ▶ if ($invocant) {
Branch: 1 branch
BranchTrueFalseTotal
if ($invocant) 1 1 2
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 53 ▶sub _on_padsv_store {
Subroutine _on_padsv_store: called CC=2 SCAR=7.0
65 53 my ( $self, $op ) = @_;
66 53 my ($value) = $self->op_kids($op);
67 53 ▶ return unless $value;
Branch: 1 branch
BranchTrueFalseTotal
unless $value 0 53 53
68 53 $self->_assign_from_args( $value, $self->_padname( $op->targ ) );
69 53 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
BranchTrueFalseTotal
unless $value 0 0 0
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
BranchTrueFalseTotal
$op->private & 32 ? : 6 7 13
83 }
84  
85 14 1;
86  
87 __END__
« lib/Pod/Coverage/More/Declared/TypeParams.pm ↑ Summary lib/Pod/Coverage/More/Documentation.pm »