Amazon/Validate/ItemSearch/us/Power.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 82.2% 37 / 45 CC 5 SCAR 7.7
CC
5
Cov
91%
find_match
3.2
user_or_default
3.0
BEGIN
1.0
CRAP 2.2
« Amazon/Property/DigitalMusicTrack.pm ↑ Summary Amazon/Validate/ItemSearch/us/BrowseNode.pm »
1 # -*- perl -*-
2 # !!! DO NOT EDIT !!!
3 # This file was automatically generated.
4 package Net::Amazon::Validate::ItemSearch::us::Power;
5  
6 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11 5 my ($class , %options) = @_;
12 5 my $self = {
13 '_default' => 'Books',
14 %options,
15 };
16  
17 5 push @{$self->{_options}}, 'Books';
18  
19 5 bless $self, $class;
20 }
21  
22 5 ▶sub user_or_default {
Subroutine user_or_default: called CC=3 SCAR=11.0
Pod undocumented
23 5 my ($self, $user) = @_;
24 5 ▶ if (defined $user && length($user) > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $user and length $user > 0) 4 1 5
Condition66%2/3
defined $user and length $user > 0
!ll&&!rl&&r
104
MC/DC50%1/2
defined $user and length $user > 0
defined $user length $user > 0
Truth table66%2/3
A and B
A= defined $userB= length $user > 0
ABresult
0X0
100
111
25 4 return $self->find_match($user);
26 }
27 1 return $self->default();
28 }
29  
30 1 ▶sub default {
Subroutine default: called CC=1 SCAR=0.0
Pod undocumented
31 1 my ($self) = @_;
32 1 return $self->{_default};
33 }
34  
35 4 ▶sub find_match {
Subroutine find_match: called CC=3 SCAR=11.7
Pod undocumented
36 4 my ($self, $value) = @_;
37 4 for (@{$self->{_options}}) {
38 4 ▶ return $_ if lc($_) eq lc($value);
Branch: 1 branch
BranchTrueFalseTotal
if lc $_ eq lc $value 4 0 4
39 }
40 0 die "$value is not a valid value for us::Power!\n";
41 }
42  
43 2 1;
44  
45 __END__
« Amazon/Property/DigitalMusicTrack.pm ↑ Summary Amazon/Validate/ItemSearch/us/BrowseNode.pm »