lib/Bracket/Form/Password/ResetEmail.pm

filter: Statementstmt 72.2% 13 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 50.0% 1 / 2 totaltotal 61.5% 16 / 26 CC 2 SCAR 11.0
CC
2
Cov
65%
validate
6.0
BEGIN
1.0
update_model
1.0
CRAP 3.0
« lib/Bracket/Controller/Auth.pm ↑ Summary script/bracket_cgi.pl »
1 package Bracket::Form::Password::ResetEmail;
2  
3 4 ▶use HTML::FormHandler::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 extends 'HTML::FormHandler::Model::DBIC';
5 4 with 'HTML::FormHandler::Render::Simple';
6  
7 4 has '+item_class' => ( default => 'Player' );
8 4 has_field 'email' => ( type => 'Email', noupdate => 1 );
9 4 has_field 'submit' => ( type => 'Submit', value => 'Send email to reset password' );
10  
11 0 ▶sub validate {
Subroutine validate: not called CC=2 SCAR=17.9
Pod documented
12 0 my $self = shift;
13  
14 # Check the given email to see that it exists in the database
15 0 my $is_valid =
16 $self->schema->resultset('Player')
17 ->find( { email => $self->field('email')->value } );
18 0 ▶ if ( !$is_valid ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($is_valid) 0 0 0
19 0 $self->field('email')->add_error('Email not on file');
20 }
21
22 0 return;
23 }
24  
25 # Turn off update_model
26  
27 0 ▶sub update_model {}
Subroutine update_model: not called CC=1 SCAR=0.0
Pod undocumented
28  
29 4 ▶no HTML::FormHandler::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 4 __PACKAGE__->meta->make_immutable;
31 4 1
« lib/Bracket/Controller/Auth.pm ↑ Summary script/bracket_cgi.pl »