blib/lib/WWW/Shopify/Liquid/Filter/Money.pm

filter: Statementstmt 62.5% 10 / 16 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 52.0% 13 / 25 CC 3 SCAR 18.7
CC
3
Cov
50%
operate
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« blib/lib/WWW/Shopify/Liquid/Filter/Keys.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Filter/ImgTag.pm »
1 #!/usr/bin/perl
2 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 30 ▶package WWW::Shopify::Liquid::Filter::Money; use base 'WWW::Shopify::Liquid::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 sub operate {
7 0 ▶ return undef unless $_[2];
Subroutine operate: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless $_[2] 0 0 0
8 0 my $format = $_[1]->{shop}->{money_format};
9 0 ▶ $format = '$ {{ amount }}' unless $format;
Branch: 1 branch
BranchTrueFalseTotal
unless $format 0 0 0
10 0 my $amount = sprintf('%.2f', $_[2] / 100.0);
11 0 $format =~ s/\{\{\s*amount\s*\}\}/$amount/;
12 0 return $format;
13 }
14 30 1;
« blib/lib/WWW/Shopify/Liquid/Filter/Keys.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Filter/ImgTag.pm »