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.410001';
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 sub wrap_field {
10 3 ▶ my ( $self, $result, $rendered_widget ) = @_;
Subroutine wrap_field: called CC=5 SCAR=16.6
Pod undocumented
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 2 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__
31  
32 =pod
33  
34 =encoding UTF-8
35  
36 =head1 NAME
37  
38 HTML::FormHandler::Widget::Wrapper::TableInline - wrapper class for table layout that doesn't wrap compound fields
39  
40 =head1 VERSION
41  
42 version 0.410001
43  
44 =head1 AUTHOR
45  
46 FormHandler Contributors - see HTML::FormHandler
47  
48 =head1 COPYRIGHT AND LICENSE
49  
50 This software is copyright (c) 2017 by Gerda Shank.
51  
52 This is free software; you can redistribute it and/or modify it under
53 the same terms as the Perl 5 programming language system itself.
54  
55 =cut
« FormHandler/Traits.pm ↑ Summary FormHandler/Widget/Block.pm »