Catalyst/Controller/HTML/FormFu/Action/MultiFormMethod.pm

filter: Statementstmt 100% 33 / 33 Branchbran 66.6% 4 / 6 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 84.9% 45 / 53 CC 8 SCAR 17.8
CC
8
Cov
89%
execute
8.4
BEGIN
1.0
BEGIN
1.0
CRAP 5.9
« Catalyst/Controller/HTML/FormFu/Action/MultiForm.pm ↑ Summary Catalyst/Helper/HTML/FormFu.pm »
1 package Catalyst::Controller::HTML::FormFu::Action::MultiFormMethod;
2  
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 9 our $VERSION = '2.04'; # VERSION
6 9 our $AUTHORITY = 'cpan:NIGELM'; # AUTHORITY
7  
8 9 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 9 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 9 extends 'Catalyst::Controller::HTML::FormFu::ActionBase::Form';
13  
14 4 ▶sub execute {
Subroutine execute: called CC=8 SCAR=21.2
Pod documented
15 4 my $self = shift;
16 4 my ( $controller, $c ) = @_;
17  
18 4 ▶ if ( $self->reverse =~ $self->_form_action_regex ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->reverse =~ $self->_form_action_regex) 1 3 4
19  
20 # don't load form again
21 1 return $self->next::method(@_);
22 }
23  
24 3 my $config = $controller->_html_formfu_config;
25  
26 return $self->next::method(@_)
27 unless exists $self->attributes->{ActionClass}
28 3 ▶ && $self->attributes->{ActionClass}[0] eq $config->{multiform_method_action};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->attributes->{"ActionClass"} and $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_method_action"} 0 3 3
Condition33%1/3
exists $self->attributes->{"ActionClass"} and $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_method_action"}
!ll&&!rl&&r
003
MC/DC0%0/2
exists $self->attributes->{"ActionClass"} and $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_method_action"}
exists $self->attributes->{"ActionClass"} $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_method_action"}
Truth table33%1/3
A and B
A= exists $self->attributes->{"ActionClass"}B= $self->attributes->{"ActionClass"}[0] eq $config->{"multiform_method_action"}
ABresult
0X0
100
111
29  
30 3 my $multi = $controller->_multiform;
31  
32 3 for ( @{ $self->{_attr_params} } ) {
33 3 for my $method (split) {
34 3 ▶ $c->log->debug($method) if $c->debug;
Branch: 1 branch
BranchTrueFalseTotal
if $c->debug 0 3 3
35  
36 3 ▶ my $args = $controller->$method($c) || {};
Condition50%1/2
$controller->$method($c) || {}
l!l
30
MC/DC0%0/1
$controller->$method($c) || {}
$controller->$method($c)
Truth table50%1/2
A
A= $controller->$method($c)
Aresult
11
00
37  
38 3 $multi->populate($args);
39 }
40 }
41  
42 3 $multi->process;
43  
44 3 $c->stash->{ $config->{multiform_stash} } = $multi;
45 3 $c->stash->{ $config->{form_stash} } = $multi->current_form;
46  
47 3 $self->next::method(@_);
48 }
49  
50 9 1;
51  
52 __END__
« Catalyst/Controller/HTML/FormFu/Action/MultiForm.pm ↑ Summary Catalyst/Helper/HTML/FormFu.pm »