blib/lib/DTL/Fast/Filter/Length.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 90.9% 30 / 33 SCAR 11.0
CC
3
Cov
96%
filter
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/DTL/Fast/Expression/Operator/Binary/Or.pm ↑ Summary blib/lib/DTL/Fast/Filter/Lengthis.pm »
1 package DTL::Fast::Filter::Length;
2 3 ▶use strict; use utf8; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use parent 'DTL::Fast::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 3 $DTL::Fast::FILTER_HANDLERS{'length'} = __PACKAGE__;
6  
7 #@Override
8 sub filter
9 {
10 6 ▶ shift; # self
Subroutine filter: called CC=3 SCAR=11.0
Pod undocumented
11 6 shift; # filter_manager
12 6 my $value = shift; # value
13 6 shift; # context
14  
15 6 ▶ if( ref $value eq 'ARRAY' )
Branch: 1 branch
BranchTrueFalseTotal
if (ref $value eq 'ARRAY') { } 3 3 6
16 {
17 3 $value = scalar @$value;
18 }
19 else
20 {
21 3 ▶ $value = length( $value // '' );
Condition50%1/2
$value // ""
l!l
30
MC/DC0%0/1
$value // ""
$value
Truth table50%1/2
A
A= $value
Aresult
11
00
22 }
23
24 6 return $value;
25 }
26  
27 3 1;
« blib/lib/DTL/Fast/Expression/Operator/Binary/Or.pm ↑ Summary blib/lib/DTL/Fast/Filter/Lengthis.pm »