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

filter: Statementstmt 58.8% 10 / 17 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 46.4% 13 / 28 CC 2 SCAR 10.0
CC
2
Cov
53%
operate
6.0
min_arguments
2.0
max_arguments
2.0
CRAP 2.7
« blib/lib/WWW/Shopify/Liquid/Filter/Camelize.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Tag/Whitespace.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 # TODO: Write this.
6 package WWW::Shopify::Liquid::Filter::ProductImgUrl;
7 30 ▶use base 'WWW::Shopify::Liquid::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 0 ▶sub min_arguments { return 1; }
Subroutine min_arguments: not called CC=1 SCAR=6.9
Pod undocumented
9 0 ▶sub max_arguments { return 1; }
Subroutine max_arguments: not called CC=1 SCAR=6.9
Pod undocumented
10 sub operate {
11 0 ▶ my ($self, $hash, $operand, @arguments) = @_;
Subroutine operate: not called CC=2 SCAR=17.9
Pod undocumented
12 0 ▶ return '' unless $operand;
Branch: 1 branch
BranchTrueFalseTotal
unless $operand 0 0 0
13 0 my $size = $arguments[0];
14 0 $operand =~ s/(\.(jpg|png|jpeg|gif))/_$size$1/i;
15 0 return $operand;
16 }
17  
18 30 1;
« blib/lib/WWW/Shopify/Liquid/Filter/Camelize.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Tag/Whitespace.pm »