PPI/Structure/List.pm

filter: Statementstmt 71.4% 15 / 21 Branchbran 16.6% 1 / 6 Conditioncond 16.6% 1 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 50.0% 21 / 42 CC 6 SCAR 28.1
CC
6
Cov
52%
isa
24.4
BEGIN
1.0
BEGIN
1.0
CRAP 16.6
« PPI/Dumper.pm ↑ Summary PPI/Token/Number.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 63 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 63 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
38 63 ▶use PPI::Structure ();
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 63 our $VERSION = '1.260'; # VERSION
41  
42 63 our @ISA = "PPI::Structure";
43  
44 # Highly special custom isa method that will continue to respond
45 # positively to ->isa('PPI::Structure::ForLoop') but warns.
46 63 my $has_warned = 0;
47 sub isa {
48 91875 ▶ 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 91875 91875
Condition33%1/3
$_[1] and $_[1] eq "PPI::Structure::ForLoop"
!ll&&!rl&&r
0918750
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
49 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
50 $_[0]->parent->isa('PPI::Statement::Compound')
51 and
52 $_[0]->parent->type =~ /^for/
53 ) {
54 0 ▶ unless ( $has_warned ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($has_warned) 0 0 0
55 0 local $Carp::CarpLevel = $Carp::CarpLevel + 1;
56 0 Carp::carp("PPI::Structure::ForLoop has been deprecated");
57 0 $has_warned = 1;
58 }
59 0 return 1;
60 }
61 }
62 91875 return shift->SUPER::isa(@_);
63 }
64  
65 63 1;
66  
67 =pod
68  
69 =head1 SUPPORT
70  
71 See the L<support section|PPI/SUPPORT> in the main module.
72  
73 =head1 AUTHOR
74  
75 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
76  
77 =head1 COPYRIGHT
78  
79 Copyright 2001 - 2011 Adam Kennedy.
80  
81 This program is free software; you can redistribute
82 it and/or modify it under the same terms as Perl itself.
83  
84 The full text of the license can be found in the
85 LICENSE file included with this module.
86  
87 =cut
« PPI/Dumper.pm ↑ Summary PPI/Token/Number.pm »