FormHandler/Widget/Field/Password.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 73.4% 36 / 49 CC 6 SCAR 10.8
CC
6
Cov
82%
render_element
4.2
render
3.2
BEGIN
1.0
CRAP 3.0
« FormHandler/Merge.pm ↑ Summary FormHandler/Field/RmElement.pm »
1 package HTML::FormHandler::Widget::Field::Password;
2 # ABSTRACT: password rendering widget
3 6 $HTML::FormHandler::Widget::Field::Password::VERSION = '0.410002';
4 6 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use HTML::FormHandler::Render::Util ('process_attrs');
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 7 ▶sub render_element {
Subroutine render_element: called CC=4 SCAR=14.4
Pod undocumented
10 7 my $self = shift;
11 7 ▶ my $result = shift || $self->result;
Condition33%1/3
shift() || $self->result
l!l&&r!l&&!r
700
MC/DC0%0/2
shift() || $self->result
shift() $self->result
Truth table33%1/3
A || B
A= shift()B= $self->result
ABresult
1X1
011
000
12 7 my $t;
13  
14 7 my $output = '<input type="password" name="'
15 . $self->html_name . '" id="' . $self->id . '"';
16 7 ▶ $output .= qq{ size="$t"} if $t = $self->size;
Branch: 1 branch
BranchTrueFalseTotal
if $t = $self->size 0 7 7
17 7 ▶ $output .= qq{ maxlength="$t"} if $t = $self->maxlength;
Branch: 1 branch
BranchTrueFalseTotal
if $t = $self->maxlength 0 7 7
18 7 $output .= ' value="' . $self->html_filter($result->fif) . '"';
19 7 $output .= process_attrs($self->element_attributes($result));
20 7 $output .= ' />';
21 7 return $output;
22 }
23  
24 7 ▶sub render {
Subroutine render: called CC=3 SCAR=11.8
Pod undocumented
25 7 my ( $self, $result ) = @_;
26 7 ▶ $result ||= $self->result;
Condition33%1/3
$result ||= $self->result
l!l&&r!l&&!r
700
MC/DC0%0/2
$result ||= $self->result
$result $self->result
Truth table33%1/3
A ||= B
A= $resultB= $self->result
ABresult
1X1
011
000
27 7 ▶ die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result;
Branch: 1 branch
BranchTrueFalseTotal
unless $result 0 7 7
28 7 my $output = $self->render_element( $result );
29 7 return $self->wrap_field( $result, $output );
30 }
31  
32 6 1;
33  
34 __END__
« FormHandler/Merge.pm ↑ Summary FormHandler/Field/RmElement.pm »