Passphrase/Encoder.pm

filter: Statementstmt 91.6% 22 / 24 Branchbran 50.0% 1 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 100% 3 / 3 totaltotal 82.9% 34 / 41 CC 3 SCAR 5.9
CC
3
Cov
86%
accepts_hash
3.1
recode_hash
2.0
BEGIN
1.0
CRAP 1.8
« Passphrase/Util/Crypt64.pm ↑ Summary Passphrase/PassphraseHash.pm »
1 package Crypt::Passphrase::Encoder;
2 7 $Crypt::Passphrase::Encoder::VERSION = '0.024';
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 ▶use parent 'Crypt::Passphrase::Validator';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 ▶use Crypt::SysRandom;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 16 ▶sub random_bytes {
Subroutine random_bytes: called CC=1 SCAR=0.0
Pod documented
11 16 my ($self, $count) = @_;
12 16 return Crypt::SysRandom::random_bytes($count);
13 }
14  
15 sub crypt_subtypes;
16  
17 28 ▶sub accepts_hash {
Subroutine accepts_hash: called CC=3 SCAR=11.2
Pod documented
18 28 my ($self, $hash) = @_;
19 28 ▶ $self->{accepts_hash} //= do {
Condition66%2/3
$self->{"accepts_hash"} //= do { my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return; qr/ \A \$ (?: $string ) [\$,] /x }
l!l&&r!l&&!r
8200
MC/DC0%0/2
$self->{"accepts_hash"} //= do { my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return; qr/ \A \$ (?: $string ) [\$,] /x }
$self->{"accepts_hash"} do { my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return; qr/ \A \$ (?: $string ) [\$,] /x }
Truth table66%2/3
A //= B
A= $self->{"accepts_hash"}B= do { my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return; qr/ \A \$ (?: $string ) [\$,] /x }
ABresult
1X1
011
000
20 20 ▶ my $string = join '|', map { quotemeta } $self->crypt_subtypes or return;
Branch: 1 branch
BranchTrueFalseTotal
my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return 20 0 20
21 20 qr/ \A \$ (?: $string ) [\$,] /x;
22 };
23 28 return scalar $hash =~ $self->{accepts_hash};
24 }
25  
26 0 ▶sub recode_hash {
Subroutine recode_hash: not called CC=1 SCAR=6.9
Pod documented
27 0 my ($self, $hash, @args) = @_;
28 0 return $hash;
29 }
30  
31 7 1;
32  
33 #ABSTRACT: Base class for Crypt::Passphrase encoders
34  
35 __END__
« Passphrase/Util/Crypt64.pm ↑ Summary Passphrase/PassphraseHash.pm »