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

filter: Statementstmt 11.9% 21 / 176 Branchbran 0.6% 1 / 156 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 12.0% 9 / 75 Podpod 10.2% 7 / 68 totaltotal 7.8% 38 / 484 CC 80 SCAR 21.7
CC
80
Cov
7%
get_fields
20.0
discount_codes
19.5
fulfillments
19.5
CRAP 8.8
« blib/lib/WWW/Shopify/Field/String.pm ↑ Summary blib/lib/WWW/Shopify/Model/Checkout.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  
8 package WWW::Shopify::Model::Order;
9 1 ▶use parent "WWW::Shopify::Model::Item";
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 197 ▶my $fields; sub fields { return $fields; }
Subroutine fields: called CC=1 SCAR=0.0
Pod documented
12 1 ▶BEGIN { $fields = {
Subroutine BEGIN: called CC=1 SCAR=0.0
13 "buyer_accepts_marketing" => new WWW::Shopify::Field::Boolean(),
14 "cancel_reason" => new WWW::Shopify::Field::String(),
15 "cancelled_at" => new WWW::Shopify::Field::Date(),
16 "cart_token" => new WWW::Shopify::Field::String::Hex32(),
17 "closed_at" => new WWW::Shopify::Field::Date(),
18 "created_at" => new WWW::Shopify::Field::Date(),
19 "currency" => new WWW::Shopify::Field::Currency(),
20 "email" => new WWW::Shopify::Field::String::Email(),
21 "financial_status" => new WWW::Shopify::Field::String::Enum(["authorized", "pending", "paid", "abandoned", "refunded", "voided"]),
22 # Rolling eyes here; obviously "restocked" not in the documentation.
23 "fulfillment_status" => new WWW::Shopify::Field::String::Enum(["fulfilled", undef, "partial", "restocked"]),
24 "gateway" => new WWW::Shopify::Field::String(),
25 "reference" => new WWW::Shopify::Field::String(),
26 "id" => new WWW::Shopify::Field::Identifier(),
27 "landing_site" => new WWW::Shopify::Field::String::URL(),
28 "name" => new WWW::Shopify::Field::String::Regex("#[1-9][0-9]{0,3}"),
29 "note" => new WWW::Shopify::Field::String::Words(3, 20),
30 "number" => new WWW::Shopify::Field::Int(),
31 "referring_site" => new WWW::Shopify::Field::String::URL(),
32 "subtotal_price" => new WWW::Shopify::Field::Money(),
33 "taxes_included" => new WWW::Shopify::Field::Boolean(),
34 "token" => new WWW::Shopify::Field::String::Hex32(),
35 "total_discounts" => new WWW::Shopify::Field::Money(),
36 "total_line_items_price" => new WWW::Shopify::Field::Money(),
37 "source" => new WWW::Shopify::Field::String::Enum(["browser", "pos"]),
38 "source_name" => new WWW::Shopify::Field::String::Enum(["web", "pos"]),
39 "source_identifier" => new WWW::Shopify::Field::String(),
40 "source_url" => new WWW::Shopify::Field::String::URL(),
41 "total_price" => new WWW::Shopify::Field::Money(),
42 "total_price_usd" => new WWW::Shopify::Field::Money::USD(),
43 "total_tax" => new WWW::Shopify::Field::Money(),
44 "total_weight" => new WWW::Shopify::Field::Float(),
45 "updated_at" => new WWW::Shopify::Field::Date(),
46 "browser_ip" => new WWW::Shopify::Field::String::IPAddress(),
47 "landing_site_ref" => new WWW::Shopify::Field::String(),
48 "tags" => new WWW::Shopify::Field::String(),
49 "order_number" => new WWW::Shopify::Field::Int(),
50 "location_id" => new WWW::Shopify::Field::Relation::ReferenceOne('WWW::Shopify::Model::Location'),
51 "discount_codes" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::DiscountCode", 0, 1),
52 "note_attributes" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::NoteAttributes"),
53 "processing_method" => new WWW::Shopify::Field::String::Enum(["direct", "indirect"]),
54 "line_items" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::LineItem", 1),
55 "shipping_lines" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::ShippingLine"),
56 "tax_lines" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::TaxLine"),
57 "payment_details" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Order::PaymentDetails"),
58 "billing_address" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Address", 1),
59 "shipping_address" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Address", 1),
60 "fulfillments" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Order::Fulfillment"),
61 "client_details" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Order::ClientDetails"),
62 "customer" => new WWW::Shopify::Field::Relation::OwnOne("WWW::Shopify::Model::Customer"),
63 "metafields" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Metafield"),
64 "transactions" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Transaction"),
65 "refund" => new WWW::Shopify::Field::Relation::Many("WWW::Shopify::Model::Refund"),
66
67 "send_webhooks" => new WWW::Shopify::Field::Boolean(),
68 "send_receipt" => new WWW::Shopify::Field::Boolean(),
69 "send_fulfillment_receipt" => new WWW::Shopify::Field::Boolean(),
70 "inventory_behaviour" => new WWW::Shopify::Field::String::Enum(["bypass", "decrement_ignoring_policy", "decrement_obeying_policy"])
71 }; }
72 11 ▶my $queries; sub queries { return $queries; }
Subroutine queries: called CC=1 SCAR=0.0
Pod documented
73 BEGIN { $queries = {
74 created_at_min => new WWW::Shopify::Query::LowerBound('created_at'),
75 created_at_max => new WWW::Shopify::Query::UpperBound('created_at'),
76 updated_at_min => new WWW::Shopify::Query::LowerBound('updated_at'),
77 updated_at_max => new WWW::Shopify::Query::UpperBound('updated_at'),
78 name => new WWW::Shopify::Query::Match('name'),
79 status => new WWW::Shopify::Query::Enum('status', ['open', 'closed', 'cancelled', 'any']),
80 financial_status => new WWW::Shopify::Query::Enum('financial_status', ['authorized', 'pending', 'paid', 'partially_paid', 'abandoned', 'refunded', 'voided', 'any']),
81 fulfillment_status => new WWW::Shopify::Query::Enum('fulfillment_status', ['shipped', 'partial', 'unshipped', 'any']),
82 since_id => new WWW::Shopify::Query::LowerBound('id'),
83 customer_id => new WWW::Shopify::Query::Custom('customer_id', sub {
84 0 ▶ my ($rs, $value) = @_;
Subroutine __ANON__: not called CC=1 SCAR=6.9
85 0 return $rs->search({ 'customer.id' => $value },
86 { 'join' => 'customer', '+select' => ['collects.collection_id'], '+as' => ['collection_id'], }
87 )
88 })
89 1 ▶}; }
Subroutine BEGIN: called CC=1 SCAR=0.0
90  
91 1 ▶sub actions { return qw(open close cancel); }
Subroutine actions: called CC=1 SCAR=0.0
Pod documented
92  
93 0 ▶sub get_fields { return grep { $_ ne "send_webhooks" && $_ ne "send_receipt" && $_ ne "send_fulfillment_receipt" && $_ ne "inventory_behaviour" } keys(%$fields); }
Subroutine get_fields: not called CC=4 SCAR=30.0
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_ ne "send_webhooks" and $_ ne "send_receipt" and $_ ne "send_fulfillment_receipt" and $_ ne "inventory_behaviour" 0 0 0
Condition0%0/6
$_ ne "send_webhooks" and $_ ne "send_receipt" and $_ ne "send_fulfillment_receipt"
!ll&&!rl&&r
000
$_ ne "send_webhooks" and $_ ne "send_receipt"
!ll&&!rl&&r
000
MC/DC0%0/3
$_ ne "send_webhooks" and $_ ne "send_receipt" and $_ ne "send_fulfillment_receipt"
$_ ne "send_webhooks" $_ ne "send_receipt" $_ ne "send_fulfillment_receipt"
Truth table0%0/4
A and B and C
A= $_ ne "send_webhooks"B= $_ ne "send_receipt"C= $_ ne "send_fulfillment_receipt"
ABCresult
0XX0
10X0
1100
1111
94 0 ▶sub creation_minimal { return qw(line_items); }
Subroutine creation_minimal: not called CC=1 SCAR=6.9
Pod documented
95 0 ▶sub update_filled { return qw(updated_at); }
Subroutine update_filled: not called CC=1 SCAR=6.9
Pod documented
96 0 ▶sub update_fields { return qw(note note_attributes email buyer_accepts_marketing); };
Subroutine update_fields: not called CC=1 SCAR=6.9
Pod documented
97  
98 sub status {
99 0 ▶ return "cancelled" if $_[0]->cancelled_at;
Subroutine status: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->cancelled_at 0 0 0
100 0 ▶ return "closed" if $_[0]->closed_at;
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->closed_at 0 0 0
101 0 return "open";
102 }
103  
104 0 ▶sub read_scope { return "read_orders"; }
Subroutine read_scope: not called CC=1 SCAR=6.9
Pod undocumented
105 0 ▶sub write_scope { return "write_orders"; }
Subroutine write_scope: not called CC=1 SCAR=6.9
Pod undocumented
106  
107 0 ▶eval(__PACKAGE__->generate_accessors); die $@ if $@;
Subroutine billing_address: not called CC=2 SCAR=17.7
Subroutine browser_ip: not called CC=2 SCAR=17.7
Subroutine buyer_accepts_marketing: not called CC=2 SCAR=17.7
Subroutine cancel: not called CC=2 SCAR=17.7
Subroutine cancel_reason: not called CC=2 SCAR=17.7
Subroutine cancelled_at: not called CC=2 SCAR=17.7
Subroutine cart_token: not called CC=2 SCAR=17.7
Subroutine client_details: not called CC=2 SCAR=17.7
Subroutine close: not called CC=2 SCAR=17.7
Subroutine closed_at: not called CC=2 SCAR=17.7
Subroutine created_at: not called CC=2 SCAR=17.7
Subroutine currency: not called CC=2 SCAR=17.7
Subroutine customer: not called CC=2 SCAR=17.7
Subroutine discount_codes: not called CC=4 SCAR=29.7
Subroutine email: not called CC=2 SCAR=17.7
Subroutine financial_status: not called CC=2 SCAR=17.7
Subroutine fulfillment_status: not called CC=2 SCAR=17.7
Subroutine fulfillments: not called CC=4 SCAR=29.7
Subroutine gateway: not called CC=2 SCAR=17.7
Subroutine id: not called CC=2 SCAR=17.7
Subroutine inventory_behaviour: not called CC=2 SCAR=17.7
Subroutine landing_site: not called CC=2 SCAR=17.7
Subroutine landing_site_ref: not called CC=2 SCAR=17.7
Subroutine line_items: not called CC=4 SCAR=29.7
Subroutine location_id: not called CC=2 SCAR=17.7
Subroutine name: not called CC=2 SCAR=17.7
Subroutine note: not called CC=2 SCAR=17.7
Subroutine note_attributes: not called CC=4 SCAR=29.7
Subroutine number: not called CC=2 SCAR=17.7
Subroutine open: not called CC=2 SCAR=17.7
Subroutine order_number: not called CC=2 SCAR=17.7
Subroutine payment_details: not called CC=2 SCAR=17.7
Subroutine processing_method: not called CC=2 SCAR=17.7
Subroutine reference: not called CC=2 SCAR=17.7
Subroutine referring_site: not called CC=2 SCAR=17.7
Subroutine refund: not called CC=4 SCAR=29.7
Subroutine send_fulfillment_receipt: not called CC=2 SCAR=17.7
Subroutine send_receipt: not called CC=2 SCAR=17.7
Subroutine send_webhooks: not called CC=2 SCAR=17.7
Subroutine shipping_address: not called CC=2 SCAR=17.7
Subroutine shipping_lines: not called CC=4 SCAR=29.7
Subroutine source: not called CC=2 SCAR=17.7
Subroutine source_identifier: not called CC=2 SCAR=17.7
Subroutine source_name: not called CC=2 SCAR=17.7
Subroutine source_url: not called CC=2 SCAR=17.7
Subroutine subtotal_price: not called CC=2 SCAR=17.7
Subroutine tags: not called CC=2 SCAR=17.7
Subroutine tax_lines: not called CC=4 SCAR=29.7
Subroutine taxes_included: not called CC=2 SCAR=17.7
Subroutine token: not called CC=2 SCAR=17.7
Subroutine total_discounts: not called CC=2 SCAR=17.7
Subroutine total_line_items_price: not called CC=2 SCAR=17.7
Subroutine total_price: not called CC=2 SCAR=17.7
Subroutine total_price_usd: not called CC=2 SCAR=17.7
Subroutine total_tax: not called CC=2 SCAR=17.7
Subroutine total_weight: not called CC=2 SCAR=17.7
Subroutine transactions: not called CC=4 SCAR=29.7
Subroutine updated_at: not called CC=2 SCAR=17.7
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
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
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
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: 75 branches
BranchTrueFalseTotal
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
unless $sa 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 $sa 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]{"discount_codes"} 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
unless defined $_[0]{"fulfillments"} 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
unless defined $_[0]{"line_items"} 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
unless defined $_[0]{"note_attributes"} 0 0 0
if wantarray 0 0 0
if defined $_[1] 0 0 0
unless $sa 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]{"refund"} 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
unless defined $_[0]{"shipping_lines"} 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
unless defined $_[0]{"tax_lines"} 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
if defined $_[1] 0 0 0
unless defined $_[0]{"transactions"} 0 0 0
if wantarray 0 0 0
if defined $_[1] 0 0 0
if $@ 0 1 1
108  
109 1 1
« blib/lib/WWW/Shopify/Field/String.pm ↑ Summary blib/lib/WWW/Shopify/Model/Checkout.pm »