IMDB/CreditList.pm

filter: Statementstmt 57.5% 19 / 33 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 46.1% 24 / 52 CC 5 SCAR 27.4
CC
5
Cov
44%
_new
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 15.5
« IMDB/Title.pm ↑ Summary IMDB/QuoteLine.pm »
1 # $Id: CreditList.pm 7370 2012-04-09 01:17:33Z chris $
2  
3 =head1 NAME
4  
5 WebService::IMDB::CreditList
6  
7 =cut
8  
9 package WebService::IMDB::CreditList;
10  
11 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 our $VERSION = '0.05';
15  
16 2 ▶use base qw(Class::Accessor);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 our @CARP_NOT = qw(WebService::IMDB WebService::IMDB::Title);
20  
21 2 ▶use WebService::IMDB::Credit;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 __PACKAGE__->mk_accessors(qw(
24 label
25 list
26 token
27 ));
28  
29  
30 =head1 METHODS
31  
32 =head2 label
33  
34 =head2 list
35  
36 =head2 token
37  
38 =cut
39  
40 0 ▶sub _new {
Subroutine _new: not called CC=5 SCAR=34.0
41 0 my $class = shift;
42 0 my $ws = shift;
43 0 ▶ my $data = shift or die;
Branch: 1 branch
BranchTrueFalseTotal
my $data = shift() or die 0 0 0
44  
45 0 my $self = {};
46  
47 0 bless $self, $class;
48  
49 0 $self->label($data->{'label'});
50 0 ▶ if ($data->{'token'} eq "writers" && scalar @{$data->{'list'}} > 0 && exists $data->{'list'}->[0]->{'rewrite'}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{'token'} eq 'writers' and scalar @{$data->{'list'};} > 0 and exists $data->{'list'}[0]{'rewrite'}) { } 0 0 0
Condition0%0/6
$data->{"token"} eq "writers" and scalar @{$data->{"list"};} > 0 and exists $data->{"list"}[0]{"rewrite"}
!ll&&!rl&&r
000
$data->{"token"} eq "writers" and scalar @{$data->{"list"};} > 0
!ll&&!rl&&r
000
MC/DC0%0/3
$data->{"token"} eq "writers" and scalar @{$data->{"list"};} > 0 and exists $data->{"list"}[0]{"rewrite"}
$data->{"token"} eq "writers" scalar @{$data->{"list"};} > 0 exists $data->{"list"}[0]{"rewrite"}
Truth table0%0/4
A and B and C
A= $data->{"token"} eq "writers"B= scalar @{$data->{"list"};} > 0C= exists $data->{"list"}[0]{"rewrite"}
ABCresult
0XX0
10X0
1100
1111
51 # TODO: How to parse this correctly?
52 0 $self->list([]);
53 } else {
54 0 $self->list([ map { WebService::IMDB::Credit->_new($ws, $_) } @{$data->{'list'}}]);
55 }
56 0 $self->token($data->{'token'});
57  
58 0 return $self;
59 }
60  
61 2 1;
« IMDB/Title.pm ↑ Summary IMDB/QuoteLine.pm »