DVDProfiler.pm

filter: Statementstmt 32.0% 8 / 25 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 25.0% 2 / 8 Podpod 83.3% 5 / 6 totaltotal 31.2% 15 / 48 CC 4 SCAR 16.6
CC
4
Cov
25%
new
12.0
getList
6.0
getAll
2.0
CRAP 5.3
↑ Summary DVDProfiler/DVD.pm »
1 package Net::DVDProfiler;
2  
3 1 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Net::DVDProfiler::DVD;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = 0.03;
7  
8 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
9 0 my $ref = shift;
10 0 ▶ my $class = ref( $ref ) || $ref;
Condition0%0/3
ref $ref || $ref
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $ref || $ref
ref $ref $ref
Truth table0%0/3
A || B
A= ref $refB= $ref
ABresult
1X1
011
000
11  
12 0 my $self = bless {
13 lwp => new LWP::UserAgent( cookie_jar => {} ),
14 alias => undef,
15 @_
16 }, $class;
17  
18 0 ▶ die "DVDProfiler requires an alias." unless ( $self->{alias} );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"alias"} 0 0 0
19  
20 0 $self->{lwp}->get( 'http://www.dvdprofiler.com/mycollection.asp?alias=' . $self->{alias} );
21 0 $self->{lwp}->get( 'http://www.dvdprofiler.com/mycollection.asp?acceptadult=true&alias=' . $self->{alias} );
22  
23 0 return $self;
24 }
25  
26 0 ▶sub getAll {
Subroutine getAll: not called CC=1 SCAR=6.9
Pod documented
27 0 return $_[0]->getList( 'A' );
28 }
29  
30 0 ▶sub getOwned {
Subroutine getOwned: not called CC=1 SCAR=6.9
Pod documented
31 0 return $_[0]->getList( 'O' );
32 }
33  
34 0 ▶sub getOrdered {
Subroutine getOrdered: not called CC=1 SCAR=6.9
Pod documented
35 0 return $_[0]->getList( 'P' );
36 }
37  
38 0 ▶sub getWishlist {
Subroutine getWishlist: not called CC=1 SCAR=6.9
Pod documented
39 0 return $_[0]->getList( 'W' );
40 }
41  
42 0 ▶sub getList {
Subroutine getList: not called CC=2 SCAR=17.9
Pod undocumented
43 0 my ( $self, $type ) = @_;
44  
45 0 my @upcs;
46 0 my $page = $u->get( 'http://www.dvdprofiler.com/dvdpro/mycollection/styles/Default/list.asp?type=' . $type )->content();
47  
48 0 ▶ while ( $page =~ /id="([^"]*)".*?entry">(.*?)<\/A>/g ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($page =~ m[id="([^"]*)".*?entry">(.*?)</A>]g) 0 0 0
49 0 push( @upcs, new Net::DVDProfiler::DVD( upc => $1, title => $2 ) );
50 }
51  
52 0 return @upcs;
53 }
54 1 1;
55  
56 __END__
↑ Summary DVDProfiler/DVD.pm »