blib/lib/SOAP/WSDL/XSD/Typelib/Builtin/anySimpleType.pm

filter: Statementstmt 100% 46 / 46 Branchbran 100% 8 / 8 Conditioncond 100% 5 / 5 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 13 / 13 Podpod 0.0% 0 / 6 totaltotal 92.5% 75 / 81 CC 7 SCAR 7.2
CC
7
Cov
100%
new
4.0
serialize
3.0
as_string
2.0
CRAP 2.1
« blib/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm ↑ Summary blib/lib/SOAP/WSDL/Binding.pm »
1 package SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
2 83 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 83 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 83 ▶use Class::Std::Fast::Storable constructor => 'none', cache => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 83 ▶use SOAP::WSDL::XSD::Typelib::Builtin::anyType;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 83 ▶use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 83 my %value_of :ATTR(:get<value> :init_arg<value> :default<()>);
9  
10 # don't you never dare to play with this !
11 83 our $___value = \%value_of;
12  
13 ## use $_[n] for speed - we get called zillions of times...
14 # and we don't need to return the last value...
15 72 ▶sub set_value { $value_of{ ${ $_[0] } } = $_[1] }
Subroutine set_value: called CC=1 SCAR=0.0
Pod undocumented
16  
17 # Default attribute handling
18 # TODO add something for handling default attributes
19 1 ▶sub attr {
Subroutine attr: called CC=1 SCAR=0.0
Pod undocumented
20 }
21  
22 # use $_[n] for speed.
23 # This is less readable, but notably faster.
24 #
25 # use postfix-if for speed. This is slightly faster, as it saves
26 # perl from creating a pad (variable context).
27 #
28 # The methods below may get called zillions of times, so
29 # every little statement matters...
30  
31 7 ▶sub serialize {
Subroutine serialize: called CC=3 SCAR=11.0
Pod undocumented
32 7 ▶ $_[1] ||= {};
Condition100%2/2
$_[1] ||= {}
l!l
25
MC/DC100%1/1
$_[1] ||= {}
$_[1]
Truth table100%2/2
A
A= $_[1]
Aresult
11
00
33 7 ▶ if (not defined $value_of{ ${$_[0]} }) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $value_of{${$_[0];}}) 3 4 7
34 3 return $_[0]->start_tag({ %{ $_[1] }, nil => 1 }, undef);
35 }
36 return join q{}
37 4 , $_[0]->start_tag($_[1], $value_of{ ${$_[0]} })
38 4 , $value_of{ ${$_[0]} }
39 , $_[0]->end_tag($_[1]);
40 }
41  
42 91 ▶sub as_string :STRINGIFY {
Subroutine as_string: called CC=2 SCAR=6.9
Pod undocumented
43 91 ▶ return defined($value_of { ${ $_[0] } }) ? $value_of { ${ $_[0] } } : q{};
Branch: 1 branch
BranchTrueFalseTotal
defined $value_of{${$_[0];}} ? : 89 2 91
44 83 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 15 ▶sub as_bool :BOOLIFY {
Subroutine as_bool: called CC=1 SCAR=0.0
Pod undocumented
47 15 return $value_of { ${ $_[0] } };
48 83 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
49  
50 83 my $OBJECT_CACHE_REF = Class::Std::Fast::OBJECT_CACHE_REF();
51  
52 205 ▶sub new {
Subroutine new: called CC=4 SCAR=13.9
Pod undocumented
53 205 my $self = pop @{ $OBJECT_CACHE_REF->{ $_[0] } };
54 205 ▶ $self = bless \(my $o = Class::Std::Fast::ID()), $_[0]
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self 132 73 205
55 if not defined $self;
56 $value_of{ $$self } = $_[1]->{ value }
57 205 ▶ if (($#_) && exists $_[1]->{ value });
Branch: 1 branch
BranchTrueFalseTotal
if $#_ and exists $_[1]{"value"} 106 99 205
Condition100%3/3
$#_ and exists $_[1]{"value"}
!ll&&!rl&&r
7821106
MC/DC100%2/2
$#_ and exists $_[1]{"value"}
$#_ exists $_[1]{"value"}
Truth table100%3/3
A and B
A= $#_B= exists $_[1]{"value"}
ABresult
0X0
100
111
58 205 return $self;
59 }
60  
61 83 Class::Std::initialize(); # make :BOOLIFY overloading serializable
62  
63 83 1;
« blib/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm ↑ Summary blib/lib/SOAP/WSDL/Binding.pm »