Policy/Rule/Length.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 94.4% 34 / 36 CC 2 SCAR 2.2
CC
2
Cov
100%
check
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Policy/Exception/NoAlgorithm.pm ↑ Summary Policy/Exception/EmptyPassword.pm »
1 package Password::Policy::Rule::Length;
2 3 $Password::Policy::Rule::Length::VERSION = '0.04';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use parent 'Password::Policy::Rule';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶use String::Multibyte;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 ▶use Password::Policy::Exception::InsufficientLength;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶sub default_arg { return 8; }
Subroutine default_arg: called CC=1 SCAR=0.0
Pod undocumented
13  
14 sub check {
15 18 ▶ my $self = shift;
Subroutine check: called CC=2 SCAR=6.9
Pod undocumented
16 18 my $password = $self->prepare(shift);
17 17 my $strmb = String::Multibyte->new('UTF8');
18 17 my $len = $strmb->length($password);
19 17 ▶ if($len < $self->arg) {
Branch: 1 branch
BranchTrueFalseTotal
if ($len < $self->arg) 4 13 17
20 4 Password::Policy::Exception::InsufficientLength->throw;
21 }
22 13 return 1;
23 }
24  
25 3 1;
26  
27 __END__
« Policy/Exception/NoAlgorithm.pm ↑ Summary Policy/Exception/EmptyPassword.pm »