blib/lib/SOAP/WSDL/XSD/Schema.pm

filter: Statementstmt 89.8% 44 / 49 Branchbran n/a Conditioncond 50.0% 3 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 80.0% 56 / 70 CC 3 SCAR 7.9
CC
3
Cov
85%
find_type
6.0
find_element
2.0
BEGIN
1.0
CRAP 2.2
« blib/lib/SOAP/WSDL/Transport/HTTP.pm ↑ Summary blib/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm »
1 package SOAP::WSDL::XSD::Schema;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Class::Std::Fast::Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use base qw(SOAP::WSDL::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = 3.004;
8  
9 # child elements
10 2 my %attributeGroup_of :ATTR(:name<attributeGroup> :default<[]>);
11 2 my %attribute_of :ATTR(:name<attribute> :default<[]>);
12 2 my %element_of :ATTR(:name<element> :default<[]>);
13 2 my %group_of :ATTR(:name<group> :default<[]>);
14 2 my %type_of :ATTR(:name<type> :default<[]>);
15  
16 # attributes
17 2 my %attributeFormDefault_of :ATTR(:name<attributeFormDefault> :default<unqualified>);
18 2 my %blockDefault_of :ATTR(:name<blockDefault> :default<()>);
19 2 my %elementFormDefault_of :ATTR(:name<elementFormDefault> :default<unqualified>);
20 2 my %finalDefault_of :ATTR(:name<finalDefault> :default<()>);
21 2 my %version_of :ATTR(:name<version> :default<()>);
22  
23 # id
24 # name
25 # targetNamespace inherited from Base
26 # xmlns
27  
28 #
29 # attributeFormDefault = (qualified | unqualified) : unqualified
30 # blockDefault = (#all | List of (extension | restriction | substitution)) : ''
31 # elementFormDefault = (qualified | unqualified) : unqualified
32 # finalDefault = (#all | List of (extension | restriction | list | union)) : ''
33 # id = ID
34 # targetNamespace = anyURI
35 # version = token
36 # xml:lang = language
37 #
38 #
39 # alias type with all variants
40 # AUTOMETHOD is WAY too slow..
41 {
42 2 ▶ no strict qw/refs/;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 2 for my $name (qw(simpleType complexType) ) {
44 4 *{ "set_$name" } = \&set_type;
45 4 *{ "get_$name" } = \&get_type;
46 4 *{ "push_$name" } = \&push_type;
47 4 *{ "find_$name" } = \&find_type;
48 }
49 }
50  
51 44 ▶sub push_type {
Subroutine push_type: called CC=1 SCAR=0.0
Pod undocumented
52 # use $_[n] for performance -
53 # we're called on each and every type inside WSDL
54 44 push @{ $type_of{ ident $_[0]} }, $_[1];
55 }
56  
57 5 ▶sub find_element {
Subroutine find_element: called CC=2 SCAR=6.9
Pod undocumented
58 5 my ($self, @args) = @_;
59 my @found_at = grep {
60 9 ▶ $_->get_targetNamespace() eq $args[0] &&
Condition100%3/3
$_->get_targetNamespace eq $args[0] && $_->get_name eq $args[1]
!ll&&!rl&&r
612
MC/DC100%2/2
$_->get_targetNamespace eq $args[0] && $_->get_name eq $args[1]
$_->get_targetNamespace eq $args[0] $_->get_name eq $args[1]
Truth table100%3/3
A && B
A= $_->get_targetNamespace eq $args[0]B= $_->get_name eq $args[1]
ABresult
0X0
100
111
61 # warn $_->get_name() . " default NS:" . $_->get_xmlns()->{'#default'} . "\n";
62 # $_->get_xmlns()->{'#default'} eq $args[0] &&
63 $_->get_name() eq $args[1]
64 }
65 5 @{ $element_of{ ident $self } };
66 5 return $found_at[0];
67 }
68  
69 0 ▶sub find_type {
Subroutine find_type: not called CC=2 SCAR=17.9
Pod undocumented
70 0 my ($self, @args) = @_;
71 my @found_at = grep {
72 0 ▶ $_->get_targetNamespace() eq $args[0] &&
Condition0%0/3
$_->get_targetNamespace eq $args[0] && $_->get_name eq $args[1]
!ll&&!rl&&r
000
MC/DC0%0/2
$_->get_targetNamespace eq $args[0] && $_->get_name eq $args[1]
$_->get_targetNamespace eq $args[0] $_->get_name eq $args[1]
Truth table0%0/3
A && B
A= $_->get_targetNamespace eq $args[0]B= $_->get_name eq $args[1]
ABresult
0X0
100
111
73 # $_->get_xmlns()->{'#default'} eq $args[0] &&
74 $_->get_name() eq $args[1]
75 }
76 0 @{ $type_of{ ident $self } };
77 0 return $found_at[0];
78 }
79  
80 2 1;
« blib/lib/SOAP/WSDL/Transport/HTTP.pm ↑ Summary blib/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm »