lib/WWW/Shopify/Liquid/Filter/Date.pm

filter: Statementstmt 58.8% 10 / 17 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 30.9% 13 / 42 CC 6 SCAR 31.6
CC
6
Cov
34%
operate
42.0
min_arguments
2.0
max_arguments
2.0
CRAP 23.5
« lib/WWW/Shopify/Liquid/Operator/NotRegex.pm ↑ Summary lib/WWW/Shopify/Liquid/Exception.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::Date; use base 'WWW::Shopify::Liquid::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 0 ▶sub min_arguments { return 1; }
Subroutine min_arguments: not called CC=1 SCAR=6.9
Pod undocumented
7 0 ▶sub max_arguments { return 1; }
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 ▶ return '' unless $operand;
Branch: 1 branch
BranchTrueFalseTotal
unless $operand 0 0 0
11 0 ▶ $operand = DateTime->now if !ref($operand) && $operand eq "now";
Branch: 1 branch
BranchTrueFalseTotal
if not ref $operand and $operand eq "now" 0 0 0
Condition0%0/3
not ref $operand and $operand eq "now"
!ll&&!rl&&r
000
MC/DC0%0/2
not ref $operand and $operand eq "now"
not ref $operand $operand eq "now"
Truth table0%0/3
not(A) and B
A= not ref $operandB= $operand eq "now"
ABresult
0X0
100
111
12 0 ▶ return DateTime->from_epoch( epoch => $operand )->strftime(@arguments) if $operand && !ref($operand);
Branch: 1 branch
BranchTrueFalseTotal
if $operand and not ref $operand 0 0 0
Condition0%0/3
$operand and not ref $operand
!ll&&!rl&&r
000
MC/DC0%0/2
$operand and not ref $operand
$operand not ref $operand
Truth table0%0/3
A and not(B)
A= $operandB= not ref $operand
ABresult
0X0
100
111
13 0 return $operand->strftime(@arguments);
14 }
15  
16 38 1;
« lib/WWW/Shopify/Liquid/Operator/NotRegex.pm ↑ Summary lib/WWW/Shopify/Liquid/Exception.pm »