lib/WWW/Shopify/Liquid/Pipeline.pm

filter: Statementstmt 20.4% 10 / 49 Branchbran 0.0% 0 / 30 Conditioncond 0.0% 0 / 48 MC/DCmcdc 0.0% 0 / 25 Subroutinesub 20.0% 3 / 15 Podpod 0.0% 0 / 12 totaltotal 7.2% 13 / 179 CC 33 SCAR 52.6
CC
33
Cov
8%
variable_reference
420.0
is_processed
72.0
register_operator
12.0
CRAP 192.9
« lib/WWW/Shopify/Liquid/Operator/Concatenate.pm ↑ Summary lib/WWW/Shopify/Liquid/Token.pm »
1  
2 38 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 38 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package WWW::Shopify::Liquid::Pipeline;
6 38 ▶use Scalar::Util qw(weaken blessed looks_like_number);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 0 ▶sub register_tag { }
Subroutine register_tag: not called CC=1 SCAR=0.0
Pod undocumented
8 0 ▶sub register_operator {
Subroutine register_operator: not called CC=3 SCAR=24.8
Pod undocumented
9 0 ▶ die new WWW::Shopify::Liquid::Exception("Cannot have a unary operator, that has infix notation.") if $_[1]->arity eq "unary" && $_[1]->fixness eq "infix";
Branch: 1 branch
BranchTrueFalseTotal
if $_[1]->arity eq "unary" and $_[1]->fixness eq "infix" 0 0 0
Condition0%0/3
$_[1]->arity eq "unary" and $_[1]->fixness eq "infix"
!ll&&!rl&&r
000
MC/DC0%0/2
$_[1]->arity eq "unary" and $_[1]->fixness eq "infix"
$_[1]->arity eq "unary" $_[1]->fixness eq "infix"
Truth table0%0/3
A and B
A= $_[1]->arity eq "unary"B= $_[1]->fixness eq "infix"
ABresult
0X0
100
111
10 }
11 0 ▶sub register_filter { }
Subroutine register_filter: not called CC=1 SCAR=0.0
Pod undocumented
12 0 ▶sub deregister_operator { }
Subroutine deregister_operator: not called CC=1 SCAR=0.0
Pod undocumented
13 0 ▶sub deregister_tag { }
Subroutine deregister_tag: not called CC=1 SCAR=0.0
Pod undocumented
14 0 ▶sub deregister_filter { }
Subroutine deregister_filter: not called CC=1 SCAR=0.0
Pod undocumented
15 0 ▶sub strict { $_[0]->{strict} = $_[1] if defined $_[1]; return $_[0]->{strict}; }
Subroutine strict: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[1] 0 0 0
16 0 ▶sub file_context { $_[0]->{file_context} = $_[1] if @_ > 1; return $_[0]->{file_context}; }
Subroutine file_context: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 0 0
17 0 ▶sub parent {
Subroutine parent: not called CC=2 SCAR=17.9
Pod undocumented
18 0 ▶ if (defined $_[1]) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $_[1]) 0 0 0
19 0 $_[0]->{parent} = $_[1];
20 0 weaken($_[0]->{parent});
21 }
22 0 return $_[0]->{parent};
23 }
24  
25 0 ▶sub is_processed {
Subroutine is_processed: not called CC=8 SCAR=42.8
Pod undocumented
26 return !ref($_[1]) ||
27 0 ▶ (ref($_[1]) eq "ARRAY" && int(grep { !$_[0]->is_processed($_) } @{$_[1]}) == 0) ||
Condition0%0/3
ref $_[1] eq "HASH" and int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0
!ll&&!rl&&r
000
MC/DC0%0/2
ref $_[1] eq "HASH" and int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0
ref $_[1] eq "HASH" int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0
Truth table0%0/3
A and B
A= ref $_[1] eq "HASH"B= int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0
ABresult
0X0
100
111
28 0 ▶ (ref($_[1]) eq "HASH" && int(grep { !$_[0]->is_processed($_[1]->{$_}) } keys(%{$_[1]})) == 0) ||
Condition0%0/18
!ref($_[1]) || ref $_[1] eq 'ARRAY' && int grep({not $_[0]->is_processed($_);} @{$_[1];}) == 0 || ref $_[1] eq 'HASH' && int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0 || builtin::blessed($_[1]) && !(ref($_[1]) =~ /^WWW::Shopify::Liquid/) && !$_[1]->isa('WWW::Shopify::Liquid::Element')
l!l&&r!l&&!r
000
not ref $_[1] or ref $_[1] eq "ARRAY" and int grep({not $_[0]->is_processed($_);} @{$_[1];}) == 0 or ref $_[1] eq "HASH" and int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0
l!l&&r!l&&!r
000
not ref $_[1] or ref $_[1] eq "ARRAY" and int grep({not $_[0]->is_processed($_);} @{$_[1];}) == 0
l!l&&r!l&&!r
000
ref $_[1] eq "ARRAY" and int grep({not $_[0]->is_processed($_);} @{$_[1];}) == 0
!ll&&!rl&&r
000
builtin::blessed($_[1]) and not ref($_[1]) =~ /^WWW::Shopify::Liquid/ and not $_[1]->isa("WWW::Shopify::Liquid::Element")
!ll&&!rl&&r
000
builtin::blessed($_[1]) and not ref($_[1]) =~ /^WWW::Shopify::Liquid/
!ll&&!rl&&r
000
MC/DC0%0/7
!ref($_[1]) || ref $_[1] eq 'ARRAY' && int grep({not $_[0]->is_processed($_);} @{$_[1];}) == 0 || ref $_[1] eq 'HASH' && int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0 || builtin::blessed($_[1]) && !(ref($_[1]) =~ /^WWW::Shopify::Liquid/) && !$_[1]->isa('WWW::Shopify::Liquid::Element')
not ref $_[1] ref $_[1] eq "ARRAY" int grep({not $_[0]->is_processed($_);} @{$_[1];}) == 0 ref $_[1] eq "HASH" and int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0 builtin::blessed($_[1]) not ref($_[1]) =~ /^WWW::Shopify::Liquid/ not $_[1]->isa("WWW::Shopify::Liquid::Element")
Truth table0%0/12
not(A) or B and C or D || E and not(F) and not(G)
A= not ref $_[1]B= ref $_[1] eq "ARRAY"C= int grep({not $_[0]->is_processed($_);} @{$_[1];}) == 0D= ref $_[1] eq "HASH" and int grep({not $_[0]->is_processed($_[1]{$_});} keys %{$_[1];}) == 0E= builtin::blessed($_[1])F= not ref($_[1]) =~ /^WWW::Shopify::Liquid/G= not $_[1]->isa("WWW::Shopify::Liquid::Element")
ABCDEFGresult
1XXXXXX1
011XXXX1
00X1XXX1
0101XXX1
00X01111
01001111
00X00XX0
00X010X0
00X01100
01000XX0
010010X0
01001100
29 (blessed($_[1]) && ref($_[1]) !~ m/^WWW::Shopify::Liquid/ && !$_[1]->isa('WWW::Shopify::Liquid::Element'));
30 }
31  
32 # If static is true, we do not create new indices, we return null.
33 0 ▶sub variable_reference {
Subroutine variable_reference: not called CC=20 SCAR=60.4
Pod undocumented
34 0 my ($self, $hash, $indices, $static) = @_;
35
36 0 ▶ if (blessed($indices) && $indices->isa('WWW::Shopify::Liquid::Token::Variable')) {
Branch: 1 branch
BranchTrueFalseTotal
if (builtin::blessed($indices) and $indices->isa("WWW::Shopify::Liquid::Token::Variable")) 0 0 0
Condition0%0/3
builtin::blessed($indices) and $indices->isa("WWW::Shopify::Liquid::Token::Variable")
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($indices) and $indices->isa("WWW::Shopify::Liquid::Token::Variable")
builtin::blessed($indices) $indices->isa("WWW::Shopify::Liquid::Token::Variable")
Truth table0%0/3
A and B
A= builtin::blessed($indices)B= $indices->isa("WWW::Shopify::Liquid::Token::Variable")
ABresult
0X0
100
111
37 0 $indices = [map { $_->{core} } @{$indices->{core}}];
38 }
39
40 0 my @vars = @$indices;
41 0 my $inner_hash = $hash;
42 0 for (0..$#vars-1) {
43 0 ▶ if (looks_like_number($vars[$_]) && ref($inner_hash) && ref($inner_hash) eq "ARRAY") {
Branch: 1 branch
BranchTrueFalseTotal
if (&looks_like_number($vars[$_]) and ref $inner_hash and ref $inner_hash eq 'ARRAY') { } 0 0 0
Condition0%0/6
&looks_like_number($vars[$_]) and ref $inner_hash and ref $inner_hash eq "ARRAY"
!ll&&!rl&&r
000
&looks_like_number($vars[$_]) and ref $inner_hash
!ll&&!rl&&r
000
MC/DC0%0/3
&looks_like_number($vars[$_]) and ref $inner_hash and ref $inner_hash eq "ARRAY"
&looks_like_number($vars[$_]) ref $inner_hash ref $inner_hash eq "ARRAY"
Truth table0%0/4
A and B and C
A= &looks_like_number($vars[$_])B= ref $inner_hashC= ref $inner_hash eq "ARRAY"
ABCresult
0XX0
10X0
1100
1111
44 0 ▶ if (!defined $inner_hash->[$vars[$_]]) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $$inner_hash[$vars[$_]]) 0 0 0
45 0 ▶ return () if $static;
Branch: 1 branch
BranchTrueFalseTotal
if $static 0 0 0
46 0 $inner_hash->[$vars[$_]] = {};
47 }
48 0 $inner_hash = $inner_hash->[$vars[$_]];
49 } else {
50 0 ▶ if (blessed($inner_hash) && $inner_hash->isa('WWW::Shopify::Liquid::Resolver')) {
Branch: 1 branch
BranchTrueFalseTotal
if (builtin::blessed($inner_hash) and $inner_hash->isa('WWW::Shopify::Liquid::Resolver')) { } 0 0 0
Condition0%0/3
builtin::blessed($inner_hash) and $inner_hash->isa("WWW::Shopify::Liquid::Resolver")
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($inner_hash) and $inner_hash->isa("WWW::Shopify::Liquid::Resolver")
builtin::blessed($inner_hash) $inner_hash->isa("WWW::Shopify::Liquid::Resolver")
Truth table0%0/3
A and B
A= builtin::blessed($inner_hash)B= $inner_hash->isa("WWW::Shopify::Liquid::Resolver")
ABresult
0X0
100
111
51 0 $inner_hash = $inner_hash->resolver->($inner_hash, $hash, $vars[$_]);
52 } else {
53 0 ▶ if (!exists $inner_hash->{$vars[$_]}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $$inner_hash{$vars[$_]}) 0 0 0
54 0 ▶ return () if $static;
Branch: 1 branch
BranchTrueFalseTotal
if $static 0 0 0
55 0 $inner_hash->{$vars[$_]} = {};
56 }
57 0 $inner_hash = $inner_hash->{$vars[$_]};
58 }
59 }
60 }
61 0 ▶ if (looks_like_number($vars[-1]) && ref($inner_hash) && ref($inner_hash) eq "ARRAY") {
Branch: 1 branch
BranchTrueFalseTotal
if (&looks_like_number($vars[-1]) and ref $inner_hash and ref $inner_hash eq 'ARRAY') { } 0 0 0
Condition0%0/6
&looks_like_number($vars[-1]) and ref $inner_hash and ref $inner_hash eq "ARRAY"
!ll&&!rl&&r
000
&looks_like_number($vars[-1]) and ref $inner_hash
!ll&&!rl&&r
000
MC/DC0%0/3
&looks_like_number($vars[-1]) and ref $inner_hash and ref $inner_hash eq "ARRAY"
&looks_like_number($vars[-1]) ref $inner_hash ref $inner_hash eq "ARRAY"
Truth table0%0/4
A and B and C
A= &looks_like_number($vars[-1])B= ref $inner_hashC= ref $inner_hash eq "ARRAY"
ABCresult
0XX0
10X0
1100
1111
62 0 ▶ return (\$inner_hash->[$vars[-1]], $inner_hash, $vars[-1]) if int(@$inner_hash) > $vars[-1] || !$static;
Branch: 1 branch
BranchTrueFalseTotal
if int @$inner_hash > $vars[-1] or not $static 0 0 0
Condition0%0/3
int @$inner_hash > $vars[-1] or not $static
l!l&&r!l&&!r
000
MC/DC0%0/2
int @$inner_hash > $vars[-1] or not $static
int @$inner_hash > $vars[-1] not $static
Truth table0%0/3
A or not(B)
A= int @$inner_hash > $vars[-1]B= not $static
ABresult
1X1
011
000
63 } else {
64 0 ▶ return (\$inner_hash->{$vars[-1]}, $inner_hash, $vars[-1]) if exists $inner_hash->{$vars[-1]} || !$static;
Branch: 1 branch
BranchTrueFalseTotal
if exists $$inner_hash{$vars[-1]} or not $static 0 0 0
Condition0%0/3
exists $$inner_hash{$vars[-1]} or not $static
l!l&&r!l&&!r
000
MC/DC0%0/2
exists $$inner_hash{$vars[-1]} or not $static
exists $$inner_hash{$vars[-1]} not $static
Truth table0%0/3
A or not(B)
A= exists $$inner_hash{$vars[-1]}B= not $static
ABresult
1X1
011
000
65 }
66 0 return ();
67 }
68  
69 0 ▶sub make_method_calls { $_[0]->{make_method_calls} = $_[1] if @_ > 1; return $_[0]->{make_method_calls}; }
Subroutine make_method_calls: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 0 0 0
70  
71 38 1;
« lib/WWW/Shopify/Liquid/Operator/Concatenate.pm ↑ Summary lib/WWW/Shopify/Liquid/Token.pm »