FormHandler/Widget/Wrapper/TableInline.pm

filter: Statementstmt 96.1% 25 / 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 82.9% 34 / 41 CC 5 SCAR 12.2
CC
5
Cov
88%
wrap_field
5.3
BEGIN
1.0
BEGIN
1.0
CRAP 3.4
« FormHandler/Traits.pm ↑ Summary FormHandler/Widget/Block.pm »
1 package HTML::FormHandler::Widget::Wrapper::TableInline;
2 # ABSTRACT: wrapper class for table layout that doesn't wrap compound fields
3 1 $HTML::FormHandler::Widget::Wrapper::TableInline::VERSION = '0.410002';
4 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 with 'HTML::FormHandler::Widget::Wrapper::Base';
6 1 ▶use HTML::FormHandler::Render::Util ('process_attrs');
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use HTML::Entities qw( encode_entities );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶sub wrap_field {
Subroutine wrap_field: called CC=5 SCAR=16.6
Pod undocumented
10 3 my ( $self, $result, $rendered_widget ) = @_;
11  
12 3 ▶ return $rendered_widget if $self->has_flag('is_compound');
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_flag("is_compound") 1 2 3
13  
14 2 my $output = "\n<tr" . process_attrs($self->wrapper_attributes($result)) . ">";
15 2 ▶ if ( $self->do_label && length( $self->label ) > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->do_label and length $self->label > 0) 2 0 2
Condition33%1/3
$self->do_label and length $self->label > 0
!ll&&!rl&&r
002
MC/DC0%0/2
$self->do_label and length $self->label > 0
$self->do_label length $self->label > 0
Truth table33%1/3
A and B
A= $self->do_labelB= length $self->label > 0
ABresult
0X0
100
111
16 2 $output .= '<td>' . $self->do_render_label($result) . '</td>';
17 }
18 2 $output .= '<td>';
19 2 $output .= $rendered_widget;
20 $output .= qq{\n<span class="error_message">$_</span>}
21 0 for map { encode_entities($_) } $result->all_errors;
22 2 $output .= "</td></tr>\n";
23  
24 2 return $output;
25 }
26  
27 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 1;
29  
30 __END__
« FormHandler/Traits.pm ↑ Summary FormHandler/Widget/Block.pm »