Policy/Rule/Whitespace.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.5% 28 / 29 CC 2 SCAR 2.9
CC
2
Cov
100%
check
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Policy/Rule/Uppercase.pm ↑ Summary Policy/Exception/InvalidAlgorithm.pm »
1 package Password::Policy::Rule::Whitespace;
2 1 $Password::Policy::Rule::Whitespace::VERSION = '0.06';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use parent 'Password::Policy::Rule';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Password::Policy::Exception::InsufficientWhitespace;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 6 ▶sub check {
Subroutine check: called CC=2 SCAR=6.9
Pod undocumented
11 6 my $self = shift;
12 6 my $password = $self->prepare(shift);
13 5 my @whitespace = ($password =~ m/\s/g);
14 5 my $count = scalar @whitespace;
15 5 ▶ if($count < $self->arg) {
Branch: 1 branch
BranchTrueFalseTotal
if ($count < $self->arg) 2 3 5
16 2 Password::Policy::Exception::InsufficientWhitespace->throw;
17 }
18 3 return 1;
19 }
20  
21 1 1;
22  
23 __END__
« Policy/Rule/Uppercase.pm ↑ Summary Policy/Exception/InvalidAlgorithm.pm »