« lib/WWW/Shopify/Liquid/Tag/CreateFilter.pm
↑ Summary
lib/WWW/Shopify/Liquid/Operator/NotRegex.pm »
| 1 | #!/usr/bin/perl | ||||||||||||||||||||||||||||||||||
| 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 | 38 | ▶ | package WWW::Shopify::Liquid::Filter::Pluck; use base 'WWW::Shopify::Liquid::Filter'; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 6 | 0 | ▶ | sub min_arguments { 3; } | ||||||||||||||||||||||||||||||||
|
Subroutine
min_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 7 | 0 | ▶ | sub max_arguments { 3; } | ||||||||||||||||||||||||||||||||
|
Subroutine
max_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub operate { | ||||||||||||||||||||||||||||||||
|
Subroutine
operate: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 9 | 0 | my ($self, $hash, $operand, @arguments) = @_; | |||||||||||||||||||||||||||||||||
| 10 | 0 | my ($field, $value, $wantedfield) = @arguments; | |||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | return undef unless ref($operand) eq "ARRAY"; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | my @items = grep { ref($_) eq "HASH" && defined $_->{$field} && $_->{$field} eq $value } @$operand; | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
ref $_ eq 'HASH' && defined $_->{$field} && $_->{$field} eq $value
ref $_ eq "HASH" and defined $_->{$field}
MC/DC0%0/3
ref $_ eq 'HASH' && defined $_->{$field} && $_->{$field} eq $value
ref $_ eq "HASH"
defined $_->{$field}
$_->{$field} eq $value
Truth table0%0/4
A and B && C
A= ref $_ eq "HASH"B= defined $_->{$field}C= $_->{$field} eq $value
| |||||||||||||||||||||||||||||||||||
| 14 | 0 | ▶ | return undef unless int(@items) > 0 && ref($items[0]) eq "HASH"; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
int @items > 0 and ref $items[0] eq "HASH"
MC/DC0%0/2
int @items > 0 and ref $items[0] eq "HASH"
int @items > 0
ref $items[0] eq "HASH"
Truth table0%0/3
A and B
A= int @items > 0B= ref $items[0] eq "HASH"
| |||||||||||||||||||||||||||||||||||
| 15 | 0 | return $items[0]->{$wantedfield}; | |||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||
| 19 | 38 | 1; | |||||||||||||||||||||||||||||||||