Amazon/Validate/ItemSearch/us/Title.pm

filter: Statementstmt 93.8% 91 / 97 Branchbran 25.0% 1 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 4 totaltotal 84.6% 99 / 117 CC 5 SCAR 15.6
CC
5
Cov
89%
find_match
12.0
user_or_default
3.8
BEGIN
1.0
CRAP 4.8
« Amazon/Validate/ItemSearch/us/Manufacturer.pm ↑ Summary Amazon/Validate/ItemSearch/uk/EAN.pm »
1 # -*- perl -*-
2 # !!! DO NOT EDIT !!!
3 # This file was automatically generated.
4 package Net::Amazon::Validate::ItemSearch::us::Title;
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}}, 'Books';
22 2 push @{$self->{_options}}, 'Classical';
23 2 push @{$self->{_options}}, 'DVD';
24 2 push @{$self->{_options}}, 'DigitalMusic';
25 2 push @{$self->{_options}}, 'Electronics';
26 2 push @{$self->{_options}}, 'GourmetFood';
27 2 push @{$self->{_options}}, 'HealthPersonalCare';
28 2 push @{$self->{_options}}, 'HomeGarden';
29 2 push @{$self->{_options}}, 'Industrial';
30 2 push @{$self->{_options}}, 'Jewelry';
31 2 push @{$self->{_options}}, 'Kitchen';
32 2 push @{$self->{_options}}, 'MP3Downloads';
33 2 push @{$self->{_options}}, 'Magazines';
34 2 push @{$self->{_options}}, 'Merchants';
35 2 push @{$self->{_options}}, 'Miscellaneous';
36 2 push @{$self->{_options}}, 'Music';
37 2 push @{$self->{_options}}, 'MusicalInstruments';
38 2 push @{$self->{_options}}, 'OfficeProducts';
39 2 push @{$self->{_options}}, 'OutdoorLiving';
40 2 push @{$self->{_options}}, 'PCHardware';
41 2 push @{$self->{_options}}, 'PetSupplies';
42 2 push @{$self->{_options}}, 'Photo';
43 2 push @{$self->{_options}}, 'SilverMerchants';
44 2 push @{$self->{_options}}, 'Software';
45 2 push @{$self->{_options}}, 'SportingGoods';
46 2 push @{$self->{_options}}, 'Tools';
47 2 push @{$self->{_options}}, 'Toys';
48 2 push @{$self->{_options}}, 'UnboxVideo';
49 2 push @{$self->{_options}}, 'VHS';
50 2 push @{$self->{_options}}, 'Video';
51 2 push @{$self->{_options}}, 'VideoGames';
52 2 push @{$self->{_options}}, 'Wireless';
53 2 push @{$self->{_options}}, 'WirelessAccessories';
54  
55 2 bless $self, $class;
56 }
57  
58 2 ▶sub user_or_default {
Subroutine user_or_default: called CC=3 SCAR=13.3
Pod undocumented
59 2 my ($self, $user) = @_;
60 2 ▶ if (defined $user && length($user) > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $user and length $user > 0) 0 2 2
Condition33%1/3
defined $user and length $user > 0
!ll&&!rl&&r
200
MC/DC0%0/2
defined $user and length $user > 0
defined $user length $user > 0
Truth table33%1/3
A and B
A= defined $userB= length $user > 0
ABresult
0X0
100
111
61 0 return $self->find_match($user);
62 }
63 2 return $self->default();
64 }
65  
66 2 ▶sub default {
Subroutine default: called CC=1 SCAR=0.0
Pod undocumented
67 2 my ($self) = @_;
68 2 return $self->{_default};
69 }
70  
71 0 ▶sub find_match {
Subroutine find_match: not called CC=3 SCAR=24.8
Pod undocumented
72 0 my ($self, $value) = @_;
73 0 for (@{$self->{_options}}) {
74 0 ▶ return $_ if lc($_) eq lc($value);
Branch: 1 branch
BranchTrueFalseTotal
if lc $_ eq lc $value 0 0 0
75 }
76 0 die "$value is not a valid value for us::Title!\n";
77 }
78  
79 2 1;
80  
81 __END__
« Amazon/Validate/ItemSearch/us/Manufacturer.pm ↑ Summary Amazon/Validate/ItemSearch/uk/EAN.pm »