FormHandler/Widget/Wrapper/SimpleInline.pm

filter: Statementstmt 50.0% 14 / 28 Branchbran 12.5% 1 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 41.3% 19 / 46 CC 7 SCAR 33.8
CC
7
Cov
38%
wrap_field
41.4
BEGIN
1.0
BEGIN
1.0
CRAP 29.3
« FormHandler/Widget/Form/Role/HTMLAttributes.pm ↑ Summary FormHandler/Params.pm »
1 package HTML::FormHandler::Widget::Wrapper::SimpleInline;
2 # ABSTRACT: simple field wrapper
3 1 $HTML::FormHandler::Widget::Wrapper::SimpleInline::VERSION = '0.410002';
4 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use HTML::Entities qw( encode_entities );
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 with 'HTML::FormHandler::Widget::Wrapper::Base';
9  
10  
11 1 ▶sub wrap_field {
Subroutine wrap_field: called CC=7 SCAR=37.2
Pod undocumented
12 1 my ( $self, $result, $rendered_widget ) = @_;
13  
14 1 ▶ return $rendered_widget if $self->has_flag('is_compound');
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_flag("is_compound") 1 0 1
15  
16 0 my $output = "\n";
17 0 my $tag = $self->wrapper_tag;
18 0 my $start_tag = $self->get_tag('wrapper_start');
19 0 ▶ if( defined $start_tag ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $start_tag) { } 0 0 0
20 0 $output .= $start_tag;
21 }
22 else {
23 0 $output .= "<$tag" . process_attrs( $self->wrapper_attributes($result) ) . ">";
24 }
25  
26 0 ▶ if ( $self->do_label && length( $self->label ) > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->do_label and length $self->label > 0) 0 0 0
Condition0%0/3
$self->do_label and length $self->label > 0
!ll&&!rl&&r
000
MC/DC0%0/2
$self->do_label and length $self->label > 0
$self->do_label length $self->label > 0
Truth table0%0/3
A and B
A= $self->do_labelB= length $self->label > 0
ABresult
0X0
100
111
27 0 $output .= $self->do_render_label($result);
28 }
29  
30 0 $output .= $rendered_widget;
31 $output .= qq{\n<span class="error_message">$_</span>}
32 0 for map { encode_entities($_) } $result->all_errors;
33  
34 0 my $end_tag = $self->get_tag('wrapper_end');
35 0 ▶ $output .= defined $end_tag ? $end_tag : "</$tag>";
Branch: 1 branch
BranchTrueFalseTotal
defined $end_tag ? : 0 0 0
36  
37 0 return "$output\n";
38 }
39  
40 1 1;
41  
42 __END__
« FormHandler/Widget/Form/Role/HTMLAttributes.pm ↑ Summary FormHandler/Params.pm »