lib/WWW/Shopify/Liquid/Operator/Contains.pm

filter: Statementstmt 62.5% 10 / 16 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 31.7% 13 / 41 CC 5 SCAR 27.5
CC
5
Cov
37%
operate
30.0
symbol
2.0
priority
2.0
CRAP 15.7
« lib/WWW/Shopify/Liquid/Filter/Last.pm ↑ Summary lib/WWW/Shopify/Liquid/Tag/Paginate.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 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
BranchTrueFalseTotal
if ref $left and ref $left eq "ARRAY" 0 0 0
Condition0%0/3
ref $left and ref $left eq "ARRAY"
!ll&&!rl&&r
000
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"
ABresult
0X0
100
111
12 0 ▶ return !defined $_[4] || (defined $_[3] && index($_[3], $_[4]) != -1);
Condition0%0/6
!defined($_[4]) || defined $_[3] && index($_[3], $_[4]) != -1
l!l&&r!l&&!r
000
defined $_[3] and index($_[3], $_[4]) != -1
!ll&&!rl&&r
000
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
ABCresult
1XX1
0111
00X0
0100
13 }
14  
15 38 1;
« lib/WWW/Shopify/Liquid/Filter/Last.pm ↑ Summary lib/WWW/Shopify/Liquid/Tag/Paginate.pm »