Spotify/Search.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 93.7% 30 / 32 CC 4 SCAR 10.0
CC
4
Cov
96%
format_request
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« Spotify/Lookup.pm ↑ Summary Spotify/Service.pm »
1 package Net::Spotify::Search;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use base 'Net::Spotify::Service';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 our $VERSION = '0.03';
9  
10 3 ▶sub format_request {
Subroutine format_request: called CC=4 SCAR=13.9
Pod documented
11 3 my ($self, $method, %parameters) = @_;
12  
13 3 my $base_url = $self->base_url();
14 3 my $version = $self->version();
15 3 my $format = $self->format();
16  
17 3 my $uri = URI->new("$base_url/search/$version/$method.$format");
18  
19 3 foreach my $key (qw(q page)) {
20 6 ▶ if (exists $parameters{$key} && $parameters{$key}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $parameters{$key} and $parameters{$key}) 5 1 6
Condition66%2/3
exists $parameters{$key} and $parameters{$key}
!ll&&!rl&&r
105
MC/DC50%1/2
exists $parameters{$key} and $parameters{$key}
exists $parameters{$key} $parameters{$key}
Truth table66%2/3
A and B
A= exists $parameters{$key}B= $parameters{$key}
ABresult
0X0
100
111
21 5 $uri->query_param($key, $parameters{$key});
22 }
23 }
24  
25 3 return HTTP::Request->new('GET', $uri);
26 }
27  
28 4 1;
29  
30 __END__
« Spotify/Lookup.pm ↑ Summary Spotify/Service.pm »