FormHandler/Widget/Field/Submit.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 3 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 77.2% 34 / 44 CC 4 SCAR 7.1
CC
4
Cov
88%
render
3.1
render_element
2.0
BEGIN
1.0
CRAP 2.0
« FormHandler/Widget/Field/Span.pm ↑ Summary FormHandler/Widget/Field/Upload.pm »
1 package HTML::FormHandler::Widget::Field::Submit;
2 # ABSTRACT: submit field rendering widget
3 20 $HTML::FormHandler::Widget::Field::Submit::VERSION = '0.410001';
4 20 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 20 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 20 ▶use HTML::FormHandler::Render::Util ('process_attrs');
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 sub render_element {
10 19 ▶ my ( $self, $result ) = @_;
Subroutine render_element: called CC=2 SCAR=7.0
Pod undocumented
11 19 ▶ $result ||= $self->result;
Condition33%1/3
$result ||= $self->result
l!l&&r!l&&!r
1900
MC/DC0%0/2
$result ||= $self->result
$result $self->result
Truth table33%1/3
A ||= B
A= $resultB= $self->result
ABresult
1X1
011
000
12  
13 19 my $output = '<input type="submit" name="';
14 19 $output .= $self->html_name . '"';
15 19 $output .= ' id="' . $self->id . '"';
16 19 $output .= ' value="' . $self->html_filter($self->_localize($self->value)) . '"';
17 19 $output .= process_attrs($self->element_attributes($result));
18 19 $output .= ' />';
19 19 return $output;
20 }
21  
22 sub render {
23 18 ▶ my ( $self, $result ) = @_;
Subroutine render: called CC=3 SCAR=11.2
Pod undocumented
24 18 ▶ $result ||= $self->result;
Condition66%2/3
$result ||= $self->result
l!l&&r!l&&!r
1440
MC/DC0%0/2
$result ||= $self->result
$result $self->result
Truth table66%2/3
A ||= B
A= $resultB= $self->result
ABresult
1X1
011
000
25 18 ▶ die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result;
Branch: 1 branch
BranchTrueFalseTotal
unless $result 0 18 18
26 18 my $output = $self->render_element( $result );
27 18 return $self->wrap_field( $result, $output );
28 }
29  
30 20 1;
31  
32 __END__
33  
34 =pod
35  
36 =encoding UTF-8
37  
38 =head1 NAME
39  
40 HTML::FormHandler::Widget::Field::Submit - submit field rendering widget
41  
42 =head1 VERSION
43  
44 version 0.410001
45  
46 =head1 SYNOPSIS
47  
48 Renders a submit field.
49  
50 =head1 AUTHOR
51  
52 FormHandler Contributors - see HTML::FormHandler
53  
54 =head1 COPYRIGHT AND LICENSE
55  
56 This software is copyright (c) 2017 by Gerda Shank.
57  
58 This is free software; you can redistribute it and/or modify it under
59 the same terms as the Perl 5 programming language system itself.
60  
61 =cut
« FormHandler/Widget/Field/Span.pm ↑ Summary FormHandler/Widget/Field/Upload.pm »