lib/Pod/Coverage/More/Analyzer.pm

filter: Statementstmt 95.8% 672 / 701 Branchbran 80.1% 356 / 444 Conditioncond 67.8% 209 / 308 MC/DCmcdc 42.6% 75 / 176 Subroutinesub 96.4% 82 / 85 Podpod 100% 9 / 9 totaltotal 81.4% 1403 / 1723 CC 353 SCAR 26.7
CC
353
Cov
85%
_classify_refgen
72.0
classify
42.2
_last_values
32.6
CRAP 14.4
« lib/Pod/Coverage/More/Analyzer/Perl5_36.pm ↑ Summary lib/Pod/Coverage/More/Types.pm »
1 # ABSTRACT: Infer arguments, return values and termination of subs from their compiled op trees
2 # PODNAME: Pod::Coverage::More::Analyzer
3  
4 package Pod::Coverage::More::Analyzer 0.005;
5  
6 19 ▶use 5.036;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 19 ▶use warnings FATAL => q{all};
Subroutine BEGIN: called CC=1 SCAR=0.0
8 19 ▶use re q{/xsaa};
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 19 ▶use B ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 19 ▶use List::Util qw{any};
Subroutine BEGIN: called CC=1 SCAR=0.0
12 19 ▶use Module::Runtime qw{require_module module_notional_filename};
Subroutine BEGIN: called CC=1 SCAR=0.0
13 19 ▶use Package::Stash;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 19 ▶use Pod::Coverage::More::Declared;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 19 ▶use Pod::Coverage::More::Types qw{type_of_value type_of_usage type_named};
Subroutine BEGIN: called CC=1 SCAR=0.0
17 19 ▶use Scalar::Util qw{blessed};
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 # The pad and SV helpers return an explicit undef because their callers put them in hash constructors,
20 # where a bare return would give an empty list and shift every pair after it.
21  
22  
23 # Lowest perl version of each version set, highest first.
24 19 our @BACKENDS = (
25 [ 5.044 => 'Pod::Coverage::More::Analyzer::Perl5_44' ],
26 [ 5.038 => 'Pod::Coverage::More::Analyzer::Perl5_38' ],
27 [ 5.036 => 'Pod::Coverage::More::Analyzer::Perl5_36' ],
28 );
29  
30 # The ops whose names say what kind of value they read or produce.
31 19 our %NUMERIC_OPS = map { $_ => 1 } qw{
32 add subtract multiply divide modulo pow negate abs int sqrt
33 lt gt le ge eq ne ncmp preinc predec postinc postdec
34 i_add i_subtract i_multiply i_divide i_modulo i_negate
35 i_lt i_gt i_le i_ge i_eq i_ne i_ncmp i_preinc i_predec i_postinc i_postdec
36 };
37 19 our %STRING_OPS = map { $_ => 1 } qw{
38 concat multiconcat seq sne slt sgt sle sge scmp
39 lc uc lcfirst ucfirst length substr index rindex match subst split
40 };
41 19 our %TERMINATORS = map { $_ => 1 } qw{
42 CORE::GLOBAL::die CORE::GLOBAL::exit
43 Carp::croak Carp::confess
44 POSIX::_exit
45 };
46  
47 # Methods that die by their contract: an exception class's throw, and the fatal level of a logger, as
48 # Log::Dispatchouli and so Dist::Zilla's log_fatal, and Log::Log4perl's logdie, logcroak and logconfess.
49 19 our %TERMINATING_METHODS = map { $_ => 1 } qw{throw log_fatal logdie logcroak logconfess};
50 19 our %BOOLEAN_OPS = map { $_ => 1 } qw{
51 not defined exists
52 lt gt le ge eq ne i_lt i_gt i_le i_ge i_eq i_ne
53 slt sgt sle sge seq sne
54 };
55  
56 # The ops whose result is always a whole number.
57 19 our %INTEGER_OPS = map { $_ => 1 } qw{
58 index rindex scmp time
59 i_add i_subtract i_multiply i_divide i_modulo i_negate i_ncmp
60 };
61  
62 # The ops whose result is a whole number or undef: length of undef, and <=> of NaN.
63 19 our %MAYBE_INTEGER_OPS = map { $_ => 1 } qw{length ncmp};
64  
65 # The classes that the numbers of the scope of each bignum pragma are, by its key in %^H.
66 19 our %BIG_CLASSES = (
67 bigint => ['Math::BigInt'],
68 bignum => [ 'Math::BigInt', 'Math::BigFloat' ],
69 bigrat => ['Math::BigRat'],
70 bigfloat => ['Math::BigFloat'],
71 );
72 19 our %NUMBER_OPS = map { $_ => 1 } qw{
73 add subtract multiply divide modulo pow negate abs int sqrt ncmp scmp
74 i_add i_subtract i_multiply i_divide i_modulo i_negate i_ncmp
75 length index rindex time
76 };
77 19 our %STRING_RESULT_OPS = map { $_ => 1 } qw{
78 concat multiconcat stringify join sprintf lc uc lcfirst ucfirst substr ref
79 };
80 19 our %LIST_OPS = map { $_ => 1 } qw{ sort grepwhile mapwhile keys values reverse split };
81 19 our $HELEM = B::opnumber(q{helem});
82 19 our @HASH_MDEREF_ACTIONS = (
83 B::MDEREF_HV_pop_rv2hv_helem(), B::MDEREF_HV_gvsv_vivify_rv2hv_helem(),
84 B::MDEREF_HV_padsv_vivify_rv2hv_helem(), B::MDEREF_HV_vivify_rv2hv_helem(),
85 B::MDEREF_HV_padhv_helem(), B::MDEREF_HV_gvhv_helem(),
86 );
87  
88  
89 # An analyzer of the subclass that handles the running perl.
90 # @returns Object the analyzer, an instance of that subclass
91 # @throws when the running perl is older than the oldest supported version set
92 # @example my $analyzer = Pod::Coverage::More::Analyzer->new;
93 28 ▶sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod documented
94 28 my ($class) = @_;
95 28 ▶ my $backend = $class eq __PACKAGE__ ? backend_for($]) : $class;
Branch: 1 branch
BranchTrueFalseTotal
$class eq __PACKAGE__ ? : 28 0 28
96 28 ▶ require_module($backend) if $backend ne $class;
Branch: 1 branch
BranchTrueFalseTotal
if $backend ne $class 28 0 28
97 28 return bless( { never_returns => {} }, $backend );
98 }
99  
100 # The subclass that handles the perl C<version>.
101 # @param version Num in the numeric form of C<$]>
102 # @returns Str the name of the subclass
103 # @throws when no subclass handles the version
104 # @example my $backend = Pod::Coverage::More::Analyzer::backend_for($]);
105 37 ▶sub backend_for {
Subroutine backend_for: called CC=3 SCAR=11.0
Pod documented
106 37 my ($version) = @_;
107 37 foreach my $backend (@BACKENDS) {
108 47 ▶ return $backend->[1] if $version >= $backend->[0];
Branch: 1 branch
BranchTrueFalseTotal
if $version >= $backend->[0] 35 12 47
109 }
110 2 die "Perl $version is not supported, the oldest supported perl is $BACKENDS[-1][0]\n";
111 }
112  
113 # The records of the subs that C<package> defines, as C<analyze_sub> returns them.
114 # The package must be loaded already. Subs that it imported from another package are left out.
115 #
116 # When a class builder or a signature module declares a sub, as L<Pod::Coverage::More::Declared> reads it,
117 # its record also has C<declared>: that declaration, with C<wrapped> in place of its C<body>,
118 # and each parameter that a declared one matches has C<declared>, the declared L<Type::Tiny> constraint.
119 # The record of a sub that only wraps the code that does the work describes that code.
120 # @param package Str the name of the package
121 # @returns HashRef from the name of each sub to its record
122 # @example my $records = $analyzer->analyze_package('Pod::Coverage::More');
123 44 ▶sub analyze_package {
Subroutine analyze_package: called CC=7 SCAR=19.5
Pod documented
124 44 my ( $self, $package ) = @_;
125  
126 44 my $stash = Package::Stash->new($package);
127 44 my %code;
128 44 foreach my $name ( $stash->list_all_symbols(q{CODE}) ) {
129 509 my $code = $stash->get_symbol("&$name");
130 509 ▶ $code{$name} = $code if _defined_in( B::svref_2object($code) ) eq $package;
Branch: 1 branch
BranchTrueFalseTotal
if _defined_in(B::svref_2object($code)) eq $package 442 67 509
131 }
132  
133 44 my $declared = Pod::Coverage::More::Declared->declarations_for( $package, [ sort keys %code ] );
134 44 my %subs;
135 44 foreach my $name ( sort keys %code ) {
136 442 my $declaration = $declared->{$name};
137 442 ▶ my $body = $declaration ? $declaration->{body} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$declaration ? : 23 419 442
138 442 ▶ $subs{$name} = $self->analyze_sub( $body // $code{$name}, $name, $package );
Condition66%2/3
$body // $code{$name}
l!l&&r!l&&!r
34390
MC/DC0%0/2
$body // $code{$name}
$body $code{$name}
Truth table66%2/3
A // B
A= $bodyB= $code{$name}
ABresult
1X1
011
000
139 442 ▶ _attach_declaration( $subs{$name}, $declaration ) if $declaration;
Branch: 1 branch
BranchTrueFalseTotal
if $declaration 23 419 442
140 }
141 44 return \%subs;
142 }
143  
144 # Records DECLARATION on the record REC, and the declared type of each parameter on the parameter that it matches:
145 # by name, or else by position. The invocant is never matched, because a class builder and the code number it differently.
146 23 ▶sub _attach_declaration {
Subroutine _attach_declaration: called CC=12 SCAR=24.9
147 23 my ( $rec, $declaration ) = @_;
148 23 my %declared = %$declaration;
149 23 ▶ $declared{wrapped} = delete( $declared{body} ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
delete $declared{'body'} ? : 3 20 23
150 23 $rec->{declared} = \%declared;
151  
152 23 foreach my $param ( @{ $rec->{params} } ) {
153 20 foreach my $candidate ( @{ $declaration->{params} } ) {
154 37 ▶ next if $candidate->{invocant} || !$candidate->{type};
Branch: 1 branch
BranchTrueFalseTotal
if $candidate->{"invocant"} or not $candidate->{"type"} 16 21 37
Condition100%3/3
$candidate->{"invocant"} or not $candidate->{"type"}
l!l&&r!l&&!r
12421
MC/DC100%2/2
$candidate->{"invocant"} or not $candidate->{"type"}
$candidate->{"invocant"} not $candidate->{"type"}
Truth table100%3/3
A or not(B)
A= $candidate->{"invocant"}B= not $candidate->{"type"}
ABresult
1X1
011
000
155 21 ▶ my $by_name = defined $candidate->{name} && defined $param->{name} && $candidate->{name} eq $param->{name};
Condition83%5/6
defined $candidate->{'name'} && defined $param->{'name'} && $candidate->{'name'} eq $param->{'name'}
!ll&&!rl&&r
1344
defined $candidate->{"name"} and defined $param->{"name"}
!ll&&!rl&&r
1308
MC/DC66%2/3
defined $candidate->{'name'} && defined $param->{'name'} && $candidate->{'name'} eq $param->{'name'}
defined $candidate->{"name"} defined $param->{"name"} $candidate->{'name'} eq $param->{'name'}
Truth table75%3/4
A and B && C
A= defined $candidate->{"name"}B= defined $param->{"name"}C= $candidate->{'name'} eq $param->{'name'}
ABCresult
0XX0
10X0
1100
1111
156 21 ▶ my $by_position = !defined $candidate->{name} && defined $candidate->{index} && $candidate->{index} == $param->{index};
Condition100%6/6
!defined($candidate->{'name'}) && defined $candidate->{'index'} && $candidate->{'index'} == $param->{'index'}
!ll&&!rl&&r
1524
not defined $candidate->{"name"} and defined $candidate->{"index"}
!ll&&!rl&&r
876
MC/DC100%3/3
!defined($candidate->{'name'}) && defined $candidate->{'index'} && $candidate->{'index'} == $param->{'index'}
not defined $candidate->{"name"} defined $candidate->{"index"} $candidate->{'index'} == $param->{'index'}
Truth table100%4/4
not(A) and B && C
A= not defined $candidate->{"name"}B= defined $candidate->{"index"}C= $candidate->{'index'} == $param->{'index'}
ABCresult
0XX0
10X0
1100
1111
157 21 ▶ next if !$by_name && !$by_position;
Branch: 1 branch
BranchTrueFalseTotal
unless $by_name or $by_position 13 8 21
Condition100%3/3
$by_name or $by_position
l!l&&r!l&&!r
4413
MC/DC100%2/2
$by_name or $by_position
$by_name $by_position
Truth table100%3/3
A or B
A= $by_nameB= $by_position
ABresult
1X1
011
000
158 8 $param->{declared} = $candidate->{type};
159 8 $param->{declared_by} = $declaration->{via};
160 8 last;
161 }
162 }
163 23 return;
164 }
165  
166  
167 # The record of what the op tree of C<code> shows, as RECORDS describes it.
168 # @param code CodeRef the sub
169 # @param name Str the name of the sub
170 # @param package Str the package that the sub belongs to
171 # @returns HashRef the record
172 # @example my $record = $analyzer->analyze_sub( \&Pod::Coverage::More::coverage, 'coverage', 'Pod::Coverage::More' );
173 471 ▶sub analyze_sub {
Subroutine analyze_sub: called CC=19 SCAR=29.5
Pod documented
174 471 my ( $self, $code, $name, $package ) = @_;
175  
176 471 my $cv = B::svref_2object($code);
177 471 my %rec = (
178 name => $name,
179 package => $package,
180 file => $cv->FILE,
181 generated => _is_generated( $cv, $name, $package ),
182 method => 0,
183 signature => 0,
184 reads_args => 0,
185 params => [],
186 usage => {},
187 returns => [],
188 dies => [],
189 ends_in => [],
190 );
191  
192 471 ▶ if ( $cv->CvFLAGS & B::CVf_CONST ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cv->CvFLAGS & 4) 6 465 471
193 6 $rec{kind} = 'constant';
194 6 $rec{value} = $code->();
195 6 my $returned = _sv_evidence( B::svref_2object( \$rec{value} ) );
196 6 push @{ $rec{returns} }, { %$returned, constraint => type_of_value($returned) };
197 6 return \%rec;
198 }
199 465 ▶ if ( $cv->XSUB ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cv->XSUB) 7 458 465
200 7 $rec{kind} = 'xs';
201 7 return \%rec;
202 }
203 458 $rec{kind} = 'perl';
204  
205 # The state of one walk lives on a copy of the analyzer, which shares its caches.
206 458 ▶ $self->{handlers} //= $self->op_handlers;
Condition66%2/3
$self->{"handlers"} //= $self->op_handlers
l!l&&r!l&&!r
431270
MC/DC0%0/2
$self->{"handlers"} //= $self->op_handlers
$self->{"handlers"} $self->op_handlers
Truth table66%2/3
A //= B
A= $self->{"handlers"}B= $self->op_handlers
ABresult
1X1
011
000
207 458 ▶ $self->{classifiers} //= $self->op_classifiers;
Condition66%2/3
$self->{"classifiers"} //= $self->op_classifiers
l!l&&r!l&&!r
431270
MC/DC0%0/2
$self->{"classifiers"} //= $self->op_classifiers
$self->{"classifiers"} $self->op_classifiers
Truth table66%2/3
A //= B
A= $self->{"classifiers"}B= $self->op_classifiers
ABresult
1X1
011
000
208 458 my $walker = bless {
209 %$self,
210 cv => $cv,
211 rec => \%rec,
212 shifted => 0,
213 consumed => {},
214 line_of => {},
215 line => undef,
216 signature => undef,
217 checkers => {},
218 guards => {},
219 big => undef,
220 big_of => {},
221 },
222 ref $self;
223  
224 458 $walker->_walk( $cv->ROOT, [] );
225 458 push @{ $rec{returns} }, map { +{ %$_, implicit => 1 } } $walker->_implicit_returns( $cv->ROOT );
226 458 $walker->finish_sub( \%rec );
227 458 ▶ $rec{never_returns} = ( !@{ $rec{returns} } && any { !$_->{caught} } @{ $rec{dies} }, @{ delete $rec{ends_in} } ) ? 1 : 0;
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
!@{$rec{'returns'};} && &any(sub { not $_->{'caught'}; } , @{$rec{'dies'};}, @{delete $rec{'ends_in'};}) ? : 36 422 458
Condition66%2/3
not @{$rec{"returns"};} and &any(sub { not $_->{"caught"}; } , @{$rec{"dies"};}, @{delete $rec{"ends_in"};})
!ll&&!rl&&r
422036
MC/DC50%1/2
not @{$rec{"returns"};} and &any(sub { not $_->{"caught"}; } , @{$rec{"dies"};}, @{delete $rec{"ends_in"};})
not @{$rec{"returns"};} &any(sub { not $_->{"caught"}; } , @{$rec{"dies"};}, @{delete $rec{"ends_in"};})
Truth table66%2/3
not(A) and B
A= not @{$rec{"returns"};}B= &any(sub { not $_->{"caught"}; } , @{$rec{"dies"};}, @{delete $rec{"ends_in"};})
ABresult
0X0
100
111
228  
229 # A class taken from the invocant is the package or a subclass, and an object of either is an instance of the package.
230 458 ▶ my ($invocant) = grep { $_->{index} == 0 && defined $_->{name} } @{ $rec{params} };
Condition100%3/3
$_->{'index'} == 0 && defined $_->{'name'}
!ll&&!rl&&r
22633306
MC/DC100%2/2
$_->{'index'} == 0 && defined $_->{'name'}
$_->{'index'} == 0 defined $_->{'name'}
Truth table100%3/3
A && B
A= $_->{'index'} == 0B= defined $_->{'name'}
ABresult
0X0
100
111
231 458 foreach my $returned ( @{ $rec{returns} } ) {
232 $returned->{class} //= $package
233 483 ▶ if $invocant && $returned->{type} eq 'object' && ( $returned->{class_from} // q{} ) eq $invocant->{name};
Branch: 1 branch
BranchTrueFalseTotal
if $invocant and $returned->{"type"} eq "object" and ($returned->{"class_from"} // "") eq $invocant->{"name"} 6 477 483
Condition81%9/11
$invocant and $returned->{"type"} eq "object" and ($returned->{"class_from"} // "") eq $invocant->{"name"}
!ll&&!rl&&r
47076
$invocant and $returned->{"type"} eq "object"
!ll&&!rl&&r
16031013
$returned->{"class_from"} // ""
l!l
85
$returned->{"class"} //= $package
l!l&&r!l&&!r
060
MC/DC100%3/3
$invocant and $returned->{"type"} eq "object" and ($returned->{"class_from"} // "") eq $invocant->{"name"}
$invocant $returned->{"type"} eq "object" $returned->{"class_from"}
MC/DC0%0/2
$returned->{"class"} //= $package
$returned->{"class"} $package
Truth table100%4/4
A and B and C
A= $invocantB= $returned->{"type"} eq "object"C= $returned->{"class_from"}
ABCresult
0XX0
10X0
1100
1111
Truth table33%1/3
A //= B
A= $returned->{"class"}B= $package
ABresult
1X1
011
000
234 483 $returned->{constraint} = type_of_value($returned);
235 }
236 458 @{ $rec{params} } = sort { $a->{index} <=> $b->{index} } @{ $rec{params} };
237 458 foreach my $param ( @{ $rec{params} } ) {
238 565 ▶ next unless defined $param->{name};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $param->{"name"} 76 489 565
239 489 my $keys = $rec{usage}{ $param->{name} }{keys};
240 489 ▶ $param->{keys} = [@$keys] if $keys;
Branch: 1 branch
BranchTrueFalseTotal
if $keys 74 415 489
241 489 ▶ $param->{inferred} = type_of_usage( $rec{usage}{ $param->{name} } || {} );
Condition50%1/2
$rec{'usage'}{$param->{'name'}} || {}
l!l
4890
MC/DC0%0/1
$rec{'usage'}{$param->{'name'}} || {}
$rec{'usage'}{$param->{'name'}}
Truth table50%1/2
A
A= $rec{'usage'}{$param->{'name'}}
Aresult
11
00
242 489 ▶ if ( my $guard = $walker->{guards}{ $param->{name} } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $guard = $walker->{"guards"}{$param->{"name"}}) 20 469 489
243 20 $param->{declared} = $guard->{type};
244 20 $param->{declared_by} = $guard->{by};
245 }
246 }
247 458 return \%rec;
248 }
249  
250 # Called once the op tree of a sub was walked, before the parameters are sorted.
251 # Subclasses override it to add what only the whole tree shows. The default does nothing.
252 # @param record HashRef the record of the sub, as RECORDS describes it
253 # @returns nothing
254 # @example $walker->finish_sub( \%record );
255 0 ▶sub finish_sub {
Subroutine finish_sub: not called CC=1 SCAR=6.9
Pod documented
256 0 return;
257 }
258  
259 # The methods that the walk calls for each op, with the op and the ARRAYREF of its ancestors, nearest last.
260 # Subclasses add the ops of their version set to what this returns.
261 # @returns HashRef from the name of each op to the name of its method
262 # @example my $handlers = $analyzer->op_handlers;
263 27 ▶sub op_handlers {
Subroutine op_handlers: called CC=1 SCAR=0.0
Pod documented
264 return {
265 27 nextstate => \&_on_cop,
266 dbstate => \&_on_cop,
267 sassign => \&_on_sassign,
268 aassign => \&_on_aassign,
269 shift => \&_on_shift,
270 aelemfast => \&_on_aelemfast,
271 padsv => \&_on_pad,
272 padav => \&_on_pad,
273 padhv => \&_on_pad,
274 rv2av => \&_on_rv2av,
275 multideref => \&_on_multideref,
276 helem => \&_on_helem,
277 exists => \&_on_exists,
278 delete => \&_on_exists,
279 entersub => \&_on_entersub,
280 return => \&_on_return,
281 die => \&_on_die,
282 exit => \&_on_die,
283 };
284 }
285  
286 # The methods that C<classify> calls for some ops, ahead of its own rules.
287 # Subclasses add the value-producing ops of their version set here, as they add walk handlers in C<op_handlers>.
288 # The default has none.
289 # @returns HashRef from the name of each op to the name of its method
290 # @example my $classifiers = $analyzer->op_classifiers;
291 27 ▶sub op_classifiers {
Subroutine op_classifiers: called CC=1 SCAR=0.0
Pod documented
292 27 return {};
293 }
294  
295 # The kids of C<op>, in order, for the handlers of subclasses.
296 # @param op B::OP the op
297 # @returns the kids, as a list of B::OP objects
298 # @example my @kids = $self->op_kids($op);
299 9188 ▶sub op_kids {
Subroutine op_kids: called CC=1 SCAR=0.0
Pod documented
300 9188 my ( undef, $op ) = @_;
301 9188 return _kids($op);
302 }
303  
304 # Whether something other than the source of PACKAGE wrote the sub: a closure installed under another name,
305 # a string eval, or a sub compiled in another file, as a class builder compiles accessors.
306 471 ▶sub _is_generated {
Subroutine _is_generated: called CC=5 SCAR=16.1
307 471 my ( $cv, $name, $package ) = @_;
308 471 ▶ return 1 if $cv->GV->NAME ne $name || $cv->FILE =~ m/\A\(eval/;
Branch: 1 branch
BranchTrueFalseTotal
if $cv->GV->NAME ne $name or $cv->FILE =~ /\A\(eval/aasx 8 463 471
Condition100%3/3
$cv->GV->NAME ne $name or $cv->FILE =~ /\A\(eval/aasx
l!l&&r!l&&!r
35463
MC/DC100%2/2
$cv->GV->NAME ne $name or $cv->FILE =~ /\A\(eval/aasx
$cv->GV->NAME ne $name $cv->FILE =~ /\A\(eval/aasx
Truth table100%3/3
A or B
A= $cv->GV->NAME ne $nameB= $cv->FILE =~ /\A\(eval/aasx
ABresult
1X1
011
000
309 463 my $own = $INC{ module_notional_filename($package) };
310 463 ▶ return ( defined $own && $cv->FILE ne $own ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $own && $cv->FILE ne $own ? : 38 425 463
Condition66%2/3
defined $own and $cv->FILE ne $own
!ll&&!rl&&r
042538
MC/DC50%1/2
defined $own and $cv->FILE ne $own
defined $own $cv->FILE ne $own
Truth table66%2/3
A and B
A= defined $ownB= $cv->FILE ne $own
ABresult
0X0
100
111
311 }
312  
313 # The package the sub was compiled in, as opposed to the one it was imported into.
314 509 ▶sub _defined_in {
Subroutine _defined_in: called CC=2 SCAR=7.0
315 509 my ($cv) = @_;
316 509 my $gv = $cv->GV;
317 509 ▶ return '' if B::class($gv) ne 'GV';
Branch: 1 branch
BranchTrueFalseTotal
if B::class($gv) ne "GV" 0 509 509
318 509 return $gv->STASH->NAME;
319 }
320  
321 # These subs walk an op tree, which is as deep as the nesting of the source, and so recursion is their natural form.
322 ## no critic (Subroutines::ProhibitTailRecursion)
323  
324 9056 ▶sub _walk {
Subroutine _walk: called CC=5 SCAR=16.1
325 9056 my ( $self, $op, $ancestors ) = @_;
326 9056 ▶ return if !$$op;
Branch: 1 branch
BranchTrueFalseTotal
unless $$op 0 9056 9056
327  
328 9056 $self->{line_of}{$$op} = $self->{line};
329 9056 $self->{big_of}{$$op} = $self->{big};
330  
331 9056 my $handler = $self->{handlers}{ $op->name };
332 9056 ▶ $self->$handler( $op, $ancestors ) if $handler;
Branch: 1 branch
BranchTrueFalseTotal
if $handler 3561 5495 9056
333  
334 9056 my @kids = $self->op_kids($op);
335 9056 ▶ return unless @kids;
Branch: 1 branch
BranchTrueFalseTotal
unless @kids 4664 4392 9056
336 4392 push @$ancestors, $op;
337 4392 foreach my $kid (@kids) {
338 8598 $self->_walk( $kid, $ancestors );
339 }
340 4392 pop @$ancestors;
341 4392 return;
342 }
343  
344 # The values a sub returns when control reaches its end without a return statement.
345 976 ▶sub _last_values {
Subroutine _last_values: called CC=27 SCAR=34.9
346 976 my ( $self, $op ) = @_;
347 976 ▶ return () if !$op || !$$op;
Branch: 1 branch
BranchTrueFalseTotal
unless $op and $$op 0 976 976
Condition33%1/3
$op and $$op
!ll&&!rl&&r
00976
MC/DC0%0/2
$op and $$op
$op $$op
Truth table33%1/3
A and B
A= $opB= $$op
ABresult
0X0
100
111
348 976 my $name = $op->name;
349  
350 976 ▶ if ( $name eq 'lineseq' || $name eq 'scope' || $name eq 'leave' || $name eq 'null' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "lineseq" or $name eq "scope" or $name eq "leave" or $name eq "null") 498 478 976
Condition88%8/9
$name eq "lineseq" or $name eq "scope" or $name eq "leave" or $name eq "null"
l!l&&r!l&&!r
46335478
$name eq "lineseq" or $name eq "scope" or $name eq "leave"
l!l&&r!l&&!r
45310513
$name eq "lineseq" or $name eq "scope"
l!l&&r!l&&!r
4530523
MC/DC75%3/4
$name eq "lineseq" or $name eq "scope" or $name eq "leave" or $name eq "null"
$name eq "lineseq" $name eq "scope" $name eq "leave" $name eq "null"
Truth table80%4/5
A or B or C or D
A= $name eq "lineseq"B= $name eq "scope"C= $name eq "leave"D= $name eq "null"
ABCDresult
1XXX1
01XX1
001X1
00011
00000
351 498 my @kids;
352 498 foreach my $kid ( _significant_kids($op) ) {
353 1887 ▶ push @kids, $kid unless $kid->name eq 'nextstate' || $kid->name eq 'dbstate' || $kid->name eq 'enter';
Branch: 1 branch
BranchTrueFalseTotal
unless $kid->name eq "nextstate" or $kid->name eq "dbstate" or $kid->name eq "enter" 998 889 1887
Condition83%5/6
$kid->name eq "nextstate" or $kid->name eq "dbstate" or $kid->name eq "enter"
l!l&&r!l&&!r
87910998
$kid->name eq "nextstate" or $kid->name eq "dbstate"
l!l&&r!l&&!r
87901008
MC/DC66%2/3
$kid->name eq "nextstate" or $kid->name eq "dbstate" or $kid->name eq "enter"
$kid->name eq "nextstate" $kid->name eq "dbstate" $kid->name eq "enter"
Truth table75%3/4
A or B or C
A= $kid->name eq "nextstate"B= $kid->name eq "dbstate"C= $kid->name eq "enter"
ABCresult
1XX1
01X1
0011
0000
354 }
355 498 ▶ return () if !@kids && $name ne 'null';
Branch: 1 branch
BranchTrueFalseTotal
if not @kids and $name ne "null" 0 498 498
Condition33%1/3
not @kids and $name ne "null"
!ll&&!rl&&r
49800
MC/DC0%0/2
not @kids and $name ne "null"
not @kids $name ne "null"
Truth table33%1/3
not(A) and B
A= not @kidsB= $name ne "null"
ABresult
0X0
100
111
356 498 ▶ return $self->classify($op) if !@kids;
Branch: 1 branch
BranchTrueFalseTotal
unless @kids 0 498 498
357  
358 # A null op that wraps one expression is that expression.
359 498 ▶ return $self->_last_values( $kids[-1] ) if $name ne 'null' || @kids == 1;
Branch: 1 branch
BranchTrueFalseTotal
if $name ne "null" or @kids == 1 498 0 498
Condition66%2/3
$name ne "null" or @kids == 1
l!l&&r!l&&!r
463350
MC/DC0%0/2
$name ne "null" or @kids == 1
$name ne "null" @kids == 1
Truth table66%2/3
A or B
A= $name ne "null"B= @kids == 1
ABresult
1X1
011
000
360 0 return $self->classify($op);
361 }
362 478 ▶ if ( $name eq 'cond_expr' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "cond_expr") 10 468 478
363 10 my $line = $self->{line_of}{$$op};
364 10 my @values;
365 10 foreach my $branch ( ( _branches($op) )[ 1, 2 ] ) {
366 20 ▶ push @values, _is_empty_list($branch) ? { type => 'empty', line => $line } : $self->_last_values($branch);
Branch: 1 branch
BranchTrueFalseTotal
_is_empty_list($branch) ? : 2 18 20
367 }
368 10 return @values;
369 }
370 468 ▶ if ( $name eq 'and' || $name eq 'or' || $name eq 'dor' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "and" or $name eq "or" or $name eq "dor") 2 466 468
Condition66%4/6
$name eq "and" or $name eq "or" or $name eq "dor"
l!l&&r!l&&!r
20466
$name eq "and" or $name eq "or"
l!l&&r!l&&!r
20466
MC/DC33%1/3
$name eq "and" or $name eq "or" or $name eq "dor"
$name eq "and" $name eq "or" $name eq "dor"
Truth table50%2/4
A or B or C
A= $name eq "and"B= $name eq "or"C= $name eq "dor"
ABCresult
1XX1
01X1
0011
0000
371  
372 # if (COND) { BODY } without an else: COND's value when the body does not run.
373 2 my ( $cond, $body ) = _kids($op);
374 2 return ( $self->classify($cond), $self->_last_values($body) );
375 }
376 466 ▶ return () if $name eq 'return' || $name eq 'die' || $name eq 'exit' || $name eq 'stub';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "return" or $name eq "die" or $name eq "exit" or $name eq "stub" 427 39 466
Condition77%7/9
$name eq "return" or $name eq "die" or $name eq "exit" or $name eq "stub"
l!l&&r!l&&!r
427039
$name eq "return" or $name eq "die" or $name eq "exit"
l!l&&r!l&&!r
427039
$name eq "return" or $name eq "die"
l!l&&r!l&&!r
4111639
MC/DC50%2/4
$name eq "return" or $name eq "die" or $name eq "exit" or $name eq "stub"
$name eq "return" $name eq "die" $name eq "exit" $name eq "stub"
Truth table60%3/5
A or B or C or D
A= $name eq "return"B= $name eq "die"C= $name eq "exit"D= $name eq "stub"
ABCDresult
1XXX1
01XX1
001X1
00011
00000
377  
378 39 my $line = $self->{line_of}{$$op};
379 39 ▶ return ( { type => 'unknown', op => 'loop', line => $line } ) if $name eq 'leaveloop';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "leaveloop" 0 39 39
380 39 return map { +{ %$_, line => $line } } $self->classify($op);
381 }
382  
383 # The evidence that C<op>, an op that produces a value, gives about that value.
384 # It is one HASHREF per alternative, because an expression such as C<COND ? A : B> has more than one.
385 #
386 # The C<type> of each is one of C<undef>, C<empty>, C<number>, C<string>, C<boolean>, C<hashref>, C<arrayref>, C<coderef>, C<ref>,
387 # C<object>, C<variable>, C<call>, C<method>, C<list>, C<context> or C<unknown>.
388 # @param op B::OP the op that produces the value
389 # @returns the evidence, as a list of HASHREFs
390 # @example my @evidence = $self->classify($op);
391 454 ▶sub classify {
Subroutine classify: called CC=37 SCAR=37.4
Pod documented
392 454 my ( $self, $op ) = @_;
393 454 ▶ return { type => 'empty' } if _is_empty_list($op);
Branch: 1 branch
BranchTrueFalseTotal
if _is_empty_list($op) 6 448 454
394 448 $op = _unwrap($op);
395 448 my $name = $op->name;
396  
397 448 my $classifier = $self->{classifiers}{$name};
398 448 ▶ return $self->$classifier($op) if $classifier;
Branch: 1 branch
BranchTrueFalseTotal
if $classifier 13 435 448
399  
400 435 ▶ return _sv_evidence( $self->_const_sv($op) ) if $name eq 'const';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "const" 102 333 435
401 333 ▶ return { type => 'undef' } if $name eq 'undef';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "undef" 13 320 333
402 320 ▶ return { type => 'hashref' } if $name eq 'anonhash';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "anonhash" 3 317 320
403 317 ▶ return { type => 'arrayref' } if $name eq 'anonlist';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "anonlist" 24 293 317
404 293 ▶ return { type => 'coderef' } if $name eq 'anoncode';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "anoncode" 0 293 293
405 293 ▶ return { type => 'context' } if $name eq 'wantarray';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "wantarray" 0 293 293
406  
407 293 ▶ return $self->_classify_refgen($op) if $name eq 'srefgen' || $name eq 'refgen';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "srefgen" or $name eq "refgen" 0 293 293
Condition33%1/3
$name eq "srefgen" or $name eq "refgen"
l!l&&r!l&&!r
00293
MC/DC0%0/2
$name eq "srefgen" or $name eq "refgen"
$name eq "srefgen" $name eq "refgen"
Truth table33%1/3
A or B
A= $name eq "srefgen"B= $name eq "refgen"
ABresult
1X1
011
000
408 293 ▶ return $self->_classify_bless($op) if $name eq 'bless';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "bless" 21 272 293
409  
410 272 ▶ if ( $name eq 'scalar' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "scalar") 8 264 272
411 8 my ($kid) = _significant_kids($op);
412 8 ▶ return { type => 'unknown', op => $name } if !$kid;
Branch: 1 branch
BranchTrueFalseTotal
unless $kid 0 8 8
413 8 my $kname = _unwrap($kid)->name;
414 8 ▶ return { type => 'number', integer => 1 } if $kname eq 'padav' || $kname eq 'rv2av';
Branch: 1 branch
BranchTrueFalseTotal
if $kname eq "padav" or $kname eq "rv2av" 7 1 8
Condition100%3/3
$kname eq "padav" or $kname eq "rv2av"
l!l&&r!l&&!r
341
MC/DC100%2/2
$kname eq "padav" or $kname eq "rv2av"
$kname eq "padav" $kname eq "rv2av"
Truth table100%3/3
A or B
A= $kname eq "padav"B= $kname eq "rv2av"
ABresult
1X1
011
000
415 1 return $self->classify($kid);
416 }
417 264 ▶ if ( $name eq 'padsv' || $name eq 'padav' || $name eq 'padhv' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "padsv" or $name eq "padav" or $name eq "padhv") 55 209 264
Condition83%5/6
$name eq "padsv" or $name eq "padav" or $name eq "padhv"
l!l&&r!l&&!r
550209
$name eq "padsv" or $name eq "padav"
l!l&&r!l&&!r
523209
MC/DC66%2/3
$name eq "padsv" or $name eq "padav" or $name eq "padhv"
$name eq "padsv" $name eq "padav" $name eq "padhv"
Truth table75%3/4
A or B or C
A= $name eq "padsv"B= $name eq "padav"C= $name eq "padhv"
ABCresult
1XX1
01X1
0011
0000
418 55 return { type => 'variable', name => $self->_padname( $op->targ ) };
419 }
420 209 ▶ if ( $name eq 'sassign' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "sassign") 3 206 209
421 3 my ($value) = _kids($op);
422 3 return $self->classify($value);
423 }
424 206 ▶ if ( $name eq 'cond_expr' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "cond_expr") 33 173 206
425 33 my ( $cond, $then, $else ) = _branches($op);
426  
427 # wantarray ? LIST : SCALAR says which value goes with which context.
428 33 ▶ if ( _unwrap($cond)->name eq 'wantarray' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (_unwrap($cond)->name eq "wantarray") 4 29 33
429 return (
430 4 ( map { +{ %$_, context => 'list' } } $self->classify($then) ),
431 4 ( map { +{ %$_, context => 'scalar' } } $self->classify($else) ),
432 );
433 }
434 29 return ( $self->classify($then), $self->classify($else) );
435 }
436 173 ▶ if ( $name eq 'or' || $name eq 'dor' || $name eq 'and' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "or" or $name eq "dor" or $name eq "and") 0 173 173
Condition33%2/6
$name eq "or" or $name eq "dor" or $name eq "and"
l!l&&r!l&&!r
00173
$name eq "or" or $name eq "dor"
l!l&&r!l&&!r
00173
MC/DC0%0/3
$name eq "or" or $name eq "dor" or $name eq "and"
$name eq "or" $name eq "dor" $name eq "and"
Truth table25%1/4
A or B or C
A= $name eq "or"B= $name eq "dor"C= $name eq "and"
ABCresult
1XX1
01X1
0011
0000
437 0 my @evidence;
438 0 foreach my $kid ( _kids($op) ) {
439 0 push @evidence, $self->classify($kid);
440 }
441 0 return @evidence;
442 }
443 173 ▶ if ( $name eq 'entersub' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "entersub") 50 123 173
444 50 my ($target) = $self->_call_target($op);
445 50 ▶ return { type => 'call' } if !$target;
Branch: 1 branch
BranchTrueFalseTotal
unless $target 0 50 50
446 50 ▶ return if $self->_never_returns($target);
Branch: 1 branch
BranchTrueFalseTotal
if $self->_never_returns($target) 23 27 50
447 27 return $target;
448 }
449 123 ▶ return _weak( { type => 'boolean' } ) if $BOOLEAN_OPS{$name};
Branch: 1 branch
BranchTrueFalseTotal
if $Pod::Coverage::More::Analyzer::BOOLEAN_OPS{$name} 0 123 123
450 123 ▶ if ( $NUMBER_OPS{$name} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Pod::Coverage::More::Analyzer::NUMBER_OPS{$name}) 47 76 123
451  
452 # A return statement classifies its value before the walk reaches it, in the scope of the statement.
453 47 ▶ my $big = exists $self->{big_of}{$$op} ? $self->{big_of}{$$op} : $self->{big};
Branch: 1 branch
BranchTrueFalseTotal
exists $self->{'big_of'}{$$op} ? : 0 47 47
454 47 ▶ return { type => 'object', classes => $big, weak => 1 } if $big;
Branch: 1 branch
BranchTrueFalseTotal
if $big 1 46 47
455 46 ▶ return _weak( { type => 'number', integer => 1 } ) if $INTEGER_OPS{$name};
Branch: 1 branch
BranchTrueFalseTotal
if $Pod::Coverage::More::Analyzer::INTEGER_OPS{$name} 0 46 46
456 46 ▶ return _weak( { type => 'number', integer => 1, maybe_undef => 1 } ) if $MAYBE_INTEGER_OPS{$name};
Branch: 1 branch
BranchTrueFalseTotal
if $Pod::Coverage::More::Analyzer::MAYBE_INTEGER_OPS{$name} 1 45 46
457 45 return _weak( { type => 'number' } );
458 }
459 76 ▶ return _weak( { type => 'string' } ) if $STRING_RESULT_OPS{$name};
Branch: 1 branch
BranchTrueFalseTotal
if $Pod::Coverage::More::Analyzer::STRING_RESULT_OPS{$name} 23 53 76
460 53 ▶ return { type => 'list' } if $LIST_OPS{$name};
Branch: 1 branch
BranchTrueFalseTotal
if $Pod::Coverage::More::Analyzer::LIST_OPS{$name} 8 45 53
461 45 return { type => 'unknown', op => $name };
462 }
463  
464 ## use critic
465  
466 12243 ▶sub _kids {
Subroutine _kids: called CC=4 SCAR=13.9
467 12243 my ($op) = @_;
468 12243 ▶ return () unless $op->flags & B::OPf_KIDS;
Branch: 1 branch
BranchTrueFalseTotal
unless $op->flags & 4 4749 7494 12243
469 7494 my @kids;
470 7494 ▶ for ( my $kid = $op->first; $$kid; $kid = $kid->sibling ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($$kid) 15210 0 15210
471 15210 push @kids, $kid;
472 15210 ▶ last unless $kid->moresib;
Branch: 1 branch
BranchTrueFalseTotal
unless $kid->moresib 7494 7716 15210
473 }
474 7494 return @kids;
475 }
476  
477 # The condition and the two branches of COND ? THEN : ELSE. Perl leaves a branch that is an empty list out of the
478 # op tree, so a missing branch comes back as undef: the one left is THEN when the jump of the op lands in it.
479 56 ▶sub _branches {
Subroutine _branches: called CC=3 SCAR=11.0
480 56 my ($op) = @_;
481 56 my ( $cond, @branches ) = _kids($op);
482 56 ▶ return ( $cond, @branches ) if @branches != 1;
Branch: 1 branch
BranchTrueFalseTotal
if @branches != 1 48 8 56
483 8 ▶ return ( $cond, $branches[0], undef ) if _holds( $branches[0], $op->other );
Branch: 1 branch
BranchTrueFalseTotal
if _holds($branches[0], $op->other) 2 6 8
484 6 return ( $cond, undef, $branches[0] );
485 }
486  
487 # Whether OP is an empty list: a branch that perl left out of the op tree, as 5.44 does with the () of a ternary,
488 # or the stub op that older perls compile it to.
489 474 ▶sub _is_empty_list {
Subroutine _is_empty_list: called CC=2 SCAR=7.1
490 474 my ($op) = @_;
491 474 ▶ return !$op || $op->name eq 'stub';
Condition66%2/3
!$op || $op->name eq 'stub'
l!l&&r!l&&!r
80466
MC/DC50%1/2
!$op || $op->name eq 'stub'
!$op $op->name eq 'stub'
Truth table66%2/3
not(A) || B
A= !$opB= $op->name eq 'stub'
ABresult
1X1
011
000
492 }
493  
494 # Whether TARGET is OP or an op under it.
495 8 ▶sub _holds {
Subroutine _holds: called CC=3 SCAR=11.0
496 8 my ( $op, $target ) = @_;
497 8 my @ops = ($op);
498 8 ▶ while ( my $next = shift @ops ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $next = shift @ops) 12 6 18
499 12 ▶ return 1 if $$next == $$target;
Branch: 1 branch
BranchTrueFalseTotal
if $$next == $$target 2 10 12
500 10 push @ops, _kids($next);
501 }
502 6 return 0;
503 }
504  
505 # Kids that do something, as opposed to list markers and optimized-away ops.
506 2134 ▶sub _significant_kids {
Subroutine _significant_kids: called CC=6 SCAR=17.9
507 2134 my ($op) = @_;
508 2134 my @significant;
509 2134 foreach my $kid ( _kids($op) ) {
510 5156 my $name = $kid->name;
511 5156 ▶ next if $name eq 'pushmark' || $name eq 'padrange';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "pushmark" or $name eq "padrange" 1097 4059 5156
Condition100%3/3
$name eq "pushmark" or $name eq "padrange"
l!l&&r!l&&!r
8702274059
MC/DC100%2/2
$name eq "pushmark" or $name eq "padrange"
$name eq "pushmark" $name eq "padrange"
Truth table100%3/3
A or B
A= $name eq "pushmark"B= $name eq "padrange"
ABresult
1X1
011
000
512 4059 ▶ next if $name eq 'null' && !( $kid->flags & B::OPf_KIDS );
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "null" and not $kid->flags & 4 53 4006 4059
Condition100%3/3
$name eq "null" and not $kid->flags & 4
!ll&&!rl&&r
339361353
MC/DC100%2/2
$name eq "null" and not $kid->flags & 4
$name eq "null" not $kid->flags & 4
Truth table100%3/3
A and not(B)
A= $name eq "null"B= not $kid->flags & 4
ABresult
0X0
100
111
513 4006 push @significant, $kid;
514 }
515 2134 return @significant;
516 }
517  
518 # Unwrap ex-list and similar null ops that have one kid.
519 1521 ▶sub _unwrap {
Subroutine _unwrap: called CC=3 SCAR=11.0
520 1521 my ($op) = @_;
521 1521 ▶ while ( $op->name eq 'null' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($op->name eq "null") 353 1521 1874
522 353 my @kids = _significant_kids($op);
523 353 ▶ last if @kids != 1;
Branch: 1 branch
BranchTrueFalseTotal
if @kids != 1 0 353 353
524 353 $op = $kids[0];
525 }
526 1521 return $op;
527 }
528  
529 1615 ▶sub _padname {
Subroutine _padname: called CC=6 SCAR=18.5
530 1615 my ( $self, $targ ) = @_;
531 1615 ▶ return undef if !$targ;
Branch: 1 branch
BranchTrueFalseTotal
unless $targ 36 1579 1615
532 1579 my $padname = $self->{cv}->PADLIST->ARRAYelt(0)->ARRAYelt($targ);
533 1579 ▶ return undef if !$padname || B::class($padname) eq 'SPECIAL';
Branch: 1 branch
BranchTrueFalseTotal
if not $padname or B::class($padname) eq "SPECIAL" 0 1579 1579
Condition33%1/3
not $padname or B::class($padname) eq "SPECIAL"
l!l&&r!l&&!r
001579
MC/DC0%0/2
not $padname or B::class($padname) eq "SPECIAL"
not $padname B::class($padname) eq "SPECIAL"
Truth table33%1/3
not(A) or B
A= not $padnameB= B::class($padname) eq "SPECIAL"
ABresult
1X1
011
000
534 1579 my $name = $padname->PVX;
535  
536 # The pad entry of a placeholder with a default, as $ = undef, is its sigil alone.
537 1579 ▶ return undef if !defined $name || $name =~ m/\A[\$\@%&]?\z/;
Branch: 1 branch
BranchTrueFalseTotal
if not defined $name or $name =~ /\A[\$\@%&]?\z/aasx 4 1575 1579
Condition66%2/3
not defined $name or $name =~ /\A[\$\@%&]?\z/aasx
l!l&&r!l&&!r
041575
MC/DC50%1/2
not defined $name or $name =~ /\A[\$\@%&]?\z/aasx
not defined $name $name =~ /\A[\$\@%&]?\z/aasx
Truth table66%2/3
not(A) or B
A= not defined $nameB= $name =~ /\A[\$\@%&]?\z/aasx
ABresult
1X1
011
000
538 1575 return $name;
539 }
540  
541 24 ▶sub _padval {
Subroutine _padval: called CC=1 SCAR=0.0
542 24 my ( $self, $index ) = @_;
543 24 return $self->{cv}->PADLIST->ARRAYelt(1)->ARRAYelt($index);
544 }
545  
546 # Under threaded perls, GVs and constants live in the pad instead of the op.
547 669 ▶sub _gv {
Subroutine _gv: called CC=2 SCAR=7.2
548 669 my ( $self, $op ) = @_;
549 669 ▶ return B::class($op) eq 'PADOP' ? $self->_padval( $op->padix ) : $op->gv;
Branch: 1 branch
BranchTrueFalseTotal
B::class($op) eq 'PADOP' ? : 0 669 669
550 }
551  
552 125 ▶sub _const_sv {
Subroutine _const_sv: called CC=2 SCAR=7.0
553 125 my ( $self, $op ) = @_;
554 125 my $sv = $op->sv;
555 125 ▶ $sv = $self->_padval( $op->targ ) unless $$sv;
Branch: 1 branch
BranchTrueFalseTotal
unless $$sv 0 125 125
556 125 return $sv;
557 }
558  
559 318 ▶sub _sv_value {
Subroutine _sv_value: called CC=6 SCAR=19.6
560 318 my ($sv) = @_;
561 318 my $class = B::class($sv);
562 318 ▶ return undef if $class eq 'SPECIAL' || $class eq 'NULL';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "SPECIAL" or $class eq "NULL" 0 318 318
Condition33%1/3
$class eq "SPECIAL" or $class eq "NULL"
l!l&&r!l&&!r
00318
MC/DC0%0/2
$class eq "SPECIAL" or $class eq "NULL"
$class eq "SPECIAL" $class eq "NULL"
Truth table33%1/3
A or B
A= $class eq "SPECIAL"B= $class eq "NULL"
ABresult
1X1
011
000
563 318 my $flags = $sv->FLAGS;
564 318 ▶ return $sv->PV if $flags & B::SVf_POK;
Branch: 1 branch
BranchTrueFalseTotal
if $flags & 1024 231 87 318
565 87 ▶ return $sv->NV if $flags & B::SVf_NOK;
Branch: 1 branch
BranchTrueFalseTotal
if $flags & 512 0 87 87
566 87 ▶ return $sv->IV if $flags & B::SVf_IOK;
Branch: 1 branch
BranchTrueFalseTotal
if $flags & 256 87 0 87
567 0 return undef;
568 }
569  
570 108 ▶sub _sv_evidence {
Subroutine _sv_evidence: called CC=6 SCAR=19.0
571 108 my ($sv) = @_;
572 108 my $class = B::class($sv);
573 108 ▶ return { type => 'undef' } if $class eq 'SPECIAL' || $class eq 'NULL';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "SPECIAL" or $class eq "NULL" 0 108 108
Condition33%1/3
$class eq "SPECIAL" or $class eq "NULL"
l!l&&r!l&&!r
00108
MC/DC0%0/2
$class eq "SPECIAL" or $class eq "NULL"
$class eq "SPECIAL" $class eq "NULL"
Truth table33%1/3
A or B
A= $class eq "SPECIAL"B= $class eq "NULL"
ABresult
1X1
011
000
574 108 my $flags = $sv->FLAGS;
575 108 ▶ return _reference_evidence( $sv->RV ) if $flags & B::SVf_ROK;
Branch: 1 branch
BranchTrueFalseTotal
if $flags & 2048 3 105 108
576 105 ▶ return { type => 'string', value => $sv->PV } if $flags & B::SVf_POK;
Branch: 1 branch
BranchTrueFalseTotal
if $flags & 1024 18 87 105
577 87 ▶ return { type => 'number', value => _sv_value($sv) } if $flags & ( B::SVf_IOK | B::SVf_NOK );
Branch: 1 branch
BranchTrueFalseTotal
if $flags & 768 87 0 87
578 0 return { type => 'undef' };
579 }
580  
581 # The result of an operator is only probable: an operand of a class that overloads the operator,
582 # such as Math::GMP, makes it an object of that class. So its EVIDENCE is weak.
583 69 ▶sub _weak {
Subroutine _weak: called CC=1 SCAR=0.0
584 69 my ($evidence) = @_;
585 69 return { %$evidence, weak => 1 };
586 }
587  
588 # A constant that holds a reference, as use bigint makes of every numeric literal, or use constant of a list.
589 3 ▶sub _reference_evidence {
Subroutine _reference_evidence: called CC=5 SCAR=21.7
590 3 my ($referent) = @_;
591 3 ▶ return { type => 'object', class => $referent->SvSTASH->NAME } if $referent->FLAGS & B::SVs_OBJECT;
Branch: 1 branch
BranchTrueFalseTotal
if $referent->FLAGS & 1048576 2 1 3
592 1 my $class = B::class($referent);
593 1 ▶ return { type => 'arrayref' } if $class eq 'AV';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "AV" 1 0 1
594 0 ▶ return { type => 'hashref' } if $class eq 'HV';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "HV" 0 0 0
595 0 ▶ return { type => 'coderef' } if $class eq 'CV';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "CV" 0 0 0
596 0 return { type => 'ref' };
597 }
598  
599 669 ▶sub _fullname {
Subroutine _fullname: called CC=2 SCAR=7.1
600 669 my ($gv) = @_;
601 669 ▶ return undef if B::class($gv) ne 'GV';
Branch: 1 branch
BranchTrueFalseTotal
if B::class($gv) ne "GV" 0 669 669
602 669 return $gv->STASH->NAME . '::' . $gv->NAME;
603 }
604  
605 # The name of the sub a call goes to, where it was defined rather than where it was imported to,
606 # so that an imported croak reads as Carp::croak.
607 119 ▶sub _sub_fullname {
Subroutine _sub_fullname: called CC=6 SCAR=21.6
608 119 my ($gv) = @_;
609 119 ▶ return undef if B::class($gv) ne 'GV';
Branch: 1 branch
BranchTrueFalseTotal
if B::class($gv) ne "GV" 0 119 119
610 119 my $cv = $gv->CV;
611 119 ▶ if ( $$cv && B::class($cv) eq 'CV' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($$cv and B::class($cv) eq "CV") 119 0 119
Condition33%1/3
$$cv and B::class($cv) eq "CV"
!ll&&!rl&&r
00119
MC/DC0%0/2
$$cv and B::class($cv) eq "CV"
$$cv B::class($cv) eq "CV"
Truth table33%1/3
A and B
A= $$cvB= B::class($cv) eq "CV"
ABresult
0X0
100
111
612 119 my $origin = $cv->GV;
613 119 ▶ return _fullname($origin) if B::class($origin) eq 'GV' && $origin->NAME ne '__ANON__';
Branch: 1 branch
BranchTrueFalseTotal
if B::class($origin) eq "GV" and $origin->NAME ne "__ANON__" 119 0 119
Condition33%1/3
B::class($origin) eq "GV" and $origin->NAME ne "__ANON__"
!ll&&!rl&&r
00119
MC/DC0%0/2
B::class($origin) eq "GV" and $origin->NAME ne "__ANON__"
B::class($origin) eq "GV" $origin->NAME ne "__ANON__"
Truth table33%1/3
A and B
A= B::class($origin) eq "GV"B= $origin->NAME ne "__ANON__"
ABresult
0X0
100
111
614 }
615 0 return _fullname($gv);
616 }
617  
618 504 ▶sub _is_args_array {
Subroutine _is_args_array: called CC=5 SCAR=16.2
619 504 my ( $self, $op ) = @_;
620 504 $op = _unwrap($op);
621 504 ▶ return 0 unless $op->name eq 'rv2av';
Branch: 1 branch
BranchTrueFalseTotal
unless $op->name eq "rv2av" 4 500 504
622 500 my ($gvop) = _kids($op);
623 500 ▶ return 0 unless $gvop && $gvop->name eq 'gv';
Branch: 1 branch
BranchTrueFalseTotal
unless $gvop and $gvop->name eq "gv" 19 481 500
Condition66%2/3
$gvop and $gvop->name eq "gv"
!ll&&!rl&&r
019481
MC/DC50%1/2
$gvop and $gvop->name eq "gv"
$gvop $gvop->name eq "gv"
Truth table66%2/3
A and B
A= $gvopB= $gvop->name eq "gv"
ABresult
0X0
100
111
624 481 my $gv = $self->_gv($gvop);
625 481 ▶ return ( _fullname($gv) // '' ) eq 'main::_';
Condition50%1/2
_fullname($gv) // ""
l!l
4810
MC/DC0%0/1
_fullname($gv) // ""
_fullname($gv)
Truth table50%1/2
A
A= _fullname($gv)
Aresult
11
00
626 }
627  
628 # A shift or pop of @_. With no argument, the op has no kids at all.
629 101 ▶sub _is_args_shift {
Subroutine _is_args_shift: called CC=3 SCAR=11.0
630 101 my ( $self, $op ) = @_;
631 101 $op = _unwrap($op);
632 101 ▶ return 0 unless $op->name eq 'shift';
Branch: 1 branch
BranchTrueFalseTotal
unless $op->name eq "shift" 49 52 101
633 52 my @kids = _kids($op);
634 52 ▶ return 1 if !@kids;
Branch: 1 branch
BranchTrueFalseTotal
unless @kids 51 1 52
635 1 return $self->_is_args_array( $kids[0] );
636 }
637  
638 665 ▶sub _usage_of {
Subroutine _usage_of: called CC=2 SCAR=6.9
639 665 my ( $self, $var ) = @_;
640 665 ▶ return $self->{rec}{usage}{$var} //= {};
Condition100%2/2
$self->{"rec"}{"usage"}{$var} //= {}
l!l
241424
MC/DC100%1/1
$self->{"rec"}{"usage"}{$var} //= {}
$self->{"rec"}{"usage"}{$var}
Truth table100%2/2
A
A= $self->{"rec"}{"usage"}{$var}
Aresult
11
00
641 }
642  
643 585 ▶sub _add_param {
Subroutine _add_param: called CC=8 SCAR=20.8
644 585 my ( $self, %param ) = @_;
645 585 my $params = $self->{rec}{params};
646 585 ▶ return if defined $param{name} && any { ( $_->{name} // '' ) eq $param{name} } @$params;
Subroutine __ANON__: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
if defined $param{"name"} and &any(sub { ($_->{"name"} // "") eq $param{"name"}; } , @$params) 0 585 585
Condition80%4/5
defined $param{"name"} and &any(sub { ($_->{"name"} // "") eq $param{"name"}; } , @$params)
!ll&&!rl&&r
974880
$_->{"name"} // ""
l!l
2607
MC/DC0%0/2
defined $param{"name"} and &any(sub { ($_->{"name"} // "") eq $param{"name"}; } , @$params)
defined $param{"name"} &any(sub { ($_->{"name"} // "") eq $param{"name"}; } , @$params)
MC/DC100%1/1
$_->{"name"} // ""
$_->{"name"}
Truth table66%2/3
A and B
A= defined $param{"name"}B= &any(sub { ($_->{"name"} // "") eq $param{"name"}; } , @$params)
ABresult
0X0
100
111
Truth table100%2/2
A
A= $_->{"name"}
Aresult
11
00
647 585 ▶ return if !defined $param{name} && any { $_->{index} == $param{index} } @$params;
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if not defined $param{"name"} and &any(sub { $_->{"index"} == $param{"index"}; } , @$params) 21 564 585
Condition100%3/3
not defined $param{"name"} and &any(sub { $_->{"index"} == $param{"index"}; } , @$params)
!ll&&!rl&&r
4887621
MC/DC100%2/2
not defined $param{"name"} and &any(sub { $_->{"index"} == $param{"index"}; } , @$params)
not defined $param{"name"} &any(sub { $_->{"index"} == $param{"index"}; } , @$params)
Truth table100%3/3
not(A) and B
A= not defined $param{"name"}B= &any(sub { $_->{"index"} == $param{"index"}; } , @$params)
ABresult
0X0
100
111
648 564 ▶ $param{slurpy} //= ( defined $param{name} && $param{name} =~ m/\A[@%]/ ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $param{'name'} && $param{'name'} =~ /\A[\@%]/aasx ? : 39 499 538
Condition100%5/5
$param{"slurpy"} //= defined $param{"name"} && $param{"name"} =~ /\A[\@%]/aasx ? 1 : 0
l!l
26538
defined $param{"name"} and $param{"name"} =~ /\A[\@%]/aasx
!ll&&!rl&&r
6243739
MC/DC100%1/1
$param{"slurpy"} //= defined $param{"name"} && $param{"name"} =~ /\A[\@%]/aasx ? 1 : 0
$param{"slurpy"}
Truth table100%2/2
A
A= $param{"slurpy"}
Aresult
11
00
649 564 push @$params, \%param;
650 564 return;
651 }
652  
653 1154 ▶sub _on_cop {
Subroutine _on_cop: called CC=3 SCAR=11.0
654 1154 my ( $self, $op ) = @_;
655 1154 $self->{line} = $op->line;
656 1154 ▶ $self->{rec}{line} //= $op->line;
Condition66%2/3
$self->{"rec"}{"line"} //= $op->line
l!l&&r!l&&!r
6964580
MC/DC0%0/2
$self->{"rec"}{"line"} //= $op->line
$self->{"rec"}{"line"} $op->line
Truth table66%2/3
A //= B
A= $self->{"rec"}{"line"}B= $op->line
ABresult
1X1
011
000
657  
658 1154 my $hints = $op->hints_hash->HASH;
659 1154 my ($pragma) = grep { $hints->{$_} } sort keys %BIG_CLASSES;
660 1154 ▶ $self->{big} = $pragma ? $BIG_CLASSES{$pragma} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$pragma ? : 4 1150 1154
661 1154 return;
662 }
663  
664 66 ▶sub _assign_from_args {
Subroutine _assign_from_args: called CC=5 SCAR=16.1
665 66 my ( $self, $value, $target_name ) = @_;
666 66 $value = _unwrap($value);
667 66 ▶ if ( $self->_is_args_shift($value) ) {
Branch: 3 branches
BranchTrueFalseTotal
if ($self->_is_args_shift($value)) { } 20 46 66
elsif ($value->name eq 'aelemfast' and $self->_is_args_elem($value)) { } 7 39 46
elsif (() = $self->_defaulted_elem($value)) { } 7 32 39
668 20 $self->{consumed}{$$value} = 1;
669 20 $self->_add_param( name => $target_name, index => $self->{shifted}++, source => 'shift' );
670 }
671 ▶ elsif ( $value->name eq 'aelemfast' && $self->_is_args_elem($value) ) {
Condition66%2/3
$value->name eq "aelemfast" and $self->_is_args_elem($value)
!ll&&!rl&&r
3907
MC/DC50%1/2
$value->name eq "aelemfast" and $self->_is_args_elem($value)
$value->name eq "aelemfast" $self->_is_args_elem($value)
Truth table66%2/3
A and B
A= $value->name eq "aelemfast"B= $self->_is_args_elem($value)
ABresult
0X0
100
111
672 7 $self->{consumed}{$$value} = 1;
673 7 $self->_add_param( name => $target_name, index => _elem_index($value), source => 'element' );
674 }
675 elsif ( my ( $elem, $default, $mode ) = $self->_defaulted_elem($value) ) {
676 7 $self->{consumed}{$$elem} = 1;
677 7 $self->_add_param(
678 name => $target_name,
679 index => _elem_index($elem),
680 source => 'element',
681 optional => 1,
682 default => { mode => $mode, value => [ $self->classify($default) ] },
683 );
684 }
685 66 return;
686 }
687  
688 # $_[N] with a default: @_ > N ? $_[N] : DEFAULT, as Method::Signatures and hand-written code say it, or $_[N] // DEFAULT.
689 # Returns the element, the default, and how the default applies, or nothing.
690 39 ▶sub _defaulted_elem {
Subroutine _defaulted_elem: called CC=11 SCAR=24.3
691 39 my ( $self, $op ) = @_;
692 39 my $name = $op->name;
693 39 ▶ if ( $name eq 'cond_expr' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "cond_expr") 13 26 39
694 13 my ( undef, $then, $else ) = _branches($op);
695 13 ▶ $then = _unwrap($then) if $then;
Branch: 1 branch
BranchTrueFalseTotal
if $then 13 0 13
696 13 ▶ return ( $then, $else, q{=} ) if $then && $then->name eq 'aelemfast' && $self->_is_args_elem($then);
Branch: 1 branch
BranchTrueFalseTotal
if $then and $then->name eq "aelemfast" and $self->_is_args_elem($then) 5 8 13
Condition66%4/6
$then and $then->name eq "aelemfast" and $self->_is_args_elem($then)
!ll&&!rl&&r
805
$then and $then->name eq "aelemfast"
!ll&&!rl&&r
085
MC/DC33%1/3
$then and $then->name eq "aelemfast" and $self->_is_args_elem($then)
$then $then->name eq "aelemfast" $self->_is_args_elem($then)
Truth table50%2/4
A and B and C
A= $thenB= $then->name eq "aelemfast"C= $self->_is_args_elem($then)
ABCresult
0XX0
10X0
1100
1111
697 }
698 34 ▶ if ( $name eq 'dor' || $name eq 'or' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "dor" or $name eq "or") 3 31 34
Condition100%3/3
$name eq "dor" or $name eq "or"
l!l&&r!l&&!r
2131
MC/DC100%2/2
$name eq "dor" or $name eq "or"
$name eq "dor" $name eq "or"
Truth table100%3/3
A or B
A= $name eq "dor"B= $name eq "or"
ABresult
1X1
011
000
699 3 my ( $left, $right ) = _kids($op);
700 3 $left = _unwrap($left);
701 3 ▶ return ( $left, $right, $name eq 'dor' ? q{//=} : q{||=} ) if $left->name eq 'aelemfast' && $self->_is_args_elem($left);
Branch: 2 branches
BranchTrueFalseTotal
if $left->name eq "aelemfast" and $self->_is_args_elem($left) 2 1 3
$name eq 'dor' ? : 2 0 2
Condition66%2/3
$left->name eq "aelemfast" and $self->_is_args_elem($left)
!ll&&!rl&&r
102
MC/DC50%1/2
$left->name eq "aelemfast" and $self->_is_args_elem($left)
$left->name eq "aelemfast" $self->_is_args_elem($left)
Truth table66%2/3
A and B
A= $left->name eq "aelemfast"B= $self->_is_args_elem($left)
ABresult
0X0
100
111
702 }
703 32 return;
704 }
705  
706 # The assignment of one value to a lexical scalar: the value is the first kid, and the target the last.
707 62 ▶sub _on_sassign {
Subroutine _on_sassign: called CC=3 SCAR=11.0
708 62 my ( $self, $op ) = @_;
709 62 my @kids = _kids($op);
710 62 ▶ return if @kids != 2;
Branch: 1 branch
BranchTrueFalseTotal
if @kids != 2 4 58 62
711 58 my $target = _unwrap( $kids[1] );
712 58 ▶ return unless $target->name eq 'padsv';
Branch: 1 branch
BranchTrueFalseTotal
unless $target->name eq "padsv" 56 2 58
713 2 $self->_assign_from_args( $kids[0], $self->_padname( $target->targ ) );
714 2 return;
715 }
716  
717 # A list assignment to lexicals, from @_ or from one shift of it.
718 # An undef among the lexicals is a parameter with no name, at its position.
719 217 ▶sub _on_aassign {
Subroutine _on_aassign: called CC=15 SCAR=27.1
720 217 my ( $self, $op ) = @_;
721 217 my ( $rhs, $lhs ) = _kids($op);
722 217 ▶ return unless $rhs && $lhs;
Branch: 1 branch
BranchTrueFalseTotal
unless $rhs and $lhs 0 217 217
Condition33%1/3
$rhs and $lhs
!ll&&!rl&&r
00217
MC/DC0%0/2
$rhs and $lhs
$rhs $lhs
Truth table33%1/3
A and B
A= $rhsB= $lhs
ABresult
0X0
100
111
723  
724 217 my @values = _significant_kids($rhs);
725 217 my @targets;
726 217 foreach my $kid ( _significant_kids($lhs) ) {
727 351 ▶ push @targets, $kid if $kid->name =~ m/\A(?:pad[ash]v|undef)\z/;
Branch: 1 branch
BranchTrueFalseTotal
if $kid->name =~ /\A(?:pad[ash]v|undef)\z/aasx 348 3 351
728 }
729 217 ▶ return if @values != 1 || !@targets;
Branch: 1 branch
BranchTrueFalseTotal
if @values != 1 or not @targets 3 214 217
Condition100%3/3
@values != 1 or not @targets
l!l&&r!l&&!r
12214
MC/DC100%2/2
@values != 1 or not @targets
@values != 1 not @targets
Truth table100%3/3
A or not(B)
A= @values != 1B= not @targets
ABresult
1X1
011
000
730  
731 214 ▶ if ( $self->_is_args_array( $values[0] ) ) {
Branch: 3 branches
BranchTrueFalseTotal
if ($self->_is_args_array($values[0])) { } 210 4 214
elsif ($self->_is_args_shift($values[0])) { } 1 3 4
elsif (my $checked = $self->_checked_call($values[0])) { } 3 0 3
732 210 foreach my $target (@targets) {
733 341 my $name = $self->_target_name($target);
734 341 ▶ if ( !_is_list_target($target) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not _is_list_target($target)) { } 304 37 341
735 304 $self->_add_param( name => $name, index => $self->{shifted}++, source => 'list' );
736 }
737 else {
738 37 $self->_add_param( name => $name, index => $self->{shifted}, source => 'list' );
739 37 last;
740 }
741 }
742 }
743 elsif ( $self->_is_args_shift( $values[0] ) ) {
744 1 $self->{consumed}{ ${ _unwrap( $values[0] ) } } = 1;
745 1 $self->_add_param( name => $self->_target_name( $targets[0] ), index => $self->{shifted}++, source => 'shift' );
746 }
747 elsif ( my $checked = $self->_checked_call( $values[0] ) ) {
748 3 my @types = @{ $checked->{types} };
749 3 foreach my $target (@targets) {
750 6 my $name = $self->_target_name($target);
751 6 ▶ if ( _is_list_target($target) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (_is_list_target($target)) 1 5 6
752 1 $self->_add_param( name => $name, index => $self->{shifted}, source => 'checked' );
753 1 last;
754 }
755 5 my $type = shift @types;
756 $self->_add_param(
757 name => $name,
758 index => $self->{shifted}++,
759 source => 'checked',
760 5 ▶ $type ? ( declared => $type, declared_by => $checked->{by} ) : (),
Branch: 1 branch
BranchTrueFalseTotal
$type ? : 4 1 5
761 );
762 }
763 }
764 214 return;
765 }
766  
767 # The name of the lexical that a target of a list assignment declares, or undef for an undef placeholder.
768 348 ▶sub _target_name {
Subroutine _target_name: called CC=2 SCAR=6.9
769 348 my ( $self, $target ) = @_;
770 348 ▶ return undef if $target->name eq q{undef};
Branch: 1 branch
BranchTrueFalseTotal
if $target->name eq "undef" 8 340 348
771 340 return $self->_padname( $target->targ );
772 }
773  
774 # Whether a target of a list assignment is an array or a hash, which takes the rest of the list.
775 347 ▶sub _is_list_target {
Subroutine _is_list_target: called CC=2 SCAR=6.9
776 347 my ($target) = @_;
777 347 ▶ return $target->name eq 'padav' || $target->name eq 'padhv';
Condition100%3/3
$target->name eq 'padav' || $target->name eq 'padhv'
l!l&&r!l&&!r
929309
MC/DC100%2/2
$target->name eq 'padav' || $target->name eq 'padhv'
$target->name eq 'padav' $target->name eq 'padhv'
Truth table100%3/3
A || B
A= $target->name eq 'padav'B= $target->name eq 'padhv'
ABresult
1X1
011
000
778 }
779  
780 # A call that checks the arguments of the sub, such as $check->(@_), validate(\@_, ...) or validate_pos(@_, ...):
781 # returns the types it checks them against, by position, as far as the op tree shows them, or nothing when OP is no such call.
782 3 ▶sub _checked_call {
Subroutine _checked_call: called CC=11 SCAR=24.2
783 3 my ( $self, $op ) = @_;
784 3 $op = _unwrap($op);
785 3 ▶ return if $op->name ne 'entersub';
Branch: 1 branch
BranchTrueFalseTotal
if $op->name ne "entersub" 0 3 3
786 3 my ( $target, $args ) = $self->_call_target($op);
787 3 my @rest = @$args;
788 3 my $receives_args;
789 3 ▶ while ( my $arg = shift @rest ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $arg = shift @rest) 3 0 3
790 3 my $value = _unwrap($arg);
791 3 ▶ $value = _unwrap( ( _kids($value) )[0] ) if $value->name eq 'srefgen' && _kids($value);
Branch: 1 branch
BranchTrueFalseTotal
if $value->name eq "srefgen" and _kids($value) 1 2 3
Condition66%2/3
$value->name eq "srefgen" and _kids($value)
!ll&&!rl&&r
201
MC/DC50%1/2
$value->name eq "srefgen" and _kids($value)
$value->name eq "srefgen" _kids($value)
Truth table66%2/3
A and B
A= $value->name eq "srefgen"B= _kids($value)
ABresult
0X0
100
111
792 3 ▶ next if !$self->_is_args_array($value);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_is_args_array($value) 0 3 3
793 3 $receives_args = 1;
794 3 last;
795 }
796 3 ▶ return if !$receives_args;
Branch: 1 branch
BranchTrueFalseTotal
unless $receives_args 0 3 3
797  
798 3 ▶ if ( ( $target->{function} // q{} ) eq 'Type::Params::validate' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (($target->{"function"} // "") eq "Type::Params::validate") 1 2 3
Condition100%2/2
$target->{"function"} // ""
l!l
21
MC/DC100%1/1
$target->{"function"} // ""
$target->{"function"}
Truth table100%2/2
A
A= $target->{"function"}
Aresult
11
00
799 1 return { types => $self->_try_static_values( \@rest ), by => 'Type::Params' };
800 }
801 2 ▶ my $checker = defined $target->{coderef} ? $self->{checkers}{ $target->{coderef} } : undef;
Branch: 1 branch
BranchTrueFalseTotal
defined $target->{'coderef'} ? : 1 1 2
802 2 ▶ return { types => [ @{ $checker // [] } ], by => 'Type::Params' };
Condition100%2/2
$checker // []
l!l
11
MC/DC100%1/1
$checker // []
$checker
Truth table100%2/2
A
A= $checker
Aresult
11
00
803 }
804  
805 # The value that OP builds from constants and calls to the type functions of a Type::Library, as in Optional[Str].
806 # Dies when OP builds anything else.
807 # It walks the op tree of one expression, and so recursion is its natural form.
808 ## no critic (Subroutines::ProhibitTailRecursion)
809 17 ▶sub _static_value {
Subroutine _static_value: called CC=11 SCAR=24.4
810 17 my ( $self, $op ) = @_;
811 17 $op = _unwrap($op);
812 17 my $name = $op->name;
813 17 ▶ return _sv_value( $self->_const_sv($op) ) if $name eq 'const';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "const" 5 12 17
814 12 ▶ if ( $name eq 'anonlist' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "anonlist") 2 10 12
815 2 my @values;
816 2 foreach my $kid ( _significant_kids($op) ) {
817 2 push @values, $self->_static_value($kid);
818 }
819 2 return \@values;
820 }
821 10 ▶ if ( $name eq 'entersub' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "entersub") 7 3 10
822 7 my ( $target, $args ) = $self->_call_target($op);
823 7 ▶ my ( $library, $type ) = ( $target->{function} // q{} ) =~ m/\A(.+)::(\w+)\z/;
Condition50%1/2
$target->{"function"} // ""
l!l
70
MC/DC0%0/1
$target->{"function"} // ""
$target->{"function"}
Truth table50%1/2
A
A= $target->{"function"}
Aresult
11
00
824 7 ▶ die "not a type\n" if !$type || !_is_type_library($library) || !$library->has_type($type);
Branch: 1 branch
BranchTrueFalseTotal
unless $type and _is_type_library($library) and $library->has_type($type) 0 7 7
Condition33%2/6
$type and _is_type_library($library) and $library->has_type($type)
!ll&&!rl&&r
007
$type and _is_type_library($library)
!ll&&!rl&&r
007
MC/DC0%0/3
$type and _is_type_library($library) and $library->has_type($type)
$type _is_type_library($library) $library->has_type($type)
Truth table25%1/4
A and B and C
A= $typeB= _is_type_library($library)C= $library->has_type($type)
ABCresult
0XX0
10X0
1100
1111
825 7 ▶ return $library->get_type($type) if !@$args;
Branch: 1 branch
BranchTrueFalseTotal
unless @$args 5 2 7
826 2 my @values;
827 2 foreach my $arg (@$args) {
828 2 push @values, $self->_static_value($arg);
829 }
830 2 return $library->can($type)->(@values);
831 }
832 3 die "not a static value\n";
833 }
834 ## use critic
835  
836 # The value of _static_value, or undef when OP builds anything else.
837 13 ▶sub _try_static_value {
Subroutine _try_static_value: called CC=2 SCAR=6.9
838 13 my ( $self, $op ) = @_;
839 13 my $value;
840 13 ▶ return eval { $value = $self->_static_value($op); 1 } ? $value : undef;
Branch: 1 branch
BranchTrueFalseTotal
eval { do { $value = $self->_static_value($op); 1 } } ? : 10 3 13
841 }
842  
843 # The values of _try_static_value for each op of the ARRAYREF OPS.
844 2 ▶sub _try_static_values {
Subroutine _try_static_values: called CC=2 SCAR=6.9
845 2 my ( $self, $ops ) = @_;
846 2 my @values;
847 2 foreach my $op (@$ops) {
848 4 push @values, $self->_try_static_value($op);
849 }
850 2 return \@values;
851 }
852  
853 30 ▶sub _is_type_library {
Subroutine _is_type_library: called CC=2 SCAR=7.0
854 30 my ($package) = @_;
855 30 my $is;
856 30 ▶ return eval { $is = $package->isa('Type::Library'); 1 } ? $is : 0;
Branch: 1 branch
BranchTrueFalseTotal
eval { do { $is = $package->isa('Type::Library'); 1 } } ? : 30 0 30
857 }
858  
859 # Records the types that compile() of Type::Params returns a checker for, under the variable the checker is assigned to.
860 1 ▶sub _note_checker {
Subroutine _note_checker: called CC=6 SCAR=21.8
861 1 my ( $self, $args, $ancestors ) = @_;
862 1 ▶ my $parent = $ancestors->[-1] // return;
Condition50%1/2
$ancestors->[-1] // (return)
l!l
10
MC/DC0%0/1
$ancestors->[-1] // (return)
$ancestors->[-1]
Truth table50%1/2
A
A= $ancestors->[-1]
Aresult
11
00
863 1 my $var;
864 1 ▶ $var = $self->_padname( $parent->targ ) if $parent->name eq 'padsv_store';
Branch: 1 branch
BranchTrueFalseTotal
if $parent->name eq "padsv_store" 1 0 1
865 1 ▶ if ( $parent->name eq 'sassign' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($parent->name eq "sassign") 0 1 1
866 0 my ( undef, $target ) = _kids($parent);
867 0 $target = _unwrap($target);
868 0 ▶ $var = $self->_padname( $target->targ ) if $target->name eq 'padsv';
Branch: 1 branch
BranchTrueFalseTotal
if $target->name eq "padsv" 0 0 0
869 }
870 1 ▶ return if !defined $var;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $var 0 1 1
871 1 $self->{checkers}{$var} = $self->_try_static_values($args);
872 1 return;
873 }
874  
875 19 our %GUARD_METHODS = map { $_ => 1 } qw{assert_valid assert_return check};
876  
877 # Records the type that a guard checks a variable against: is_X($var) and assert_X($var) of a Type::Library,
878 # TYPE->assert_valid($var) and its kind, and the type_error() calls that Method::Signatures compiles.
879 172 ▶sub _note_guard {
Subroutine _note_guard: called CC=17 SCAR=29.0
880 172 my ( $self, $target, $args ) = @_;
881 172 my ( $type, $checked, $by );
882  
883 172 ▶ if ( defined $target->{function} ) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $target->{'function'}) { } 94 78 172
elsif ($target->{'type'} eq 'method' and defined $target->{'method'}) { } 54 48 102
884 94 my ( $library, $guard ) = $target->{function} =~ m/\A(.+)::(?:assert|is)_(\w+)\z/;
885 94 ▶ return if !$guard || !_is_type_library($library) || !$library->has_type($guard);
Branch: 1 branch
BranchTrueFalseTotal
unless $guard and _is_type_library($library) and $library->has_type($guard) 71 23 94
Condition66%4/6
$guard and _is_type_library($library) and $library->has_type($guard)
!ll&&!rl&&r
71023
$guard and _is_type_library($library)
!ll&&!rl&&r
71023
MC/DC33%1/3
$guard and _is_type_library($library) and $library->has_type($guard)
$guard _is_type_library($library) $library->has_type($guard)
Truth table50%2/4
A and B and C
A= $guardB= _is_type_library($library)C= $library->has_type($guard)
ABCresult
0XX0
10X0
1100
1111
886 23 ( $type, $checked, $by ) = ( $library->get_type($guard), $args->[0], 'Type::Tiny' );
887 }
888 ▶ elsif ( $target->{type} eq 'method' && defined $target->{method} ) {
Condition66%2/3
$target->{"type"} eq "method" and defined $target->{"method"}
!ll&&!rl&&r
24054
MC/DC50%1/2
$target->{"type"} eq "method" and defined $target->{"method"}
$target->{"type"} eq "method" defined $target->{"method"}
Truth table66%2/3
A and B
A= $target->{"type"} eq "method"B= defined $target->{"method"}
ABresult
0X0
100
111
889 54 ▶ my $invocant = $args->[0] // return;
Condition50%1/2
$args->[0] // (return)
l!l
540
MC/DC0%0/1
$args->[0] // (return)
$args->[0]
Truth table50%1/2
A
A= $args->[0]
Aresult
11
00
890 54 ▶ if ( $GUARD_METHODS{ $target->{method} } ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($Pod::Coverage::More::Analyzer::GUARD_METHODS{$target->{'method'}}) { } 5 49 54
elsif ($target->{'method'} eq 'type_error' and ($self->_try_static_value($invocant) // '') eq 'Method::Signatures') { } 2 94 96
891 5 $type = $self->_try_static_value($invocant);
892 5 ( $checked, $by ) = ( $args->[1], 'Type::Tiny' );
893 }
894 ▶ elsif ( $target->{method} eq 'type_error' && ( $self->_try_static_value($invocant) // q{} ) eq 'Method::Signatures' ) {
Condition60%3/5
$target->{"method"} eq "type_error" and ($self->_try_static_value($invocant) // "") eq "Method::Signatures"
!ll&&!rl&&r
4702
$self->_try_static_value($invocant) // ""
l!l
20
MC/DC50%1/2
$target->{"method"} eq "type_error" and ($self->_try_static_value($invocant) // "") eq "Method::Signatures"
$target->{"method"} eq "type_error" $self->_try_static_value($invocant)
Truth table66%2/3
A and B
A= $target->{"method"} eq "type_error"B= $self->_try_static_value($invocant)
ABresult
0X0
100
111
895 2 my $name = $self->_try_static_value( $args->[1] );
896 2 $type = type_named($name);
897 2 ( $checked, $by ) = ( $args->[2], 'Method::Signatures' );
898 }
899 }
900 101 ▶ return if !$type || !blessed($type) || !$checked;
Branch: 1 branch
BranchTrueFalseTotal
unless $type and builtin::blessed($type) and $checked 74 27 101
Condition66%4/6
$type and builtin::blessed($type) and $checked
!ll&&!rl&&r
74027
$type and builtin::blessed($type)
!ll&&!rl&&r
74027
MC/DC33%1/3
$type and builtin::blessed($type) and $checked
$type builtin::blessed($type) $checked
Truth table50%2/4
A and B and C
A= $typeB= builtin::blessed($type)C= $checked
ABCresult
0XX0
10X0
1100
1111
901 27 $checked = _unwrap($checked);
902 27 ▶ return if $checked->name ne 'padsv';
Branch: 1 branch
BranchTrueFalseTotal
if $checked->name ne "padsv" 6 21 27
903 21 ▶ my $var = $self->_padname( $checked->targ ) // return;
Condition50%1/2
$self->_padname($checked->targ) // (return)
l!l
210
MC/DC0%0/1
$self->_padname($checked->targ) // (return)
$self->_padname($checked->targ)
Truth table50%1/2
A
A= $self->_padname($checked->targ)
Aresult
11
00
904 21 $self->{guards}{$var} = { type => $type, by => $by };
905 21 return;
906 }
907  
908 # Any use of @_, as a sub that only passes it on makes.
909 286 ▶sub _on_rv2av {
Subroutine _on_rv2av: called CC=2 SCAR=6.9
910 286 my ( $self, $op ) = @_;
911 286 ▶ $self->{rec}{reads_args} = 1 if $self->_is_args_array($op);
Branch: 1 branch
BranchTrueFalseTotal
if $self->_is_args_array($op) 267 19 286
912 286 return;
913 }
914  
915 # A shift of @_ that is not assigned to a variable, as in shift->method.
916 31 ▶sub _on_shift {
Subroutine _on_shift: called CC=3 SCAR=11.0
917 31 my ( $self, $op ) = @_;
918 31 ▶ return unless $self->_is_args_shift($op);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_is_args_shift($op) 0 31 31
919 31 $self->{rec}{reads_args} = 1;
920 31 ▶ return if $self->{consumed}{$$op};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"consumed"}{$$op} 21 10 31
921 10 $self->_add_param( name => undef, index => $self->{shifted}++, source => 'shift' );
922 10 return;
923 }
924  
925 69 ▶sub _is_args_elem {
Subroutine _is_args_elem: called CC=2 SCAR=7.1
926 69 my ( $self, $op ) = @_;
927 69 my $gv = $self->_gv($op);
928 69 ▶ return ( _fullname($gv) // '' ) eq 'main::_';
Condition50%1/2
_fullname($gv) // ""
l!l
690
MC/DC0%0/1
_fullname($gv) // ""
_fullname($gv)
Truth table50%1/2
A
A= _fullname($gv)
Aresult
11
00
929 }
930  
931 55 ▶sub _elem_index {
Subroutine _elem_index: called CC=1 SCAR=0.0
932 55 my ($op) = @_;
933 55 return unpack( 'c', pack( 'C', $op->private ) );
934 }
935  
936 # $_[N] used directly.
937 55 ▶sub _on_aelemfast {
Subroutine _on_aelemfast: called CC=4 SCAR=14.0
938 55 my ( $self, $op ) = @_;
939 55 ▶ return unless $self->_is_args_elem($op);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_is_args_elem($op) 0 55 55
940 55 $self->{rec}{reads_args} = 1;
941 55 ▶ return if $self->{consumed}{$$op};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"consumed"}{$$op} 14 41 55
942 41 my $index = _elem_index($op);
943 41 ▶ return if $index < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $index < 0 0 41 41
944 41 $self->_add_param( name => undef, index => $index, source => 'element' );
945 41 return;
946 }
947  
948 780 ▶sub _on_pad {
Subroutine _on_pad: called CC=9 SCAR=22.2
949 780 my ( $self, $op, $ancestors ) = @_;
950 780 ▶ my $var = $self->_padname( $op->targ ) // return;
Condition50%1/2
$self->_padname($op->targ) // (return)
l!l
7800
MC/DC0%0/1
$self->_padname($op->targ) // (return)
$self->_padname($op->targ)
Truth table50%1/2
A
A= $self->_padname($op->targ)
Aresult
11
00
951 780 ▶ my $parent = $ancestors->[-1] // return;
Condition50%1/2
$ancestors->[-1] // (return)
l!l
7800
MC/DC0%0/1
$ancestors->[-1] // (return)
$ancestors->[-1]
Truth table50%1/2
A
A= $ancestors->[-1]
Aresult
11
00
952 780 my $pname = $parent->name;
953  
954 # A declaration of the variable is not a use of it.
955 780 ▶ return if $op->private & B::OPpLVAL_INTRO;
Branch: 1 branch
BranchTrueFalseTotal
if $op->private & 128 350 430 780
956  
957 430 my $usage = $self->_usage_of($var);
958 430 ▶ if ( $pname eq 'rv2hv' ) { $usage->{hashref} = 1 }
Branch: 5 branches
BranchTrueFalseTotal
if ($pname eq 'rv2hv') { } 1 429 430
elsif ($pname eq 'rv2av') { } 16 413 429
elsif ($pname eq 'rv2cv') { } 0 413 413
elsif ($Pod::Coverage::More::Analyzer::NUMERIC_OPS{$pname}) { } 57 356 413
elsif ($Pod::Coverage::More::Analyzer::STRING_OPS{$pname}) { } 52 304 356
959 16 elsif ( $pname eq 'rv2av' ) { $usage->{arrayref} = 1 }
960 0 elsif ( $pname eq 'rv2cv' ) { $usage->{coderef} = 1 }
961 57 elsif ( $NUMERIC_OPS{$pname} ) { $usage->{numeric} = 1 }
962 52 elsif ( $STRING_OPS{$pname} ) { $usage->{string} = 1 }
963 430 return;
964 }
965  
966 145 ▶sub _add_key {
Subroutine _add_key: called CC=5 SCAR=16.1
967 145 my ( $self, $var, $key ) = @_;
968 145 ▶ return if !defined $var || !defined $key;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $var and defined $key 20 125 145
Condition66%2/3
defined $var and defined $key
!ll&&!rl&&r
200125
MC/DC50%1/2
defined $var and defined $key
defined $var defined $key
Truth table66%2/3
A and B
A= defined $varB= defined $key
ABresult
0X0
100
111
969 125 my $usage = $self->_usage_of($var);
970 125 ▶ $usage->{keys} //= [];
Condition100%2/2
$usage->{"keys"} //= []
l!l
4976
MC/DC100%1/1
$usage->{"keys"} //= []
$usage->{"keys"}
Truth table100%2/2
A
A= $usage->{"keys"}
Aresult
11
00
971 125 ▶ push @{ $usage->{keys} }, $key unless any { $_ eq $key } @{ $usage->{keys} };
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
unless &any(sub { $_ eq $key; } , @{$$usage{"keys"};}) 94 31 125
972 125 return;
973 }
974  
975 # $h->{a}[0], $o{size}, exists $o{verbose} and the like, compiled into one op.
976 169 ▶sub _on_multideref {
Subroutine _on_multideref: called CC=18 SCAR=29.5
977 169 my ( $self, $op ) = @_;
978 169 my @items = $op->aux_list( $self->{cv} );
979 169 my $actions = shift @items;
980 169 my $first = 1;
981 169 my $var;
982  
983 169 while (1) {
984 189 my $action = $actions & B::MDEREF_ACTION_MASK;
985 189 ▶ if ( $action == B::MDEREF_reload ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($action == 0) 0 189 189
986 0 $actions = shift @items;
987 0 next;
988 }
989 189 ▶ my $is_hash = any { $action == $_ } @HASH_MDEREF_ACTIONS;
Subroutine __ANON__: called CC=1 SCAR=0.0
990  
991 189 ▶ if ( $action == B::MDEREF_AV_padav_aelem || $action == B::MDEREF_HV_padhv_helem ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($action == 5 or $action == 12) { } 40 149 189
elsif ($action == 3 or $action == 10) { } 86 63 149
elsif ($action == 6 or $action == 13 or $action == 2 or $action == 9) { } 43 20 63
elsif (not $first) { } 20 0 20
Condition66%2/3
$action == 5 or $action == 12
l!l&&r!l&&!r
040149
MC/DC50%1/2
$action == 5 or $action == 12
$action == 5 $action == 12
Truth table66%2/3
A or B
A= $action == 5B= $action == 12
ABresult
1X1
011
000
992 40 $var = $self->_padname( shift @items );
993 }
994 ▶ elsif ( $action == B::MDEREF_AV_padsv_vivify_rv2av_aelem || $action == B::MDEREF_HV_padsv_vivify_rv2hv_helem ) {
Condition100%3/3
$action == 3 or $action == 10
l!l&&r!l&&!r
18563
MC/DC100%2/2
$action == 3 or $action == 10
$action == 3 $action == 10
Truth table100%3/3
A or B
A= $action == 3B= $action == 10
ABresult
1X1
011
000
995 86 $var = $self->_padname( shift @items );
996 86 ▶ $self->_usage_of($var)->{ $is_hash ? 'hashref' : 'arrayref' } = 1 if defined $var;
Branch: 2 branches
BranchTrueFalseTotal
if defined $var 86 0 86
$is_hash ? : 85 1 86
997 }
998 ▶ elsif ($action == B::MDEREF_AV_gvav_aelem
Condition77%7/9
$action == 6 or $action == 13 or $action == 2 or $action == 9
l!l&&r!l&&!r
43020
$action == 6 or $action == 13 or $action == 2
l!l&&r!l&&!r
43020
$action == 6 or $action == 13
l!l&&r!l&&!r
41220
MC/DC50%2/4
$action == 6 or $action == 13 or $action == 2 or $action == 9
$action == 6 $action == 13 $action == 2 $action == 9
Truth table60%3/5
A or B or C or D
A= $action == 6B= $action == 13C= $action == 2D= $action == 9
ABCDresult
1XXX1
01XX1
001X1
00011
00000
999 || $action == B::MDEREF_HV_gvhv_helem
1000 || $action == B::MDEREF_AV_gvsv_vivify_rv2av_aelem
1001 || $action == B::MDEREF_HV_gvsv_vivify_rv2hv_helem ) {
1002 43 shift @items;
1003 43 $var = undef;
1004 }
1005 elsif ( !$first ) {
1006  
1007 # A deeper level of a chain that started at $var: it says nothing more about $var itself.
1008 20 $var = undef;
1009 }
1010  
1011 189 my $index = $actions & B::MDEREF_INDEX_MASK;
1012 189 ▶ last if $index == B::MDEREF_INDEX_none;
Branch: 1 branch
BranchTrueFalseTotal
if $index == 0 0 189 189
1013 189 my $key = shift @items;
1014 189 ▶ if ( $index == B::MDEREF_INDEX_const ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($index == 16) 181 8 189
1015 181 ▶ $self->_add_key( $var, ref $key ? _sv_value($key) : $key ) if $is_hash;
Branch: 2 branches
BranchTrueFalseTotal
if $is_hash 137 44 181
ref $key ? : 137 0 137
1016 }
1017  
1018 189 ▶ last if $actions & B::MDEREF_FLAG_last;
Branch: 1 branch
BranchTrueFalseTotal
if $actions & 64 169 20 189
1019 20 $actions >>= B::MDEREF_SHIFT;
1020 20 $first = 0;
1021 }
1022 169 return;
1023 }
1024  
1025 # $o{name} or $h->{name} when perl did not fold it into a multideref.
1026 9 ▶sub _on_helem {
Subroutine _on_helem: called CC=8 SCAR=22.1
1027 9 my ( $self, $op ) = @_;
1028 9 my ( $hash, $key ) = _kids($op);
1029 9 ▶ return unless $hash && $key && $key->name eq 'const';
Branch: 1 branch
BranchTrueFalseTotal
unless $hash and $key and $key->name eq "const" 1 8 9
Condition50%3/6
$hash and $key and $key->name eq "const"
!ll&&!rl&&r
018
$hash and $key
!ll&&!rl&&r
009
MC/DC33%1/3
$hash and $key and $key->name eq "const"
$hash $key $key->name eq "const"
Truth table50%2/4
A and B and C
A= $hashB= $keyC= $key->name eq "const"
ABCresult
0XX0
10X0
1100
1111
1030 8 my $var;
1031 8 ▶ if ( $hash->name eq 'padhv' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($hash->name eq 'padhv') { } 7 1 8
elsif ($hash->name eq 'rv2hv') { } 1 0 1
1032 7 $var = $self->_padname( $hash->targ );
1033 }
1034 elsif ( $hash->name eq 'rv2hv' ) {
1035 1 my ($ref) = _kids($hash);
1036 1 ▶ $var = $self->_padname( $ref->targ ) if $ref && $ref->name eq 'padsv';
Branch: 1 branch
BranchTrueFalseTotal
if $ref and $ref->name eq "padsv" 1 0 1
Condition33%1/3
$ref and $ref->name eq "padsv"
!ll&&!rl&&r
001
MC/DC0%0/2
$ref and $ref->name eq "padsv"
$ref $ref->name eq "padsv"
Truth table33%1/3
A and B
A= $refB= $ref->name eq "padsv"
ABresult
0X0
100
111
1037 }
1038 8 $self->_add_key( $var, _sv_value( $self->_const_sv($key) ) );
1039 8 return;
1040 }
1041  
1042 # exists $o{name} or delete $o{name} when perl did not fold it into a multideref:
1043 # the hash element is then a null op that was a helem.
1044 2 ▶sub _on_exists {
Subroutine _on_exists: called CC=4 SCAR=15.0
1045 2 my ( $self, $op ) = @_;
1046 2 my ($elem) = _kids($op);
1047 2 ▶ return if !$elem;
Branch: 1 branch
BranchTrueFalseTotal
unless $elem 0 2 2
1048 2 ▶ return if $elem->name ne q{null} || $elem->targ != $HELEM;
Branch: 1 branch
BranchTrueFalseTotal
if $elem->name ne "null" or $elem->targ != $Pod::Coverage::More::Analyzer::HELEM 0 2 2
Condition33%1/3
$elem->name ne "null" or $elem->targ != $Pod::Coverage::More::Analyzer::HELEM
l!l&&r!l&&!r
002
MC/DC0%0/2
$elem->name ne "null" or $elem->targ != $Pod::Coverage::More::Analyzer::HELEM
$elem->name ne "null" $elem->targ != $Pod::Coverage::More::Analyzer::HELEM
Truth table33%1/3
A or B
A= $elem->name ne "null"B= $elem->targ != $Pod::Coverage::More::Analyzer::HELEM
ABresult
1X1
011
000
1049 2 $self->_on_helem($elem);
1050 2 return;
1051 }
1052  
1053 232 ▶sub _call_target {
Subroutine _call_target: called CC=13 SCAR=26.3
1054 232 my ( $self, $op ) = @_;
1055 232 my @args = _significant_kids($op);
1056 232 ▶ @args = _significant_kids( $args[0] ) if @args == 1 && $args[0]->name eq 'null';
Branch: 1 branch
BranchTrueFalseTotal
if @args == 1 and $args[0]->name eq "null" 157 75 232
Condition66%2/3
@args == 1 and $args[0]->name eq "null"
!ll&&!rl&&r
750157
MC/DC50%1/2
@args == 1 and $args[0]->name eq "null"
@args == 1 $args[0]->name eq "null"
Truth table66%2/3
A and B
A= @args == 1B= $args[0]->name eq "null"
ABresult
0X0
100
111
1057 232 my $target = pop @args;
1058 232 ▶ return ( undef, \@args ) if !$target;
Branch: 1 branch
BranchTrueFalseTotal
unless $target 0 232 232
1059  
1060 232 ▶ if ( $target->name eq 'method_named' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($target->name eq "method_named") 71 161 232
1061 71 my $sv = $target->meth_sv;
1062 71 ▶ $sv = $self->_padval( $target->targ ) unless $$sv;
Branch: 1 branch
BranchTrueFalseTotal
unless $$sv 0 71 71
1063 71 return ( { type => 'method', method => _sv_value($sv) }, \@args );
1064 }
1065 161 ▶ if ( $target->name eq 'method' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($target->name eq "method") 0 161 161
1066 0 return ( { type => 'method', method => undef }, \@args );
1067 }
1068 161 my $cvop = _unwrap($target);
1069 161 ▶ $cvop = _unwrap( ( _kids($cvop) )[0] ) if $cvop->name eq 'rv2cv' && _kids($cvop);
Branch: 1 branch
BranchTrueFalseTotal
if $cvop->name eq "rv2cv" and _kids($cvop) 0 161 161
Condition33%1/3
$cvop->name eq "rv2cv" and _kids($cvop)
!ll&&!rl&&r
16100
MC/DC0%0/2
$cvop->name eq "rv2cv" and _kids($cvop)
$cvop->name eq "rv2cv" _kids($cvop)
Truth table33%1/3
A and B
A= $cvop->name eq "rv2cv"B= _kids($cvop)
ABresult
0X0
100
111
1070 161 ▶ if ( $cvop->name eq 'gv' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cvop->name eq "gv") 119 42 161
1071 119 my $gv = $self->_gv($cvop);
1072 119 ▶ return ( { type => 'call', function => _sub_fullname($gv), $gv->STASH->NAME eq $self->{rec}{package} ? ( cv => $gv->CV ) : () }, \@args );
Branch: 1 branch
BranchTrueFalseTotal
$gv->STASH->NAME eq $self->{'rec'}{'package'} ? : 61 58 119
1073 }
1074 42 ▶ if ( $cvop->name eq 'padcv' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cvop->name eq "padcv") 24 18 42
1075 24 return ( { type => 'call', lexical => $self->_padname( $cvop->targ ) =~ s/\A&//r, cv => $self->_padval( $cvop->targ ) }, \@args );
1076 }
1077 18 ▶ if ( $cvop->name eq 'padsv' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cvop->name eq "padsv") 9 9 18
1078 9 return ( { type => 'call', coderef => $self->_padname( $cvop->targ ) }, \@args );
1079 }
1080 9 return ( { type => 'call' }, \@args );
1081 }
1082  
1083 172 ▶sub _on_entersub {
Subroutine _on_entersub: called CC=13 SCAR=25.8
1084 172 my ( $self, $op, $ancestors ) = @_;
1085 172 my ( $target, $args ) = $self->_call_target($op);
1086 172 ▶ return if !$target;
Branch: 1 branch
BranchTrueFalseTotal
unless $target 0 172 172
1087  
1088 172 ▶ $self->_note_checker( $args, $ancestors ) if ( $target->{function} // q{} ) eq 'Type::Params::compile';
Branch: 1 branch
BranchTrueFalseTotal
if ($target->{"function"} // "") eq "Type::Params::compile" 1 171 172
Condition100%2/2
$target->{"function"} // ""
l!l
9478
MC/DC100%1/1
$target->{"function"} // ""
$target->{"function"}
Truth table100%2/2
A
A= $target->{"function"}
Aresult
11
00
1089 172 $self->_note_guard( $target, $args );
1090  
1091 172 ▶ if ( $target->{type} eq 'method' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($target->{"type"} eq "method") 54 118 172
1092 54 $self->_add_method_use( $args->[0], $target->{method} );
1093 54 ▶ $self->_add_death( $target->{method}, $ancestors ) if $TERMINATING_METHODS{ $target->{method} // q{} };
Branch: 1 branch
BranchTrueFalseTotal
if $Pod::Coverage::More::Analyzer::TERMINATING_METHODS{$target->{"method"} // ""} 10 44 54
Condition50%1/2
$target->{"method"} // ""
l!l
540
MC/DC0%0/1
$target->{"method"} // ""
$target->{"method"}
Truth table50%1/2
A
A= $target->{"method"}
Aresult
11
00
1094 54 return;
1095 }
1096 118 ▶ if ( defined $target->{coderef} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $target->{"coderef"}) 6 112 118
1097 6 $self->_usage_of( $target->{coderef} )->{coderef} = 1;
1098 6 return;
1099 }
1100 112 ▶ if ( defined $target->{function} && $TERMINATORS{ $target->{function} } ) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $target->{'function'} and $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{'function'}}) { } 7 105 112
elsif ($self->_never_returns($target)) { } 14 91 105
Condition100%3/3
defined $target->{"function"} and $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
!ll&&!rl&&r
18877
MC/DC100%2/2
defined $target->{"function"} and $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
defined $target->{"function"} $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
Truth table100%3/3
A and B
A= defined $target->{"function"}B= $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
ABresult
0X0
100
111
1101 7 $self->_add_death( $target->{function}, $ancestors );
1102 }
1103 elsif ( $self->_never_returns($target) ) {
1104 14 ▶ push @{ $self->{rec}{ends_in} }, { via => $target->{lexical} // $target->{function}, caught => _is_caught($ancestors) ? 1 : 0 };
Branch: 1 branch
BranchTrueFalseTotal
_is_caught($ancestors) ? : 0 14 14
Condition66%2/3
$target->{"lexical"} // $target->{"function"}
l!l&&r!l&&!r
1220
MC/DC0%0/2
$target->{"lexical"} // $target->{"function"}
$target->{"lexical"} $target->{"function"}
Truth table66%2/3
A // B
A= $target->{"lexical"}B= $target->{"function"}
ABresult
1X1
011
000
1105 }
1106 112 return;
1107 }
1108  
1109 # Whether the call TARGET never returns: a terminator, as croak, or a sub whose record says that it never returns.
1110 # Only a sub of the package or a lexical sub has a CV in its target, so that the analysis stays in the code at hand.
1111 155 ▶sub _never_returns {
Subroutine _never_returns: called CC=11 SCAR=24.0
1112 155 my ( $self, $target ) = @_;
1113 155 ▶ return 1 if $target->{type} eq 'method' && $TERMINATING_METHODS{ $target->{method} // q{} };
Branch: 1 branch
BranchTrueFalseTotal
if $target->{"type"} eq "method" and $Pod::Coverage::More::Analyzer::TERMINATING_METHODS{$target->{"method"} // ""} 6 149 155
Condition80%4/5
$target->{"type"} eq "method" and $Pod::Coverage::More::Analyzer::TERMINATING_METHODS{$target->{"method"} // ""}
!ll&&!rl&&r
138116
$target->{"method"} // ""
l!l
170
MC/DC100%2/2
$target->{"type"} eq "method" and $Pod::Coverage::More::Analyzer::TERMINATING_METHODS{$target->{"method"} // ""}
$target->{"type"} eq "method" $Pod::Coverage::More::Analyzer::TERMINATING_METHODS{$target->{"method"} // ""}
MC/DC0%0/1
$target->{"method"} // ""
$target->{"method"}
Truth table100%3/3
A and B
A= $target->{"type"} eq "method"B= $Pod::Coverage::More::Analyzer::TERMINATING_METHODS{$target->{"method"} // ""}
ABresult
0X0
100
111
Truth table50%1/2
A
A= $target->{"method"}
Aresult
11
00
1114 149 ▶ return 1 if defined $target->{function} && $TERMINATORS{ $target->{function} };
Branch: 1 branch
BranchTrueFalseTotal
if defined $target->{"function"} and $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}} 3 146 149
Condition100%3/3
defined $target->{"function"} and $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
!ll&&!rl&&r
461003
MC/DC100%2/2
defined $target->{"function"} and $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
defined $target->{"function"} $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
Truth table100%3/3
A and B
A= defined $target->{"function"}B= $Pod::Coverage::More::Analyzer::TERMINATORS{$target->{"function"}}
ABresult
0X0
100
111
1115 146 ▶ my $cv = $target->{cv} or return 0;
Branch: 1 branch
BranchTrueFalseTotal
my $cv = $target->{"cv"} or return 0 74 72 146
1116 74 ▶ return 0 if B::class($cv) ne 'CV' || !${ $cv->ROOT };
Branch: 1 branch
BranchTrueFalseTotal
if B::class($cv) ne "CV" or not ${$cv->ROOT;} 1 73 74
Condition66%2/3
B::class($cv) ne "CV" or not ${$cv->ROOT;}
l!l&&r!l&&!r
0173
MC/DC50%1/2
B::class($cv) ne "CV" or not ${$cv->ROOT;}
B::class($cv) ne "CV" not ${$cv->ROOT;}
Truth table66%2/3
A or not(B)
A= B::class($cv) ne "CV"B= not ${$cv->ROOT;}
ABresult
1X1
011
000
1117  
1118 # A sub that calls itself is taken to return while its own analysis runs.
1119 73 my $memo = $self->{never_returns};
1120 73 ▶ return $memo->{$$cv} if exists $memo->{$$cv};
Branch: 1 branch
BranchTrueFalseTotal
if exists $$memo{$$cv} 44 29 73
1121 29 $memo->{$$cv} = 0;
1122 29 ▶ my $rec = $self->analyze_sub( $cv->object_2svref, $target->{lexical} // $cv->GV->NAME, $self->{rec}{package} );
Condition66%2/3
$target->{"lexical"} // $cv->GV->NAME
l!l&&r!l&&!r
5240
MC/DC0%0/2
$target->{"lexical"} // $cv->GV->NAME
$target->{"lexical"} $cv->GV->NAME
Truth table66%2/3
A // B
A= $target->{"lexical"}B= $cv->GV->NAME
ABresult
1X1
011
000
1123 29 return $memo->{$$cv} = $rec->{never_returns};
1124 }
1125  
1126 # Records METHOD as called on the variable that INVOCANT reads, when it reads one.
1127 54 ▶sub _add_method_use {
Subroutine _add_method_use: called CC=7 SCAR=20.9
1128 54 my ( $self, $invocant, $method ) = @_;
1129 54 ▶ return if !$invocant || !defined $method;
Branch: 1 branch
BranchTrueFalseTotal
unless $invocant and defined $method 0 54 54
Condition33%1/3
$invocant and defined $method
!ll&&!rl&&r
0054
MC/DC0%0/2
$invocant and defined $method
$invocant defined $method
Truth table33%1/3
A and B
A= $invocantB= defined $method
ABresult
0X0
100
111
1130 54 $invocant = _unwrap($invocant);
1131 54 ▶ return if $invocant->name ne 'padsv';
Branch: 1 branch
BranchTrueFalseTotal
if $invocant->name ne "padsv" 36 18 54
1132 18 ▶ my $var = $self->_padname( $invocant->targ ) // return;
Condition50%1/2
$self->_padname($invocant->targ) // (return)
l!l
180
MC/DC0%0/1
$self->_padname($invocant->targ) // (return)
$self->_padname($invocant->targ)
Truth table50%1/2
A
A= $self->_padname($invocant->targ)
Aresult
11
00
1133  
1134 18 my $usage = $self->_usage_of($var);
1135 18 ▶ $usage->{methods} //= [];
Condition50%1/2
$usage->{"methods"} //= []
l!l
018
MC/DC0%0/1
$usage->{"methods"} //= []
$usage->{"methods"}
Truth table50%1/2
A
A= $usage->{"methods"}
Aresult
11
00
1136 0 ▶ push @{ $usage->{methods} }, $method unless any { $_ eq $method } @{ $usage->{methods} };
Subroutine __ANON__: not called CC=1 SCAR=0.4
Branch: 1 branch
BranchTrueFalseTotal
unless &any(sub { $_ eq $method; } , @{$$usage{"methods"};}) 18 0 18
1137 18 return;
1138 }
1139  
1140 56 ▶sub _add_death {
Subroutine _add_death: called CC=2 SCAR=6.9
1141 56 my ( $self, $via, $ancestors ) = @_;
1142 56 ▶ push @{ $self->{rec}{dies} }, {
Branch: 1 branch
BranchTrueFalseTotal
_is_caught($ancestors) ? : 2 54 56
1143 via => $via,
1144 line => $self->{line},
1145 56 caught => _is_caught($ancestors) ? 1 : 0,
1146 };
1147 56 return;
1148 }
1149  
1150 # Inside eval {} or the try block of try/catch, but not inside its catch block.
1151 70 ▶sub _is_caught {
Subroutine _is_caught: called CC=6 SCAR=18.8
1152 70 my ($ancestors) = @_;
1153 70 foreach my $ancestor ( reverse @$ancestors ) {
1154 252 my $name = $ancestor->name;
1155 252 ▶ return 1 if $name eq 'leavetry';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "leavetry" 2 250 252
1156 250 ▶ return 0 if $name eq 'catch';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "catch" 0 250 250
1157 250 ▶ return 1 if $name eq 'leavetrycatch' || $name eq 'entertrycatch';
Branch: 1 branch
BranchTrueFalseTotal
if $name eq "leavetrycatch" or $name eq "entertrycatch" 0 250 250
Condition33%1/3
$name eq "leavetrycatch" or $name eq "entertrycatch"
l!l&&r!l&&!r
00250
MC/DC0%0/2
$name eq "leavetrycatch" or $name eq "entertrycatch"
$name eq "leavetrycatch" $name eq "entertrycatch"
Truth table33%1/3
A or B
A= $name eq "leavetrycatch"B= $name eq "entertrycatch"
ABresult
1X1
011
000
1158 }
1159 68 return 0;
1160 }
1161  
1162 39 ▶sub _on_die {
Subroutine _on_die: called CC=1 SCAR=0.0
1163 39 my ( $self, $op, $ancestors ) = @_;
1164 39 $self->_add_death( $op->name, $ancestors );
1165 39 return;
1166 }
1167  
1168 429 ▶sub _on_return {
Subroutine _on_return: called CC=4 SCAR=13.9
1169 429 my ( $self, $op ) = @_;
1170 429 my @values = _significant_kids($op);
1171 429 my $line = $self->{line};
1172 429 my @evidence;
1173 429 ▶ if ( !@values ) {
Branch: 2 branches
BranchTrueFalseTotal
if (not @values) { } 115 314 429
elsif (@values == 1) { } 304 10 314
1174 115 @evidence = ( { type => 'empty' } );
1175 }
1176 elsif ( @values == 1 ) {
1177 304 @evidence = $self->classify( $values[0] );
1178 }
1179 else {
1180 10 my @items;
1181 10 foreach my $value (@values) {
1182 25 push @items, [ $self->classify($value) ];
1183 }
1184 10 @evidence = ( { type => 'list', count => scalar(@values), items => \@items } );
1185 }
1186 429 push @{ $self->{rec}{returns} }, map { +{ %$_, line => $line, implicit => 0 } } @evidence;
1187 429 return;
1188 }
1189  
1190 458 ▶sub _implicit_returns {
Subroutine _implicit_returns: called CC=2 SCAR=7.1
1191 458 my ( $self, $op ) = @_;
1192 458 ▶ $op = $op->first if $op->name eq 'leavesub';
Branch: 1 branch
BranchTrueFalseTotal
if $op->name eq "leavesub" 458 0 458
1193 458 return $self->_last_values($op);
1194 }
1195  
1196 0 ▶sub _classify_refgen {
Subroutine _classify_refgen: not called CC=8 SCAR=42.8
1197 0 my ( $self, $op ) = @_;
1198 0 my ($kid) = _significant_kids($op);
1199 0 ▶ $kid = _unwrap($kid) if $kid;
Branch: 1 branch
BranchTrueFalseTotal
if $kid 0 0 0
1200 0 ▶ my $kname = $kid ? $kid->name : '';
Branch: 1 branch
BranchTrueFalseTotal
$kid ? : 0 0 0
1201 0 ▶ return { type => 'coderef' } if $kname eq 'anoncode';
Branch: 1 branch
BranchTrueFalseTotal
if $kname eq "anoncode" 0 0 0
1202 0 ▶ return { type => 'arrayref' } if $kname eq 'padav' || $kname eq 'rv2av';
Branch: 1 branch
BranchTrueFalseTotal
if $kname eq "padav" or $kname eq "rv2av" 0 0 0
Condition0%0/3
$kname eq "padav" or $kname eq "rv2av"
l!l&&r!l&&!r
000
MC/DC0%0/2
$kname eq "padav" or $kname eq "rv2av"
$kname eq "padav" $kname eq "rv2av"
Truth table0%0/3
A or B
A= $kname eq "padav"B= $kname eq "rv2av"
ABresult
1X1
011
000
1203 0 ▶ return { type => 'hashref' } if $kname eq 'padhv' || $kname eq 'rv2hv';
Branch: 1 branch
BranchTrueFalseTotal
if $kname eq "padhv" or $kname eq "rv2hv" 0 0 0
Condition0%0/3
$kname eq "padhv" or $kname eq "rv2hv"
l!l&&r!l&&!r
000
MC/DC0%0/2
$kname eq "padhv" or $kname eq "rv2hv"
$kname eq "padhv" $kname eq "rv2hv"
Truth table0%0/3
A or B
A= $kname eq "padhv"B= $kname eq "rv2hv"
ABresult
1X1
011
000
1204 0 return { type => 'ref' };
1205 }
1206  
1207 21 ▶sub _classify_bless {
Subroutine _classify_bless: called CC=5 SCAR=16.2
1208 21 my ( $self, $op ) = @_;
1209 21 my ( undef, $class ) = _significant_kids($op);
1210 21 ▶ return { type => 'object', class => $self->{rec}{package} } if !$class;
Branch: 1 branch
BranchTrueFalseTotal
unless $class 3 18 21
1211 18 $class = _unwrap($class);
1212 18 ▶ return { type => 'object', class => _sv_value( $self->_const_sv($class) ) } if $class->name eq 'const';
Branch: 1 branch
BranchTrueFalseTotal
if $class->name eq "const" 10 8 18
1213  
1214 # bless REF, $class or bless REF, ref($proto) || $proto: the class comes from a variable.
1215 8 ▶ my $from = $class->name eq 'or' ? _unwrap( ( _kids($class) )[-1] ) : $class;
Branch: 1 branch
BranchTrueFalseTotal
$class->name eq 'or' ? : 2 6 8
1216 8 ▶ return { type => 'object', class => undef, class_from => $self->_padname( $from->targ ) } if $from->name eq 'padsv';
Branch: 1 branch
BranchTrueFalseTotal
if $from->name eq "padsv" 8 0 8
1217 0 return { type => 'object', class => undef };
1218 }
1219  
1220 19 1;
1221  
1222 __END__
« lib/Pod/Coverage/More/Analyzer/Perl5_36.pm ↑ Summary lib/Pod/Coverage/More/Types.pm »