FormHandler/Widget/Wrapper/Table.pm

filter: Statementstmt 100% 29 / 29 Branchbran 90.0% 9 / 10 Conditioncond 66.6% 4 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 87.2% 48 / 55 CC 9 SCAR 18.9
CC
9
Cov
93%
wrap_field
9.1
BEGIN
1.0
BEGIN
1.0
CRAP 6.6
« FormHandler/Render/Simple.pm ↑ Summary FormHandler/Field/Repeatable.pm »
1 package HTML::FormHandler::Widget::Wrapper::Table;
2 # ABSTRACT: wrapper class for table layout
3 2 $HTML::FormHandler::Widget::Wrapper::Table::VERSION = '0.410002';
4 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 with 'HTML::FormHandler::Widget::Wrapper::Base';
6 2 ▶use HTML::FormHandler::Render::Util ('process_attrs');
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use HTML::Entities qw( encode_entities );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 39 ▶sub wrap_field {
Subroutine wrap_field: called CC=9 SCAR=22.1
Pod undocumented
10 39 my ( $self, $result, $rendered_widget ) = @_;
11  
12 39 ▶ return $rendered_widget if ( $self->has_flag('is_compound') && $self->get_tag('no_compound_wrapper') );
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_flag("is_compound") and $self->get_tag("no_compound_wrapper") 0 39 39
Condition66%2/3
$self->has_flag("is_compound") and $self->get_tag("no_compound_wrapper")
!ll&&!rl&&r
3540
MC/DC0%0/2
$self->has_flag("is_compound") and $self->get_tag("no_compound_wrapper")
$self->has_flag("is_compound") $self->get_tag("no_compound_wrapper")
Truth table66%2/3
A and B
A= $self->has_flag("is_compound")B= $self->get_tag("no_compound_wrapper")
ABresult
0X0
100
111
13  
14 39 my $output = "\n<tr" . process_attrs($self->wrapper_attributes($result)) . ">";
15 39 ▶ if ( $self->has_flag('is_compound') ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->has_flag('is_compound')) { } 4 35 39
elsif ($self->do_label and length $self->label > 0) { } 29 12 41
16 4 $output .= '<td>' . $self->do_render_label($result) . '</td></tr>';
17 }
18 ▶ elsif ( $self->do_label && length( $self->label ) > 0 ) {
Condition66%2/3
$self->do_label and length $self->label > 0
!ll&&!rl&&r
6029
MC/DC50%1/2
$self->do_label and length $self->label > 0
$self->do_label length $self->label > 0
Truth table66%2/3
A and B
A= $self->do_labelB= length $self->label > 0
ABresult
0X0
100
111
19 29 $output .= '<td>' . $self->do_render_label($result) . '</td>';
20 }
21 39 ▶ if ( !$self->has_flag('is_compound') ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->has_flag("is_compound")) 35 4 39
22 35 $output .= '<td>';
23 }
24 39 $output .= $rendered_widget;
25 $output .= qq{\n<span class="error_message">$_</span>}
26 39 for map { encode_entities($_) } $result->all_errors;
27 39 ▶ if ( !$self->has_flag('is_compound') ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->has_flag("is_compound")) 35 4 39
28 35 $output .= "</td></tr>\n";
29 }
30 39 return $output;
31 }
32  
33 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 2 1;
35  
36 __END__
« FormHandler/Render/Simple.pm ↑ Summary FormHandler/Field/Repeatable.pm »