lib/HTML/FormFu/Inflator.pm

filter: Statementstmt 94.7% 36 / 38 Branchbran 75.0% 6 / 8 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 84.7% 50 / 59 CC 7 SCAR 11.8
CC
7
Cov
88%
process
5.0
return_error
3.3
BEGIN
1.0
CRAP 3.3
« lib/HTML/FormFu/Filter/Split.pm ↑ Summary lib/HTML/FormFu/Filter/Regex.pm »
1 413 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Inflator;
4 413 $HTML::FormFu::Inflator::VERSION = '2.09';
5 # ABSTRACT: Inflator Base Class
6  
7 413 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 413 extends 'HTML::FormFu::Processor';
9  
10 413 ▶use HTML::FormFu::Exception::Inflator;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 413 ▶use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 30 ▶sub process {
Subroutine process: called CC=5 SCAR=16.2
Pod documented
14 30 my ( $self, $values ) = @_;
15  
16 30 my $return;
17 my @errors;
18  
19 30 ▶ if ( ref $values eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $values eq 'ARRAY') { } 1 29 30
20 1 my @return;
21 1 for my $value (@$values) {
22 2 ($return) = eval { $self->inflator($value) };
23  
24 2 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 0 2 2
25 0 push @errors, $self->return_error($@);
26 0 push @return, $value;
27 }
28 else {
29 2 push @return, $return;
30 }
31 }
32 1 $return = \@return;
33 }
34 else {
35 29 ($return) = eval { $self->inflator($values) };
36  
37 29 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 3 26 29
38 3 push @errors, $self->return_error($@);
39 3 $return = $values;
40 }
41 }
42  
43 30 return ( $return, @errors );
44 }
45  
46 3 ▶sub return_error {
Subroutine return_error: called CC=3 SCAR=12.0
Pod undocumented
47 3 my ( $self, $err ) = @_;
48  
49 3 ▶ if ( !blessed $err || !$err->isa('HTML::FormFu::Exception::Inflator') ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (builtin::blessed($err) and $err->isa("HTML::FormFu::Exception::Inflator")) 3 0 3
Condition33%1/3
builtin::blessed($err) and $err->isa("HTML::FormFu::Exception::Inflator")
!ll&&!rl&&r
300
MC/DC0%0/2
builtin::blessed($err) and $err->isa("HTML::FormFu::Exception::Inflator")
builtin::blessed($err) $err->isa("HTML::FormFu::Exception::Inflator")
Truth table33%1/3
A and B
A= builtin::blessed($err)B= $err->isa("HTML::FormFu::Exception::Inflator")
ABresult
0X0
100
111
50 3 $err = HTML::FormFu::Exception::Inflator->new;
51 }
52  
53 3 return $err;
54 }
55  
56 413 __PACKAGE__->meta->make_immutable;
57  
58 413 1;
59  
60 __END__
« lib/HTML/FormFu/Filter/Split.pm ↑ Summary lib/HTML/FormFu/Filter/Regex.pm »