lib/HTML/FormFu/Filter/CompoundJoin.pm

filter: Statementstmt 100% 26 / 26 Branchbran 75.0% 3 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 85.3% 35 / 41 CC 4 SCAR 9.4
CC
4
Cov
91%
filter
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.6
« lib/HTML/FormFu/Filter/Encode.pm ↑ Summary lib/HTML/FormFu/Element/Label.pm »
1 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Filter::CompoundJoin;
4 8 $HTML::FormFu::Filter::CompoundJoin::VERSION = '2.09';
5 # ABSTRACT: CompoundJoin filter
6  
7 8 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 8 ▶use MooseX::Attribute::Chained;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 8 extends 'HTML::FormFu::Filter';
10  
11 8 with 'HTML::FormFu::Role::Filter::Compound';
12  
13 8 ▶use HTML::FormFu::Constants qw( $EMPTY_STR $SPACE );
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 8 has join => ( is => 'rw', traits => ['Chained'] );
16  
17 5 ▶sub filter {
Subroutine filter: called CC=4 SCAR=14.2
Pod undocumented
18 5 my ( $self, $value ) = @_;
19  
20 5 ▶ return if !defined $value || $value eq $EMPTY_STR;
Branch: 1 branch
BranchTrueFalseTotal
if not defined $value or $value eq $HTML::FormFu::Filter::CompoundJoin::EMPTY_STR 0 5 5
Condition33%1/3
not defined $value or $value eq $HTML::FormFu::Filter::CompoundJoin::EMPTY_STR
l!l&&r!l&&!r
005
MC/DC0%0/2
not defined $value or $value eq $HTML::FormFu::Filter::CompoundJoin::EMPTY_STR
not defined $value $value eq $HTML::FormFu::Filter::CompoundJoin::EMPTY_STR
Truth table33%1/3
not(A) or B
A= not defined $valueB= $value eq $HTML::FormFu::Filter::CompoundJoin::EMPTY_STR
ABresult
1X1
011
000
21  
22 5 ▶ my $join
Branch: 1 branch
BranchTrueFalseTotal
defined $self->join ? : 1 4 5
23 = defined $self->join
24 ? $self->join
25 : $SPACE;
26  
27 5 my @values = $self->_get_values($value);
28  
29 5 @values = grep { $_ ne '' } @values;
30  
31 5 $value = join $join, @values;
32  
33 5 return $value;
34 }
35  
36 8 __PACKAGE__->meta->make_immutable;
37  
38 8 1;
39  
40 __END__
« lib/HTML/FormFu/Filter/Encode.pm ↑ Summary lib/HTML/FormFu/Element/Label.pm »