| 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
MC/DC100%1/1
shift() || 0
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 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
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
| |||||||||||||||||||||
| 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
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
| |||||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 8 | 1; | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | __END__ | ||||||||||||||||||||