PPI/Structure/List.pm

filter: Statementstmt 75.0% 18 / 24 Branchbran 16.6% 1 / 6 Conditioncond 16.6% 1 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 55.3% 26 / 47 CC 6 SCAR 26.2
CC
6
Cov
56%
isa
24.4
BEGIN
1.0
BEGIN
1.0
CRAP 13.8
« PPI/Dumper.pm ↑ Summary PPI/Document/Normalized.pm »
1 package PPI::Structure::List;
2  
3 =pod
4  
5 =head1 NAME
6  
7 PPI::Structure::List - Explicit list or precedence ordering braces
8  
9 =head1 SYNOPSIS
10  
11 # A list used for params
12 function( 'param', 'param' );
13
14 # Explicit list
15 return ( 'foo', 'bar' );
16  
17 =head1 INHERITANCE
18  
19 PPI::Structure::List
20 isa PPI::Structure
21 isa PPI::Node
22 isa PPI::Element
23  
24 =head1 DESCRIPTION
25  
26 C<PPI::Structure::List> is the class used for circular braces that
27 represent lists, and related.
28  
29 =head1 METHODS
30  
31 C<PPI::Structure::List> has no methods beyond those provided by the
32 standard L<PPI::Structure>, L<PPI::Node> and L<PPI::Element> methods.
33  
34 =cut
35  
36 62 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 62 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
38 62 ▶use PPI::Structure ();
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 62 ▶use vars qw{$VERSION @ISA};
Subroutine BEGIN: called CC=1 SCAR=0.0
41 BEGIN {
42 62 ▶ $VERSION = '1.236';
Subroutine BEGIN: called CC=1 SCAR=0.0
43 62 @ISA = 'PPI::Structure';
44 }
45  
46 # Highly special custom isa method that will continue to respond
47 # positively to ->isa('PPI::Structure::ForLoop') but warns.
48 62 my $has_warned = 0;
49 sub isa {
50 87265 ▶ if ( $_[1] and $_[1] eq 'PPI::Structure::ForLoop' ) {
Subroutine isa: called CC=6 SCAR=32.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($_[1] and $_[1] eq "PPI::Structure::ForLoop") 0 87265 87265
Condition33%1/3
$_[1] and $_[1] eq "PPI::Structure::ForLoop"
!ll&&!rl&&r
0872650
MC/DC0%0/2
$_[1] and $_[1] eq "PPI::Structure::ForLoop"
$_[1] $_[1] eq "PPI::Structure::ForLoop"
Truth table33%1/3
A and B
A= $_[1]B= $_[1] eq "PPI::Structure::ForLoop"
ABresult
0X0
100
111
51 0 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if ($_[0]->parent->isa("PPI::Statement::Compound") and $_[0]->parent->type =~ /^for/) 0 0 0
Condition0%0/3
$_[0]->parent->isa("PPI::Statement::Compound") and $_[0]->parent->type =~ /^for/
!ll&&!rl&&r
000
MC/DC0%0/2
$_[0]->parent->isa("PPI::Statement::Compound") and $_[0]->parent->type =~ /^for/
$_[0]->parent->isa("PPI::Statement::Compound") $_[0]->parent->type =~ /^for/
Truth table0%0/3
A and B
A= $_[0]->parent->isa("PPI::Statement::Compound")B= $_[0]->parent->type =~ /^for/
ABresult
0X0
100
111
52 $_[0]->parent->isa('PPI::Statement::Compound')
53 and
54 $_[0]->parent->type =~ /^for/
55 ) {
56 0 ▶ unless ( $has_warned ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($has_warned) 0 0 0
57 0 local $Carp::CarpLevel = $Carp::CarpLevel + 1;
58 0 Carp::carp("PPI::Structure::ForLoop has been deprecated");
59 0 $has_warned = 1;
60 }
61 0 return 1;
62 }
63 }
64 87265 return shift->SUPER::isa(@_);
65 }
66  
67 62 1;
68  
69 =pod
70  
71 =head1 SUPPORT
72  
73 See the L<support section|PPI/SUPPORT> in the main module.
74  
75 =head1 AUTHOR
76  
77 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
78  
79 =head1 COPYRIGHT
80  
81 Copyright 2001 - 2011 Adam Kennedy.
82  
83 This program is free software; you can redistribute
84 it and/or modify it under the same terms as Perl itself.
85  
86 The full text of the license can be found in the
87 LICENSE file included with this module.
88  
89 =cut
« PPI/Dumper.pm ↑ Summary PPI/Document/Normalized.pm »