« blib/lib/WWW/Shopify/Liquid/Operator/NotEquals.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Filter/JSON.pm »
| 1 | #!/usr/bin/perl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 30 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 30 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | package WWW::Shopify::Liquid::Tag::Decrement; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 30 | ▶ | use base 'WWW::Shopify::Liquid::Tag::Free'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 0 | ▶ | sub max_arguments { return 1; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
max_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub min_arguments { return 1; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
min_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | sub verify { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
verify: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | die new WWW::Shopify::Liquid::Exception::Parser::Arguments($self, "Requires variable to decrement.") unless | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | $self->{arguments}->[0]->isa('WWW::Shopify::Liquid::Token::Variable'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 30 | ▶ | use Scalar::Util qw(looks_like_number); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | sub process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | my ($self, $hash, $action, $pipeline) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process: not called CC=13 SCAR=52.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | my @vars = map { $self->is_processed($_) ? $_ : $_->$action($pipeline, $hash) } @{$self->{arguments}->[0]->{core}}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my $inner_hash = $hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | for (0..$#vars-1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | return $self if ref($inner_hash) && ref($inner_hash) eq "HASH" && !exists $inner_hash->{$vars[$_]} && $action eq 'optimize'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
ref $inner_hash and ref $inner_hash eq "HASH" and not exists $$inner_hash{$vars[$_]} and $action eq "optimize"
ref $inner_hash and ref $inner_hash eq "HASH" and not exists $$inner_hash{$vars[$_]}
ref $inner_hash and ref $inner_hash eq "HASH"
MC/DC0%0/4
ref $inner_hash and ref $inner_hash eq "HASH" and not exists $$inner_hash{$vars[$_]} and $action eq "optimize"
ref $inner_hash
ref $inner_hash eq "HASH"
not exists $$inner_hash{$vars[$_]}
$action eq "optimize"
Truth table0%0/5
A and B and not(C) and D
A= ref $inner_hashB= ref $inner_hash eq "HASH"C= not exists $$inner_hash{$vars[$_]}D= $action eq "optimize"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if (looks_like_number($vars[$_]) && ref($inner_hash) && ref($inner_hash) eq "ARRAY") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
&looks_like_number($vars[$_]) and ref $inner_hash and ref $inner_hash eq "ARRAY"
&looks_like_number($vars[$_]) and ref $inner_hash
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"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | $inner_hash->[$vars[$_]] = {} if !defined $inner_hash->[$vars[$_]]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | $inner_hash = $inner_hash->[$vars[$_]]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | $inner_hash->{$vars[$_]} = {} if !exists $inner_hash->{$vars[$_]}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $inner_hash = $inner_hash->{$vars[$_]}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if (looks_like_number($inner_hash->{$vars[-1]})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | $inner_hash->{$vars[-1]}--; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | return ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 30 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||