PPI/Statement/Given.pm

filter: Statementstmt 81.8% 9 / 11 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 66.6% 2 / 3 Podpod n/a totaltotal 47.8% 11 / 23 CC 3 SCAR 20.3
CC
3
Cov
53%
_complete
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.6
« PPI/Token/Operator.pm ↑ Summary PPI/Statement/When.pm »
1 package PPI::Statement::Given;
2  
3 =pod
4  
5 =head1 NAME
6  
7 PPI::Statement::Given - A given-when statement
8  
9 =head1 SYNOPSIS
10  
11 given ( foo ) {
12 say $_;
13 }
14  
15 =head1 INHERITANCE
16  
17 PPI::Statement::Given
18 isa PPI::Statement
19 isa PPI::Node
20 isa PPI::Element
21  
22 =head1 DESCRIPTION
23  
24 C<PPI::Statement::Given> objects are used to describe switch statements, as
25 described in L<perlsyn>.
26  
27 =head1 METHODS
28  
29 C<PPI::Statement::Given> 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 63 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 63 ▶use PPI::Statement ();
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 63 our $VERSION = '1.260'; # VERSION
38  
39 63 our @ISA = "PPI::Statement";
40  
41 # Lexer clues
42 sub __LEXER__normal() { '' }
43  
44 sub _complete {
45 0 ▶ my $child = $_[0]->schild(-1);
Subroutine _complete: not called CC=3 SCAR=24.8
46 return !! (
47 0 ▶ defined $child
Condition0%0/6
defined $child && $child->isa('PPI::Structure::Block') && $child->complete
!ll&&!rl&&r
000
defined $child and $child->isa("PPI::Structure::Block")
!ll&&!rl&&r
000
MC/DC0%0/3
defined $child && $child->isa('PPI::Structure::Block') && $child->complete
defined $child $child->isa("PPI::Structure::Block") $child->complete
Truth table0%0/4
A and B && C
A= defined $childB= $child->isa("PPI::Structure::Block")C= $child->complete
ABCresult
0XX0
10X0
1100
1111
48 and
49 $child->isa('PPI::Structure::Block')
50 and
51 $child->complete
52 );
53 }
54  
55  
56  
57  
58  
59 #####################################################################
60 # PPI::Node Methods
61  
62 sub scope() { 1 }
63  
64 63 1;
65  
66 =pod
67  
68 =head1 TO DO
69  
70 - Write unit tests for this package
71  
72 =head1 SUPPORT
73  
74 See the L<support section|PPI/SUPPORT> in the main module.
75  
76 =head1 AUTHOR
77  
78 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
79  
80 =head1 COPYRIGHT
81  
82 Copyright 2001 - 2011 Adam Kennedy.
83  
84 This program is free software; you can redistribute
85 it and/or modify it under the same terms as Perl itself.
86  
87 The full text of the license can be found in the
88 LICENSE file included with this module.
89  
90 =cut
« PPI/Token/Operator.pm ↑ Summary PPI/Statement/When.pm »