Aladdin/Item/DVD.pm

filter: Statementstmt 40.7% 11 / 27 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 32.5% 14 / 43 CC 7 SCAR 36.8
CC
7
Cov
31%
init
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 39.5
↑ Summary Aladdin/Item/Music.pm »
1 package WebService::Aladdin::Item::DVD;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use base qw(WebService::Aladdin::Item);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 __PACKAGE__->mk_accessors(qw/dvdinfo/);
9  
10 0 ▶sub init {
Subroutine init: not called CC=7 SCAR=40.3
Pod undocumented
11 0 my ($self, $info) = @_;
12  
13 0 my $data;
14 0 foreach my $key (keys %{ $info }) {
15 0 my $type = $key;
16 0 $type =~ s/^aladdin://;
17 0 ▶ if ($type eq 'authors' && $info->{'aladdin:authors'}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq 'authors' and $info->{'aladdin:authors'}) { } 0 0 0
Condition0%0/3
$type eq "authors" and $info->{"aladdin:authors"}
!ll&&!rl&&r
000
MC/DC0%0/2
$type eq "authors" and $info->{"aladdin:authors"}
$type eq "authors" $info->{"aladdin:authors"}
Truth table0%0/3
A and B
A= $type eq "authors"B= $info->{"aladdin:authors"}
ABresult
0X0
100
111
18 0 my $author = $info->{'aladdin:authors'}->{'aladdin:author'};
19 0 ▶ if (ref($author) eq 'HASH') {
Branch: 2 branches
BranchTrueFalseTotal
if (ref $author eq 'HASH') { } 0 0 0
elsif (ref $author eq 'ARRAY') { } 0 0 0
20 $data->{'author'} = {
21 authorid => $author->{'-authorid'},
22 authorType => $author->{'authorType'},
23 text => $author->{'#text'},
24 0 desc => $author->{'-desc'},
25 };
26 }
27 elsif (ref($author) eq 'ARRAY') {
28 0 foreach my $p (@{ $info->{'aladdin:authors'}->{'aladdin:author'} }) {
29 0 unshift @{ $data->{$type} }, {
30 authorid => $p->{'-authorid'},
31 authorType => $p->{'-authorType'},
32 text => $p->{'#text'},
33 0 desc => $p->{'-desc'},
34 };
35 }
36 }
37 }
38 else {
39 0 $data->{$type} = $info->{$key};
40 }
41 }
42 0 $self->dvdinfo($data);
43 }
44  
45 2 1;
↑ Summary Aladdin/Item/Music.pm »