« blib/lib/WWW/Shopify/Liquid/Filter/Round.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Filter/MoneyWithoutTrailingZeros.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::Operator; | ||||||||||||||||||||||||||||
| 6 | 30 | ▶ | use base 'WWW::Shopify::Liquid::Element'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | sub new { | ||||||||||||||||||||||||||||
| 8 | 0 | ▶ | my $package = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 0 | my $self = bless { line => shift, core => shift, operands => undef }, $package; | |||||||||||||||||||||||||||
| 10 | 0 | ▶ | $self->{operands} = [@_] if int(@_) >= 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 11 | 0 | return $self; | |||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub operands { my $self = shift; $self->{operands} = [@_]; return $self->{operands}; } | ||||||||||||||||||||||||||
|
Subroutine
operands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub tokens { return map { $_->tokens } (@{$_[0]->{operands}}) } | ||||||||||||||||||||||||||
|
Subroutine
tokens: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | sub arity { return "binary"; } | ||||||||||||||||||||||||||
|
Subroutine
arity: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub fixness { return "infix"; } | ||||||||||||||||||||||||||
|
Subroutine
fixness: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | sub process { | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | my ($self, $hash, $action, $pipeline) = @_; | ||||||||||||||||||||||||||
|
Subroutine
process: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | 0 | my @ops = @{$self->{operands}}; | |||||||||||||||||||||||||||
| 22 | 0 | $ops[$_] = $ops[$_]->$action($pipeline, $hash) for (grep { !$self->is_processed($ops[$_]) } (0..$#ops)); | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | if (int(grep { !$self->is_processed($_) } @ops) > 0 && $action eq "optimize") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
int grep({not $self->is_processed($_);} @ops) > 0 and $action eq "optimize"
MC/DC0%0/2
int grep({not $self->is_processed($_);} @ops) > 0 and $action eq "optimize"
int grep({not $self->is_processed($_);} @ops) > 0
$action eq "optimize"
Truth table0%0/3
A and B
A= int grep({not $self->is_processed($_);} @ops) > 0B= $action eq "optimize"
| |||||||||||||||||||||||||||||
| 25 | 0 | $self->{operands} = \@ops; | |||||||||||||||||||||||||||
| 26 | 0 | return $self; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 0 | $pipeline->security->check_operate($self, $hash, $action, @ops); | |||||||||||||||||||||||||||
| 29 | 0 | return $self->operate($hash, $action, @ops); | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub priority { return 0; } | ||||||||||||||||||||||||||
|
Subroutine
priority: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | # If we require a grouping, it means that it must be wrapped in parentheses, due to how Shopify works. Only relevant for reconversion. | ||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub requires_grouping { return 0; } | ||||||||||||||||||||||||||
|
Subroutine
requires_grouping: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 30 | 1; | |||||||||||||||||||||||||||