lib/Perl/ToPerl6/TransformerParameter/Behavior/Boolean.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 40 / 40 CC 3 SCAR 5.1
CC
3
Cov
100%
_parse
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« lib/Perl/ToPerl6/ProfilePrototype.pm ↑ Summary lib/Perl/ToPerl6/Transformer/BasicTypes/Strings/AddWhitespace.pm »
1 package Perl::ToPerl6::TransformerParameter::Behavior::Boolean;
2  
3 23 ▶use 5.006001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 23 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 23 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 23 ▶use Perl::ToPerl6::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 23 ▶use base qw{ Perl::ToPerl6::TransformerParameter::Behavior };
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 #-----------------------------------------------------------------------------
11  
12 46 ▶sub _parse {
Subroutine _parse: called CC=3 SCAR=11.0
13 46 my ($transformer, $parameter, $config_string) = @_;
14  
15 46 my $value;
16 46 my $value_string = $parameter->get_default_string();
17  
18 46 ▶ if (defined $config_string) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $config_string) 8 38 46
19 8 $value_string = $config_string;
20 }
21  
22 46 ▶ if ( $value_string ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value_string) { } 4 42 46
23 4 $value = $TRUE;
24 } else {
25 42 $value = $FALSE;
26 }
27  
28 46 $transformer->__set_parameter_value($parameter, $value);
29  
30 46 return;
31 }
32  
33 #-----------------------------------------------------------------------------
34  
35 41 ▶sub initialize_parameter {
Subroutine initialize_parameter: called CC=1 SCAR=0.0
Pod documented
36 41 my ($self, $parameter, $specification) = @_;
37  
38 41 $parameter->_set_parser(\&_parse);
39  
40 41 return;
41 }
42  
43 #-----------------------------------------------------------------------------
44  
45 23 1;
46  
47 __END__
« lib/Perl/ToPerl6/ProfilePrototype.pm ↑ Summary lib/Perl/ToPerl6/Transformer/BasicTypes/Strings/AddWhitespace.pm »