Amazon/Validate/ItemSearch/us/UPC.pm

filter: Statementstmt 99.4% 174 / 175 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 96.4% 188 / 195 CC 5 SCAR 7.4
CC
5
Cov
99%
find_match
3.0
user_or_default
3.0
BEGIN
1.0
CRAP 2.1
« Amazon/Validate/ItemSearch/us/Keywords.pm ↑ Summary Amazon/Response/Similar.pm »
1 # -*- perl -*-
2 # !!! DO NOT EDIT !!!
3 # This file was automatically generated.
4 package Net::Amazon::Validate::ItemSearch::us::UPC;
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}}, 'Actor';
18 2 push @{$self->{_options}}, 'Apparel';
19 2 push @{$self->{_options}}, 'Artist';
20 2 push @{$self->{_options}}, 'AudienceRating';
21 2 push @{$self->{_options}}, 'Author';
22 2 push @{$self->{_options}}, 'Automotive';
23 2 push @{$self->{_options}}, 'Availability';
24 2 push @{$self->{_options}}, 'Baby';
25 2 push @{$self->{_options}}, 'Beauty';
26 2 push @{$self->{_options}}, 'Blended';
27 2 push @{$self->{_options}}, 'Books';
28 2 push @{$self->{_options}}, 'Brand';
29 2 push @{$self->{_options}}, 'BrowseNode';
30 2 push @{$self->{_options}}, 'Browsenode';
31 2 push @{$self->{_options}}, 'City';
32 2 push @{$self->{_options}}, 'Classical';
33 2 push @{$self->{_options}}, 'Composer';
34 2 push @{$self->{_options}}, 'Condition';
35 2 push @{$self->{_options}}, 'Conductor';
36 2 push @{$self->{_options}}, 'Count';
37 2 push @{$self->{_options}}, 'DVD';
38 2 push @{$self->{_options}}, 'DigitalMusic';
39 2 push @{$self->{_options}}, 'Director';
40 2 push @{$self->{_options}}, 'Electronics';
41 2 push @{$self->{_options}}, 'Format';
42 2 push @{$self->{_options}}, 'GourmetFood';
43 2 push @{$self->{_options}}, 'HealthPersonalCare';
44 2 push @{$self->{_options}}, 'HomeGarden';
45 2 push @{$self->{_options}}, 'Industrial';
46 2 push @{$self->{_options}}, 'ItemPage';
47 2 push @{$self->{_options}}, 'Jewelry';
48 2 push @{$self->{_options}}, 'Keyword';
49 2 push @{$self->{_options}}, 'Keywords';
50 2 push @{$self->{_options}}, 'KindleStore';
51 2 push @{$self->{_options}}, 'Kitchen';
52 2 push @{$self->{_options}}, 'MP3Downloads';
53 2 push @{$self->{_options}}, 'MPAARating';
54 2 push @{$self->{_options}}, 'Magazines';
55 2 push @{$self->{_options}}, 'Manufacturer';
56 2 push @{$self->{_options}}, 'MaximumPrice';
57 2 push @{$self->{_options}}, 'MerchantId';
58 2 push @{$self->{_options}}, 'Merchants';
59 2 push @{$self->{_options}}, 'MinimumPrice';
60 2 push @{$self->{_options}}, 'Miscellaneous';
61 2 push @{$self->{_options}}, 'Music';
62 2 push @{$self->{_options}}, 'MusicLabel';
63 2 push @{$self->{_options}}, 'MusicTracks';
64 2 push @{$self->{_options}}, 'MusicalInstruments';
65 2 push @{$self->{_options}}, 'Neighborhood';
66 2 push @{$self->{_options}}, 'OfficeProducts';
67 2 push @{$self->{_options}}, 'Orchestra';
68 2 push @{$self->{_options}}, 'OutdoorLiving';
69 2 push @{$self->{_options}}, 'PCHardware';
70 2 push @{$self->{_options}}, 'Performer';
71 2 push @{$self->{_options}}, 'PetSupplies';
72 2 push @{$self->{_options}}, 'Photo';
73 2 push @{$self->{_options}}, 'PostalCode';
74 2 push @{$self->{_options}}, 'Power';
75 2 push @{$self->{_options}}, 'Publisher';
76 2 push @{$self->{_options}}, 'Shoes';
77 2 push @{$self->{_options}}, 'SilverMerchants';
78 2 push @{$self->{_options}}, 'Software';
79 2 push @{$self->{_options}}, 'Sort';
80 2 push @{$self->{_options}}, 'SportingGoods';
81 2 push @{$self->{_options}}, 'State';
82 2 push @{$self->{_options}}, 'TextStream';
83 2 push @{$self->{_options}}, 'Title';
84 2 push @{$self->{_options}}, 'Tools';
85 2 push @{$self->{_options}}, 'Toys';
86 2 push @{$self->{_options}}, 'UnboxVideo';
87 2 push @{$self->{_options}}, 'VHS';
88 2 push @{$self->{_options}}, 'Video';
89 2 push @{$self->{_options}}, 'VideoGames';
90 2 push @{$self->{_options}}, 'Watches';
91 2 push @{$self->{_options}}, 'Wireless';
92 2 push @{$self->{_options}}, 'WirelessAccessories';
93  
94 2 bless $self, $class;
95 }
96  
97 2 ▶sub user_or_default {
Subroutine user_or_default: called CC=3 SCAR=11.0
Pod undocumented
98 2 my ($self, $user) = @_;
99 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
100 1 return $self->find_match($user);
101 }
102 1 return $self->default();
103 }
104  
105 1 ▶sub default {
Subroutine default: called CC=1 SCAR=0.0
Pod undocumented
106 1 my ($self) = @_;
107 1 return $self->{_default};
108 }
109  
110 1 ▶sub find_match {
Subroutine find_match: called CC=3 SCAR=11.1
Pod undocumented
111 1 my ($self, $value) = @_;
112 1 for (@{$self->{_options}}) {
113 45 ▶ return $_ if lc($_) eq lc($value);
Branch: 1 branch
BranchTrueFalseTotal
if lc $_ eq lc $value 1 44 45
114 }
115 0 die "$value is not a valid value for us::UPC!\n";
116 }
117  
118 2 1;
119  
120 __END__
« Amazon/Validate/ItemSearch/us/Keywords.pm ↑ Summary Amazon/Response/Similar.pm »