Client/v2.pm

filter: Statementstmt 36.6% 11 / 30 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 26.4% 14 / 53 CC 11 SCAR 46.4
CC
11
Cov
23%
validate
132.0
BEGIN
1.0
BEGIN
1.0
CRAP 103.9
↑ Summary Client.pm »
1 package Net::DAAP::Client::v2;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Digest::MD5;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 my @seeds;
7 0 ▶sub validate {
Subroutine validate: not called CC=11 SCAR=48.8
Pod undocumented
8 0 my $self = shift;
9 0 my ($url, $select) = @_;
10 0 ▶ unless (@seeds) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@seeds) 0 0 0
11 0 for my $i (0..255) {
12 0 my $ctx = Digest::MD5->new;
13 0 ▶ $ctx->add( $i & 0x80 ? "Accept-Language" : "user-agent" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 128 ? : 0 0 0
14 0 ▶ $ctx->add( $i & 0x40 ? "max-age" : "Authorization" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 64 ? : 0 0 0
15 0 ▶ $ctx->add( $i & 0x20 ? "Client-DAAP-Version" : "Accept-Encoding" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 32 ? : 0 0 0
16 0 ▶ $ctx->add( $i & 0x10 ? "daap.protocolversion": "daap.songartist" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 16 ? : 0 0 0
17 0 ▶ $ctx->add( $i & 0x08 ? "daap.songcomposer" : "daap.songdatemodified" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 8 ? : 0 0 0
18 0 ▶ $ctx->add( $i & 0x04 ? "daap.songdiscnumber" : "daap.songdisabled" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 4 ? : 0 0 0
19 0 ▶ $ctx->add( $i & 0x02 ? "playlist-item-spec" : "revision-number" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 2 ? : 0 0 0
20 0 ▶ $ctx->add( $i & 0x01 ? "session-id" : "content-codes" );
Branch: 1 branch
BranchTrueFalseTotal
$i & 1 ? : 0 0 0
21 0 push @seeds, uc $ctx->hexdigest;
22 }
23 }
24  
25 0 my $ctx = Digest::MD5->new;
26 0 $ctx->add( $url );
27 0 $ctx->add( "Copyright 2003 Apple Computer, Inc." );
28 0 $ctx->add( $seeds[ $select ]);
29 0 return uc $ctx->hexdigest;
30 }
31  
32  
33 1 1;
34  
↑ Summary Client.pm »