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

filter: Statementstmt 100% 21 / 21 Branchbran 50.0% 1 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 83.3% 30 / 36 SCAR 11.0
CC
3
Cov
92%
filter
2.0
parse_parameters
2.0
BEGIN
1.0
CRAP 3.0
« blib/lib/DTL/Fast/Filter/Filesizeformat.pm ↑ Summary blib/lib/DTL/Fast/Filter/Urlizetrunc.pm »
1 package DTL::Fast::Filter::Default;
2 5 ▶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 5 ▶use parent 'DTL::Fast::Filter';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 5 $DTL::Fast::FILTER_HANDLERS{'default'} = __PACKAGE__;
6  
7 #@Override
8 sub parse_parameters
9 {
10 27 ▶ my $self = shift;
Subroutine parse_parameters: called CC=2 SCAR=7.0
Pod undocumented
11 die $self->get_parse_error("no default value specified")
12 27 ▶ if not scalar @{$self->{'parameter'}};
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @{$self->{"parameter"};} 0 27 27
13 27 $self->{'default'} = $self->{'parameter'}->[0];
14 27 return $self;
15 }
16  
17 #@Override
18 sub filter
19 {
20 16 ▶ my ($self, $filter_manager, $value, $context) = @_;
Subroutine filter: called CC=2 SCAR=7.1
Pod undocumented
21
22 16 ▶ return $value || $self->{'default'}->render($context);
Condition66%2/3
$value || $self->{'default'}->render($context)
l!l&&r!l&&!r
880
MC/DC0%0/2
$value || $self->{'default'}->render($context)
$value $self->{'default'}->render($context)
Truth table66%2/3
A || B
A= $valueB= $self->{'default'}->render($context)
ABresult
1X1
011
000
23 }
24  
25 5 1;
« blib/lib/DTL/Fast/Filter/Filesizeformat.pm ↑ Summary blib/lib/DTL/Fast/Filter/Urlizetrunc.pm »