| 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
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 19 | 58 | my $self = {@_}; | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 58 | ▶ | unless ($self->{attributes}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 22 | 58 | $self->{attributes} = []; | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | 58 | ▶ | unless ($self->{attributeInfo}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | 58 | $self->{attributeInfo} = {}; | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 58 | ▶ | unless ($self->{elements}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | 58 | $self->{elements} = []; | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | 58 | ▶ | unless ($self->{elementInfo}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 32 | 58 | $self->{elementInfo} = {}; | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | 58 | ▶ | unless ($self->{contentType}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 35 | 58 | $self->{contentType} = "complex"; | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 58 | ▶ | unless (defined($self->{attributePrefix})) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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
MC/DC0%0/2
$self->xAttributes || $self->attributes
$self->xAttributes
$self->attributes
Truth table33%1/3
A || B
A= $self->xAttributesB= $self->attributes
| |||||||||||||||||||||
| 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
MC/DC0%0/2
$self->xAttributeInfo || $self->attributeInfo
$self->xAttributeInfo
$self->attributeInfo
Truth table33%1/3
A || B
A= $self->xAttributeInfoB= $self->attributeInfo
| |||||||||||||||||||||
| 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
MC/DC0%0/2
$self->xElements || $self->elements
$self->xElements
$self->elements
Truth table33%1/3
A || B
A= $self->xElementsB= $self->elements
| |||||||||||||||||||||
| 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
MC/DC0%0/2
$self->xElementInfo || $self->elementInfo
$self->xElementInfo
$self->elementInfo
Truth table66%2/3
A || B
A= $self->xElementInfoB= $self->elementInfo
| |||||||||||||||||||||
| 75 | } | ||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 10 | 1; | |||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | __END__ | ||||||||||||||||||||