blib/lib/WWW/Shopify/Model/LinkList/Link.pm

filter: Statementstmt 33.9% 18 / 53 Branchbran 2.2% 1 / 44 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 30.0% 6 / 20 Podpod 26.6% 4 / 15 totaltotal 21.9% 29 / 132 CC 22 SCAR 33.4
CC
22
Cov
20%
link_url
90.0
link_model_type
42.0
id
5.1
CRAP 28.2
« blib/lib/WWW/Shopify/Login.pm ↑ Summary blib/lib/WWW/Shopify/Public.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::LinkList::Link;
9 1 ▶use parent "WWW::Shopify::Model::NestedItem";
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 29 ▶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 "id" => new WWW::Shopify::Field::Identifier(),
14 "position" => new WWW::Shopify::Field::Int(),
15 "subject" => new WWW::Shopify::Field::String(),
16 "subject_id" => new WWW::Shopify::Field::Int(),
17 "subject_params" => new WWW::Shopify::Field::String(),
18 "title" => new WWW::Shopify::Field::String(),
19 "link_list_id" => new WWW::Shopify::Field::Relation::Parent('WWW::Shopify::Model::LinkList'),
20 "link_type" => new WWW::Shopify::Field::String::Enum(["collection", "product", "frontpage", "catalog", "page", "blog", "search", "http"])
21 }; }
22  
23 0 ▶sub creation_minimal { return qw(title link_type); }
Subroutine creation_minimal: not called CC=1 SCAR=6.9
Pod documented
24 0 ▶sub creation_filled { return qw(link_list_id); }
Subroutine creation_filled: not called CC=1 SCAR=6.9
Pod documented
25 0 ▶sub update_filled { return qw(); }
Subroutine update_filled: not called CC=1 SCAR=6.9
Pod documented
26  
27 sub link_model_type {
28 0 ▶ return ('WWW::Shopify::Model::CustomCollection', 'WWW::Shopify::Model::SmartCollection') if $_[0]->link_type eq 'collection';
Subroutine link_model_type: not called CC=6 SCAR=37.4
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "collection" 0 0 0
29 0 ▶ return 'WWW::Shopify::Model::Product' if $_[0]->link_type eq 'product';
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "product" 0 0 0
30 0 ▶ return 'WWW::Shopify::Model::Page' if $_[0]->link_type eq 'page';
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "page" 0 0 0
31 0 ▶ return 'WWW::Shopify::Model::Blog' if $_[0]->link_type eq 'blog';
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "blog" 0 0 0
32 0 ▶ return () if wantarray;
Branch: 1 branch
BranchTrueFalseTotal
if wantarray 0 0 0
33 0 return undef;
34 }
35  
36 sub link_url {
37 0 ▶ return '/search' if $_[0]->link_type eq "search";
Subroutine link_url: not called CC=9 SCAR=45.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "search" 0 0 0
38 0 ▶ return '/' if $_[0]->link_type eq "frontpage";
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "frontpage" 0 0 0
39 0 ▶ return '/collections/all' if $_[0]->link_type eq "catalog";
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "catalog" 0 0 0
40 0 ▶ return $_[0]->subject if $_[0]->link_type eq "http";
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "http" 0 0 0
41 0 ▶ return '/collections/' . $_[0]->subject if $_[0]->link_type eq 'collection';
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "collection" 0 0 0
42 0 ▶ return '/products/' . $_[0]->subject if $_[0]->link_type eq 'product';
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "product" 0 0 0
43 0 ▶ return '/pages/' . $_[0]->subject if $_[0]->link_type eq 'page';
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "page" 0 0 0
44 0 ▶ return '/blogs/' . $_[0]->subject if $_[0]->link_type eq 'blogs';
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->link_type eq "blogs" 0 0 0
45 0 return undef;
46 }
47  
48 0 ▶sub needs_login { return 1; }
Subroutine needs_login: not called CC=1 SCAR=6.9
Pod undocumented
49  
50 0 ▶eval(__PACKAGE__->generate_accessors); die $@ if $@;
Subroutine id: not called CC=2 SCAR=16.3
Subroutine link_list_id: not called CC=2 SCAR=16.3
Subroutine link_type: not called CC=2 SCAR=16.3
Subroutine position: not called CC=2 SCAR=16.3
Subroutine subject: not called CC=2 SCAR=16.3
Subroutine subject_id: not called CC=2 SCAR=16.3
Subroutine subject_params: not called CC=2 SCAR=16.3
Subroutine title: not called CC=2 SCAR=16.3
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
Branch: 9 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
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if defined $_[1] 0 0 0
if $@ 0 1 1
51  
52 1 1;
« blib/lib/WWW/Shopify/Login.pm ↑ Summary blib/lib/WWW/Shopify/Public.pm »