Policy/Rule.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran n/a Conditioncond 75.0% 6 / 8 MC/DCmcdc 20.0% 1 / 5 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 5 totaltotal 72.3% 34 / 47 CC 4 SCAR 5.0
CC
4
Cov
90%
arg
2.0
prepare
2.0
new
2.0
CRAP 1.6
« Policy/Exception.pm ↑ Summary Policy/Encryption.pm »
1 package Password::Policy::Rule;
2 8 $Password::Policy::Rule::VERSION = '0.06';
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 ▶use Password::Policy::Exception::EmptyPassword;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 33 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
9 33 my $class = shift;
10 33 ▶ my $arg = shift || 0;
Condition100%2/2
shift() || 0
l!l
285
MC/DC100%1/1
shift() || 0
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
11  
12 33 my $self = bless {
13 arg => $arg
14 } => $class;
15 33 return $self;
16 }
17  
18 60 ▶sub arg {
Subroutine arg: called CC=2 SCAR=7.1
Pod undocumented
19 60 my $self = shift;
20 60 ▶ return $self->{arg} || $self->default_arg;
Condition66%2/3
$self->{'arg'} || $self->default_arg
l!l&&r!l&&!r
44160
MC/DC0%0/2
$self->{'arg'} || $self->default_arg
$self->{'arg'} $self->default_arg
Truth table66%2/3
A || B
A= $self->{'arg'}B= $self->default_arg
ABresult
1X1
011
000
21 }
22  
23 0 ▶sub check { return "This was not implemented properly."; }
Subroutine check: not called CC=1 SCAR=6.9
Pod undocumented
24 14 ▶sub default_arg { return 1; }
Subroutine default_arg: called CC=1 SCAR=0.0
Pod undocumented
25  
26 55 ▶sub prepare {
Subroutine prepare: called CC=2 SCAR=7.1
Pod undocumented
27 55 my ($self, $password) = @_;
28 55 ▶ return $password || Password::Policy::Exception::EmptyPassword->throw;
Condition66%2/3
$password || 'Password::Policy::Exception::EmptyPassword'->throw
l!l&&r!l&&!r
5050
MC/DC0%0/2
$password || 'Password::Policy::Exception::EmptyPassword'->throw
$password 'Password::Policy::Exception::EmptyPassword'->throw
Truth table33%1/3
A || B
A= $passwordB= 'Password::Policy::Exception::EmptyPassword'->throw
ABresult
1X1
011
000
29 }
30  
31 8 1;
32  
33 __END__
« Policy/Exception.pm ↑ Summary Policy/Encryption.pm »