blib/lib/XML/Pastor/Schema/ComplexType.pm

filter: Statementstmt 100% 42 / 42 Branchbran 50.0% 6 / 12 Conditioncond 40.0% 6 / 15 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 100% 10 / 10 Podpod 100% 5 / 5 totaltotal 73.4% 69 / 94 CC 12 SCAR 15.1
CC
12
Cov
78%
new
9.1
effectiveAttributes
2.3
effectiveAttributeInfo
2.3
CRAP 4.5
« blib/lib/XML/Pastor/Schema/Context.pm ↑ Summary blib/lib/XML/Pastor/Builtin/date.pm »
1 10 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 10 ▶no warnings qw(uninitialized);
Subroutine BEGIN: called CC=1 SCAR=0.0
5
6
7 #==================================================
8 package XML::Pastor::Schema::ComplexType;
9
10 10 ▶use XML::Pastor::Schema::Type;
Subroutine BEGIN: called CC=1 SCAR=0.0
11
12 10 our @ISA = qw(XML::Pastor::Schema::Type);
13
14 10 XML::Pastor::Schema::ComplexType->mk_accessors(qw(attributes attributeInfo attributePrefix elements elementInfo isSimpleContent xAttributes xAttributeInfo xElements xElementInfo));
15
16 58 ▶sub new {
Subroutine new: called CC=8 SCAR=22.1
Pod documented
17 58 my $proto = shift;
18 58 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
0580
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
19 58 my $self = {@_};
20
21 58 ▶ unless ($self->{attributes}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"attributes"}) 58 0 58
22 58 $self->{attributes} = [];
23 }
24 58 ▶ unless ($self->{attributeInfo}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"attributeInfo"}) 58 0 58
25 58 $self->{attributeInfo} = {};
26 }
27
28 58 ▶ unless ($self->{elements}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"elements"}) 58 0 58
29 58 $self->{elements} = [];
30 }
31 58 ▶ unless ($self->{elementInfo}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"elementInfo"}) 58 0 58
32 58 $self->{elementInfo} = {};
33 }
34 58 ▶ unless ($self->{contentType}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"contentType"}) 58 0 58
35 58 $self->{contentType} = "complex";
36 }
37
38 58 ▶ unless (defined($self->{attributePrefix})) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"attributePrefix"}) 58 0 58
39 58 $self->{attributePrefix} = "_"; # Default value. No need to change this for now.
40 }
41
42 58 return bless $self, $class;
43 }
44
45 #-----------------------------------------------------------------
46 # Return effective attributes, including those that may come from base classes.
47 #-----------------------------------------------------------------
48 109 ▶sub effectiveAttributes {
Subroutine effectiveAttributes: called CC=2 SCAR=8.1
Pod documented
49 109 my $self = shift;
50 109 ▶ return ($self->xAttributes() || $self->attributes());
Condition33%1/3
$self->xAttributes || $self->attributes
l!l&&r!l&&!r
01090
MC/DC0%0/2
$self->xAttributes || $self->attributes
$self->xAttributes $self->attributes
Truth table33%1/3
A || B
A= $self->xAttributesB= $self->attributes
ABresult
1X1
011
000
51 }
52
53 #-----------------------------------------------------------------
54 # Return effective attributeInfo, including those that may come from base classes.
55 #-----------------------------------------------------------------
56 76 ▶sub effectiveAttributeInfo {
Subroutine effectiveAttributeInfo: called CC=2 SCAR=8.1
Pod documented
57 76 my $self = shift;
58 76 ▶ return ($self->xAttributeInfo() || $self->attributeInfo());
Condition33%1/3
$self->xAttributeInfo || $self->attributeInfo
l!l&&r!l&&!r
0760
MC/DC0%0/2
$self->xAttributeInfo || $self->attributeInfo
$self->xAttributeInfo $self->attributeInfo
Truth table33%1/3
A || B
A= $self->xAttributeInfoB= $self->attributeInfo
ABresult
1X1
011
000
59 }
60
61 #-----------------------------------------------------------------
62 # Return effective elements, including those that may come from base classes.
63 #-----------------------------------------------------------------
64 109 ▶sub effectiveElements {
Subroutine effectiveElements: called CC=2 SCAR=8.1
Pod documented
65 109 my $self = shift;
66 109 ▶ return ($self->xElements() || $self->elements());
Condition33%1/3
$self->xElements || $self->elements
l!l&&r!l&&!r
01090
MC/DC0%0/2
$self->xElements || $self->elements
$self->xElements $self->elements
Truth table33%1/3
A || B
A= $self->xElementsB= $self->elements
ABresult
1X1
011
000
67 }
68
69 #-----------------------------------------------------------------
70 # Return effective elementInfo, including those that may come from base classes.
71 #-----------------------------------------------------------------
72 164 ▶sub effectiveElementInfo {
Subroutine effectiveElementInfo: called CC=2 SCAR=7.1
Pod documented
73 164 my $self = shift;
74 164 ▶ return ($self->xElementInfo() || $self->elementInfo());
Condition66%2/3
$self->xElementInfo || $self->elementInfo
l!l&&r!l&&!r
21620
MC/DC0%0/2
$self->xElementInfo || $self->elementInfo
$self->xElementInfo $self->elementInfo
Truth table66%2/3
A || B
A= $self->xElementInfoB= $self->elementInfo
ABresult
1X1
011
000
75 }
76
77 10 1;
78
79 __END__
« blib/lib/XML/Pastor/Schema/Context.pm ↑ Summary blib/lib/XML/Pastor/Builtin/date.pm »