Amazon/Validate/ItemSearch/us/Keywords.pm

filter: Statementstmt 99.0% 104 / 105 Branchbran 100% 4 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 94.4% 118 / 125 CC 5 SCAR 7.4
CC
5
Cov
98%
find_match
3.0
user_or_default
3.0
BEGIN
1.0
CRAP 2.1
« Amazon/Validate/ItemSearch/us/BrowseNode.pm ↑ Summary Amazon/Validate/ItemSearch/us/UPC.pm »
1 # -*- perl -*-
2 # !!! DO NOT EDIT !!!
3 # This file was automatically generated.
4 package Net::Amazon::Validate::ItemSearch::us::Keywords;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11 2 my ($class , %options) = @_;
12 2 my $self = {
13 '_default' => 'Books',
14 %options,
15 };
16  
17 2 push @{$self->{_options}}, 'Apparel';
18 2 push @{$self->{_options}}, 'Automotive';
19 2 push @{$self->{_options}}, 'Baby';
20 2 push @{$self->{_options}}, 'Beauty';
21 2 push @{$self->{_options}}, 'Blended';
22 2 push @{$self->{_options}}, 'Books';
23 2 push @{$self->{_options}}, 'Classical';
24 2 push @{$self->{_options}}, 'DVD';
25 2 push @{$self->{_options}}, 'DigitalMusic';
26 2 push @{$self->{_options}}, 'Electronics';
27 2 push @{$self->{_options}}, 'GourmetFood';
28 2 push @{$self->{_options}}, 'HealthPersonalCare';
29 2 push @{$self->{_options}}, 'HomeGarden';
30 2 push @{$self->{_options}}, 'Industrial';
31 2 push @{$self->{_options}}, 'Jewelry';
32 2 push @{$self->{_options}}, 'KindleStore';
33 2 push @{$self->{_options}}, 'Kitchen';
34 2 push @{$self->{_options}}, 'Magazines';
35 2 push @{$self->{_options}}, 'Merchants';
36 2 push @{$self->{_options}}, 'Miscellaneous';
37 2 push @{$self->{_options}}, 'Music';
38 2 push @{$self->{_options}}, 'MusicTracks';
39 2 push @{$self->{_options}}, 'MusicalInstruments';
40 2 push @{$self->{_options}}, 'OfficeProducts';
41 2 push @{$self->{_options}}, 'OutdoorLiving';
42 2 push @{$self->{_options}}, 'PCHardware';
43 2 push @{$self->{_options}}, 'PetSupplies';
44 2 push @{$self->{_options}}, 'Photo';
45 2 push @{$self->{_options}}, 'Shoes';
46 2 push @{$self->{_options}}, 'SilverMerchants';
47 2 push @{$self->{_options}}, 'Software';
48 2 push @{$self->{_options}}, 'SportingGoods';
49 2 push @{$self->{_options}}, 'Tools';
50 2 push @{$self->{_options}}, 'Toys';
51 2 push @{$self->{_options}}, 'UnboxVideo';
52 2 push @{$self->{_options}}, 'VHS';
53 2 push @{$self->{_options}}, 'Video';
54 2 push @{$self->{_options}}, 'VideoGames';
55 2 push @{$self->{_options}}, 'Watches';
56 2 push @{$self->{_options}}, 'Wireless';
57 2 push @{$self->{_options}}, 'WirelessAccessories';
58  
59 2 bless $self, $class;
60 }
61  
62 2 ▶sub user_or_default {
Subroutine user_or_default: called CC=3 SCAR=11.0
Pod undocumented
63 2 my ($self, $user) = @_;
64 2 ▶ if (defined $user && length($user) > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $user and length $user > 0) 1 1 2
Condition66%2/3
defined $user and length $user > 0
!ll&&!rl&&r
101
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
65 1 return $self->find_match($user);
66 }
67 1 return $self->default();
68 }
69  
70 1 ▶sub default {
Subroutine default: called CC=1 SCAR=0.0
Pod undocumented
71 1 my ($self) = @_;
72 1 return $self->{_default};
73 }
74  
75 1 ▶sub find_match {
Subroutine find_match: called CC=3 SCAR=11.1
Pod undocumented
76 1 my ($self, $value) = @_;
77 1 for (@{$self->{_options}}) {
78 6 ▶ return $_ if lc($_) eq lc($value);
Branch: 1 branch
BranchTrueFalseTotal
if lc $_ eq lc $value 1 5 6
79 }
80 0 die "$value is not a valid value for us::Keywords!\n";
81 }
82  
83 2 1;
84  
85 __END__
« Amazon/Validate/ItemSearch/us/BrowseNode.pm ↑ Summary Amazon/Validate/ItemSearch/us/UPC.pm »