blib/lib/WWW/Shopify/Model/Product.pm

filter: Statementstmt 36.7% 29 / 79 Branchbran 2.2% 1 / 44 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 31.4% 11 / 35 Podpod 32.0% 8 / 25 totaltotal 26.7% 49 / 183 CC 22 SCAR 19.2
CC
22
Cov
24%
images
18.4
options
18.4
variants
18.4
CRAP 6.8
« blib/lib/WWW/Shopify/Model/FulfillmentService.pm ↑ Summary blib/lib/WWW/Shopify/Model/Order/LineItem.pm »
1 #!/usr/bin/perl
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use WWW::Shopify;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use WWW::Shopify::Model::Product::Image;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use WWW::Shopify::Model::Product::Option;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use WWW::Shopify::Model::Product::Variant;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 package WWW::Shopify::Model::Product;
12 1 ▶use parent "WWW::Shopify::Model::Item";
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 55 ▶my $fields; sub fields { return $fields; }
Subroutine fields: called CC=1 SCAR=0.0
Pod documented
15 1 ▶BEGIN { $fields = {
Subroutine BEGIN: called CC=1 SCAR=0.0
16 "body_html" => new WWW::Shopify::Field::Text::HTML(),
17 "variants" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Product::Variant", 1),
18 "handle" => new WWW::Shopify::Field::String::Handle(),
19 "product_type" => new WWW::Shopify::Field::String::Words(1,2),
20 "template_suffix" => new WWW::Shopify::Field::String(),
21 "published_scope" => new WWW::Shopify::Field::String(),
22 "title" => new WWW::Shopify::Field::String::Words(1,2),
23 "vendor" => new WWW::Shopify::Field::String::Words(1,2),
24 "tags" => new WWW::Shopify::Field::String::Words(1,7),
25 "images" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Product::Image"),
26 "options" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Product::Option", 1, 3),
27 "metafields" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Metafield"),
28 "id" => new WWW::Shopify::Field::Identifier(),
29 "created_at" => new WWW::Shopify::Field::Date(),
30 "published_at" => new WWW::Shopify::Field::Date(),
31 "updated_at" => new WWW::Shopify::Field::Date()};
32 }
33 12 ▶my $queries; sub queries { return $queries; }
Subroutine queries: called CC=1 SCAR=0.0
Pod documented
34 BEGIN { $queries = {
35 created_at_min => new WWW::Shopify::Query::LowerBound('created_at'),
36 created_at_max => new WWW::Shopify::Query::UpperBound('created_at'),
37 updated_at_min => new WWW::Shopify::Query::LowerBound('updated_at'),
38 updated_at_max => new WWW::Shopify::Query::UpperBound('updated_at'),
39 published_at_min => new WWW::Shopify::Query::LowerBound('published_at'),
40 published_at_max => new WWW::Shopify::Query::UpperBound('published_at'),
41 published_status => new WWW::Shopify::Query::Enum('published_status', ['unpublished', 'published', 'any']),
42 product_type => new WWW::Shopify::Query::Match('product_type'),
43 vendor => new WWW::Shopify::Query::Match('vendor'),
44 collection_id => new WWW::Shopify::Query::Custom("collection_id", sub {
45 0 ▶ my ($rs, $value) = @_;
Subroutine __ANON__: not called CC=1 SCAR=6.9
46 0 return $rs->search({ 'collection_id' => $value },
47 { 'join' => 'collects','+select' => ['collects.collection_id'], '+as' => ['collection_id'], }
48 );
49 1 ▶ }),
Subroutine BEGIN: called CC=1 SCAR=0.0
50 since_id => new WWW::Shopify::Query::LowerBound('id')
51 }; }
52  
53  
54 0 ▶sub get_fields { return grep { $_ ne "collects" } keys(%$fields); }
Subroutine get_fields: not called CC=1 SCAR=6.9
Pod documented
55 0 ▶sub creation_minimal { return qw(title product_type vendor); }
Subroutine creation_minimal: not called CC=1 SCAR=6.9
Pod documented
56 0 ▶sub creation_filled { return qw(id created_at); }
Subroutine creation_filled: not called CC=1 SCAR=6.9
Pod documented
57 # Odd, even without an update method, it still has an updated at.
58 0 ▶sub update_filled { return qw(updated_at); }
Subroutine update_filled: not called CC=1 SCAR=6.9
Pod documented
59 0 ▶sub update_fields { return qw(metafields handle product_type title template_suffix vendor tags images options body_html variants); }
Subroutine update_fields: not called CC=1 SCAR=6.9
Pod documented
60 0 ▶sub throws_webhooks { return 1; }
Subroutine throws_webhooks: not called CC=1 SCAR=6.9
Pod documented
61  
62 0 ▶sub read_scope { return "read_products"; }
Subroutine read_scope: not called CC=1 SCAR=6.9
Pod undocumented
63 0 ▶sub write_scope { return "write_products"; }
Subroutine write_scope: not called CC=1 SCAR=6.9
Pod undocumented
64  
65 0 ▶eval(__PACKAGE__->generate_accessors); die $@ if $@;
Subroutine body_html: not called CC=2 SCAR=17.2
Subroutine created_at: not called CC=2 SCAR=17.2
Subroutine handle: not called CC=2 SCAR=17.2
Subroutine id: not called CC=2 SCAR=17.2
Subroutine images: not called CC=4 SCAR=29.1
Subroutine options: not called CC=4 SCAR=29.1
Subroutine product_type: not called CC=2 SCAR=17.2
Subroutine published_at: not called CC=2 SCAR=17.2
Subroutine published_scope: not called CC=2 SCAR=17.2
Subroutine tags: not called CC=2 SCAR=17.2
Subroutine template_suffix: not called CC=2 SCAR=17.2
Subroutine title: not called CC=2 SCAR=17.2
Subroutine updated_at: not called CC=2 SCAR=17.2
Subroutine variants: not called CC=4 SCAR=29.1
Subroutine vendor: not called CC=2 SCAR=17.2
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 22 branches
BranchTrueFalseTotal
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
unless defined $_[0]{"images"} 0 0 0
if wantarray 0 0 0
if defined $_[1] 0 0 0
unless defined $_[0]{"options"} 0 0 0
if wantarray 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
unless defined $_[0]{"variants"} 0 0 0
if wantarray 0 0 0
if defined $_[1] 0 0 0
if $@ 0 1 1
66  
67 1 1
« blib/lib/WWW/Shopify/Model/FulfillmentService.pm ↑ Summary blib/lib/WWW/Shopify/Model/Order/LineItem.pm »