| 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 | package WWW::Shopify::Liquid::Operator::Contains; | ||||||||||||||||||||||||||||||||||
| 6 | 38 | ▶ | use base 'WWW::Shopify::Liquid::Operator'; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 7 | 0 | ▶ | sub symbol { return 'contains'; } | ||||||||||||||||||||||||||||||||
|
Subroutine
symbol: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub priority { return 11; } | ||||||||||||||||||||||||||||||||
|
Subroutine
priority: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub operate { | ||||||||||||||||||||||||||||||||
|
Subroutine
operate: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 10 | 0 | my ($self, $hash, $action, $left, $right) = @_; | |||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | return int(grep { $_ eq $right } @$left) > 0 if ref($left) && ref($left) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $left and ref $left eq "ARRAY"
MC/DC0%0/2
ref $left and ref $left eq "ARRAY"
ref $left
ref $left eq "ARRAY"
Truth table0%0/3
A and B
A= ref $leftB= ref $left eq "ARRAY"
| |||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | return !defined $_[4] || (defined $_[3] && index($_[3], $_[4]) != -1); | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
!defined($_[4]) || defined $_[3] && index($_[3], $_[4]) != -1
defined $_[3] and index($_[3], $_[4]) != -1
MC/DC0%0/3
!defined($_[4]) || defined $_[3] && index($_[3], $_[4]) != -1
!defined($_[4])
defined $_[3]
index($_[3], $_[4]) != -1
Truth table0%0/4
not(A) || B and C
A= !defined($_[4])B= defined $_[3]C= index($_[3], $_[4]) != -1
| |||||||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||
| 15 | 38 | 1; | |||||||||||||||||||||||||||||||||