Nested/Validator/Email.pm

filter: Statementstmt 100% 15 / 15 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 95.4% 21 / 22 CC 2 SCAR 3.4
CC
2
Cov
100%
email
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« Nested/Validator/Internal.pm ↑ Summary Nested/ProfileProvider/YAML.pm »
1 package FormValidator::Nested::Validator::Email;
2 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 # http://www.din.or.jp/~ohzaki/mail_regex.htm#Simplify
8 8 my $mail_regex =
9 q{(?:[-!#-'*+/-9=?A-Z^-~]+(?:\.[-!#-'*+/-9=?A-Z^-~]+)*|"(?:[!#-\[\]-} .
10 q{~]|\\\\[\x09 -~])*")@[-!#-'*+/-9=?A-Z^-~]+(?:\.[-!#-'*+/-9=?A-Z^-~]+} .
11 q{)*};
12  
13 52 ▶sub email {
Subroutine email: called CC=2 SCAR=6.9
Pod undocumented
14 52 my ( $value, $options, $req ) = @_;
15  
16 52 ▶ if ( $value =~ m/\A$mail_regex\z/o ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value =~ /\A$mail_regex\z/o) 37 15 52
17 37 return 1;
18 }
19 15 return 0;
20 }
21  
22  
23 8 1;
« Nested/Validator/Internal.pm ↑ Summary Nested/ProfileProvider/YAML.pm »