FormHandler/Widget/Field/Upload.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/Submit.pm ↑ Summary FormHandler/Field/Button.pm »
1 package HTML::FormHandler::Widget::Field::Upload;
2 # ABSTRACT: update field rendering widget
3 2 $HTML::FormHandler::Widget::Field::Upload::VERSION = '0.410001';
4 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use HTML::FormHandler::Render::Util ('process_attrs');
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 sub render_element {
9 3 ▶ my ( $self, $result ) = @_;
Subroutine render_element: called CC=2 SCAR=7.0
Pod undocumented
10  
11 3 ▶ $result ||= $self->result;
Condition33%1/3
$result ||= $self->result
l!l&&r!l&&!r
300
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 3 my $output;
13 3 $output = '<input type="file" name="';
14 3 $output .= $self->html_name . '"';
15 3 $output .= ' id="' . $self->id . '"';
16 3 $output .= process_attrs($self->element_attributes($result));
17 3 $output .= ' />';
18 3 return $output;
19 }
20  
21 sub render {
22 3 ▶ my ( $self, $result ) = @_;
Subroutine render: called CC=3 SCAR=11.2
Pod undocumented
23 3 ▶ $result ||= $self->result;
Condition66%2/3
$result ||= $self->result
l!l&&r!l&&!r
210
MC/DC0%0/2
$result ||= $self->result
$result $self->result
Truth table66%2/3
A ||= B
A= $resultB= $self->result
ABresult
1X1
011
000
24 3 ▶ die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result;
Branch: 1 branch
BranchTrueFalseTotal
unless $result 0 3 3
25 3 my $output = $self->render_element( $result );
26 3 return $self->wrap_field( $result, $output );
27 }
28  
29 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 2 1;
31  
32 __END__
33  
34 =pod
35  
36 =encoding UTF-8
37  
38 =head1 NAME
39  
40 HTML::FormHandler::Widget::Field::Upload - update field rendering widget
41  
42 =head1 VERSION
43  
44 version 0.410001
45  
46 =head1 SYNOPSIS
47  
48 Renders an Upload 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/Submit.pm ↑ Summary FormHandler/Field/Button.pm »