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

filter: Statementstmt 90.3% 47 / 52 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 3 totaltotal 83.8% 57 / 68 CC 3 SCAR 7.4
CC
3
Cov
88%
find_type
6.0
find_element
2.0
BEGIN
1.0
CRAP 2.1
« blib/lib/SOAP/WSDL/XSD/Typelib/Builtin/date.pm ↑ Summary blib/lib/SOAP/WSDL/Transport/HTTP.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 ▶use version; our $VERSION = qv('3.00.0_2');
Subroutine BEGIN: called CC=1 SCAR=0.0
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 sub push_type {
52 # use $_[n] for performance -
53 # we're called on each and every type inside WSDL
54 44 ▶ push @{ $type_of{ ident $_[0]} }, $_[1];
Subroutine push_type: called CC=1 SCAR=0.0
Pod undocumented
55 }
56  
57 sub find_element {
58 5 ▶ my ($self, @args) = @_;
Subroutine find_element: called CC=2 SCAR=6.9
Pod undocumented
59 my @found_at = grep {
60 9 ▶ $_->get_targetNamespace() eq $args[0] &&
Branch: 1 branch
BranchTrueFalseTotal
$_->get_targetNamespace eq $args[0] and $_->get_name eq $args[1] 3 6 9
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 sub find_type {
70 0 ▶ my ($self, @args) = @_;
Subroutine find_type: not called CC=2 SCAR=17.9
Pod undocumented
71 my @found_at = grep {
72 0 ▶ $_->get_targetNamespace() eq $args[0] &&
Branch: 1 branch
BranchTrueFalseTotal
$_->get_targetNamespace eq $args[0] and $_->get_name eq $args[1] 0 0 0
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/XSD/Typelib/Builtin/date.pm ↑ Summary blib/lib/SOAP/WSDL/Transport/HTTP.pm »