| 1 | 17 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 17 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | package MetaCPAN::API::Favorite; | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 17 | our $VERSION = '0.52'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 17 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 17 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 17 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | # /favorite/_search only | ||||||||||||||||||||||||||||
| 12 | 3 | ▶ | sub favorite { | ||||||||||||||||||||||||||
|
Subroutine
favorite: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 14 | 3 | ▶ | my %opts = @_ ? @_ : (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | 3 | my $url = ''; | |||||||||||||||||||||||||||
| 16 | 3 | my $error = "Only 'search' can be used here"; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | ▶ | %opts or croak $error; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 2 | my %extra_opts = (); | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 2 | ▶ | if ( defined ( my $search_opts = $opts{'search'} ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 1 | ▶ | croak $error | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $search_opts and ref $search_opts eq "HASH"
MC/DC0%0/2
ref $search_opts and ref $search_opts eq "HASH"
ref $search_opts
ref $search_opts eq "HASH"
Truth table33%1/3
A and B
A= ref $search_optsB= ref $search_opts eq "HASH"
| |||||||||||||||||||||||||||||
| 24 | unless ref $search_opts && ref $search_opts eq 'HASH'; | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 1 | %extra_opts = %{$search_opts}; | |||||||||||||||||||||||||||
| 27 | 1 | $url = 'favorite/_search'; | |||||||||||||||||||||||||||
| 28 | } else { | ||||||||||||||||||||||||||||
| 29 | 1 | croak $error; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 1 | return $self->fetch( $url, %extra_opts ); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 17 | 1; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||||||||||