lib/WWW/Shopify/Liquid/Tag/Paginate.pm

filter: Statementstmt 48.1% 13 / 27 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 35.4% 17 / 48 CC 5 SCAR 27.5
CC
5
Cov
35%
process
30.0
paginate
2.0
BEGIN
1.0
CRAP 15.6
« lib/WWW/Shopify/Liquid/Operator/Contains.pm ↑ Summary lib/WWW/Shopify/Liquid/Operator/Array.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 ▶use WWW::Shopify::Liquid::Tag;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 package WWW::Shopify::Liquid::Tag::Paginate;
8 38 ▶use base 'WWW::Shopify::Liquid::Tag::Enclosing';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub process {
Subroutine process: not called CC=5 SCAR=34.0
Pod undocumented
11 0 my ($self, $hash, $action, $pipeline) = @_;
12 0 ▶ return '' unless int(@{$self->{arguments}}) > 0;
Branch: 1 branch
BranchTrueFalseTotal
unless int @{$self->{"arguments"};} > 0 0 0 0
13 0 my $result = $self->{arguments}->[0]->$action($pipeline, $hash);
14 0 my ($string, $argument);
15 0 ▶ if ($result && ref($result) && $result->isa('WWW::Shopify::Liquid::Operator::By')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result and ref $result and $result->isa('WWW::Shopify::Liquid::Operator::By')) { } 0 0 0
Condition0%0/6
$result and ref $result and $result->isa("WWW::Shopify::Liquid::Operator::By")
!ll&&!rl&&r
000
$result and ref $result
!ll&&!rl&&r
000
MC/DC0%0/3
$result and ref $result and $result->isa("WWW::Shopify::Liquid::Operator::By")
$result ref $result $result->isa("WWW::Shopify::Liquid::Operator::By")
Truth table0%0/4
A and B and C
A= $resultB= ref $resultC= $result->isa("WWW::Shopify::Liquid::Operator::By")
ABCresult
0XX0
10X0
1100
1111
16 0 my $reference = $pipeline->variable_reference($hash, $result->{operands}->[0], 1);
17 0 my $amount = $result->{operands}->[1]->$action($pipeline, $hash);
18 0 $$reference = $self->paginate($hash, $reference, $amount);
19 0 my $result = $self->{contents}->$action($pipeline, $hash);
20 0 return $result;
21 } else {
22 0 return $self;
23 }
24 }
25  
26 0 ▶sub paginate {
Subroutine paginate: not called CC=1 SCAR=6.9
Pod undocumented
27 0 my ($self, $hash, $variable_reference, $amount) = @_;
28 0 return $self;
29 }
30  
31 38 1;
« lib/WWW/Shopify/Liquid/Operator/Contains.pm ↑ Summary lib/WWW/Shopify/Liquid/Operator/Array.pm »