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

filter: Statementstmt 72.2% 13 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 3 totaltotal 43.5% 17 / 39 CC 4 SCAR 21.7
CC
4
Cov
50%
operate
20.0
min_arguments
2.0
max_arguments
2.0
CRAP 8.8
« blib/lib/WWW/Shopify/Liquid/Filter/Date.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Operator.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::Round; use base 'WWW::Shopify::Liquid::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 30 ▶use Scalar::Util qw(looks_like_number);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub min_arguments { return 0; }
Subroutine min_arguments: not called CC=1 SCAR=6.9
Pod undocumented
10 0 ▶sub max_arguments { return 1; }
Subroutine max_arguments: not called CC=1 SCAR=6.9
Pod undocumented
11 sub operate {
12 0 ▶ my ($self, $hash, $operand, $decimals) = @_;
Subroutine operate: not called CC=4 SCAR=30.0
Pod undocumented
13 0 ▶ $decimals = 0 unless $decimals && looks_like_number($decimals) && $decimals >= 0;
Branch: 1 branch
BranchTrueFalseTotal
unless $decimals and &looks_like_number($decimals) and $decimals >= 0 0 0 0
Condition0%0/6
$decimals and &looks_like_number($decimals) and $decimals >= 0
!ll&&!rl&&r
000
$decimals and &looks_like_number($decimals)
!ll&&!rl&&r
000
MC/DC0%0/3
$decimals and &looks_like_number($decimals) and $decimals >= 0
$decimals &looks_like_number($decimals) $decimals >= 0
Truth table0%0/4
A and B and C
A= $decimalsB= &looks_like_number($decimals)C= $decimals >= 0
ABCresult
0XX0
10X0
1100
1111
14 0 return sprintf('%.' . $decimals . 'f', $operand);
15 }
16  
17 30 1;
« blib/lib/WWW/Shopify/Liquid/Filter/Date.pm ↑ Summary blib/lib/WWW/Shopify/Liquid/Operator.pm »