PPI/Structure/For.pm

filter: Statementstmt 78.9% 15 / 19 Branchbran 25.0% 1 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 64.7% 22 / 34 CC 4 SCAR 16.4
CC
4
Cov
65%
isa
9.3
BEGIN
1.0
BEGIN
1.0
CRAP 5.2
« PPI/Token/_QuoteEngine.pm ↑ Summary PPI/Transform.pm »
1 package PPI::Structure::For;
2  
3 =pod
4  
5 =head1 NAME
6  
7 PPI::Structure::For - Circular braces for a for expression
8  
9 =head1 SYNOPSIS
10  
11 for ( var $i = 0; $i < $max; $i++ ) {
12 ...
13 }
14  
15 =head1 INHERITANCE
16  
17 PPI::Structure::For
18 isa PPI::Structure
19 isa PPI::Node
20 isa PPI::Element
21  
22 =head1 DESCRIPTION
23  
24 C<PPI::Structure::For> is the class used for circular braces that
25 contain the three part C<for> expression.
26  
27 =head1 METHODS
28  
29 C<PPI::Structure::For> has no methods beyond those provided by the
30 standard L<PPI::Structure>, L<PPI::Node> and L<PPI::Element> methods.
31  
32 =cut
33  
34 62 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 62 ▶use PPI::Structure ();
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 62 ▶use vars qw{$VERSION @ISA};
Subroutine BEGIN: called CC=1 SCAR=0.0
38 BEGIN {
39 62 ▶ $VERSION = '1.236';
Subroutine BEGIN: called CC=1 SCAR=0.0
40 62 @ISA = 'PPI::Structure';
41 }
42  
43 # Highly special custom isa method that will continue to respond
44 # positively to ->isa('PPI::Structure::ForLoop') but warns.
45 62 my $has_warned = 0;
46 sub isa {
47 2031 ▶ if ( $_[1] and $_[1] eq 'PPI::Structure::ForLoop' ) {
Subroutine isa: called CC=4 SCAR=22.3
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if ($_[1] and $_[1] eq "PPI::Structure::ForLoop") 0 2031 2031
Condition33%1/3
$_[1] and $_[1] eq "PPI::Structure::ForLoop"
!ll&&!rl&&r
020310
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
48 0 ▶ unless ( $has_warned ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($has_warned) 0 0 0
49 0 warn("PPI::Structure::ForLoop has been deprecated");
50 0 $has_warned = 1;
51 }
52 0 return 1;
53 }
54 2031 return shift->SUPER::isa(@_);
55 }
56  
57 62 1;
58  
59 =pod
60  
61 =head1 SUPPORT
62  
63 See the L<support section|PPI/SUPPORT> in the main module.
64  
65 =head1 AUTHOR
66  
67 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
68  
69 =head1 COPYRIGHT
70  
71 Copyright 2001 - 2011 Adam Kennedy.
72  
73 This program is free software; you can redistribute
74 it and/or modify it under the same terms as Perl itself.
75  
76 The full text of the license can be found in the
77 LICENSE file included with this module.
78  
79 =cut
« PPI/Token/_QuoteEngine.pm ↑ Summary PPI/Transform.pm »