KDBX/Key/Password.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod 100% 1 / 1 totaltotal 90.4% 38 / 42 SCAR 6.9
CC
2
Cov
94%
init
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« KDBX/Transaction.pm ↑ Summary KDBX/Loader/Raw.pm »
1 package File::KDBX::Key::Password;
2 # ABSTRACT: A password key
3  
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 7 ▶use Crypt::Digest qw(digest_data);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 7 ▶use Encode qw(encode);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use File::KDBX::Error;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 7 ▶use File::KDBX::Util qw(:class erase);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 7 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 7 extends 'File::KDBX::Key';
14  
15 7 our $VERSION = '0.904'; # VERSION
16  
17 sub init {
18 47 ▶ my $self = shift;
Subroutine init: called CC=2 SCAR=7.4
Pod documented
19 47 ▶ my $primitive = shift // throw 'Missing key primitive';
Condition33%1/3
shift() // throw("Missing key primitive")
l!l&&r!l&&!r
4700
MC/DC0%0/2
shift() // throw("Missing key primitive")
shift() throw("Missing key primitive")
Truth table33%1/3
A // B
A= shift()B= throw("Missing key primitive")
ABresult
1X1
011
000
20  
21 47 $self->_set_raw_key(digest_data('SHA256', encode('UTF-8', $primitive)));
22  
23 47 return $self->hide;
24 }
25  
26 7 1;
27  
28 __END__
« KDBX/Transaction.pm ↑ Summary KDBX/Loader/Raw.pm »