blib/lib/WebDyne/Cloudflare/SecretsStore/Error.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 100% 2 / 2 Conditioncond 50.0% 3 / 6 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 4 totaltotal 76.0% 35 / 46 CC 4 SCAR 8.1
CC
4
Cov
87%
new
4.2
message
2.0
BEGIN
1.0
CRAP 2.3
« blib/lib/WebDyne/Cloudflare/D1/Blob.pm ↑ Summary blib/lib/WebDyne/Cloudflare/Hyperdrive/Error.pm »
1 package WebDyne::Cloudflare::SecretsStore::Error;
2  
3 2 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use overload '""' => 'as_string', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION='0.001';
9  
10 2 my %message=(
11 SECRETS_STORE_ERROR => 'Secrets Store request failed',
12 SECRETS_STORE_HOST_ERROR => 'Secrets Store host call failed',
13 SECRETS_STORE_PROTOCOL_ERROR => 'Invalid Secrets Store protocol response or request',
14 SECRETS_STORE_CAPABILITY_ERROR => 'Secrets Store capability is invalid or has expired',
15 SECRETS_STORE_BINDING_ERROR => 'Secrets Store binding is not available to this request',
16 SECRETS_STORE_READ_ERROR => 'Secrets Store retrieval failed',
17 );
18  
19 7 ▶sub new {
Subroutine new: called CC=4 SCAR=14.3
Pod undocumented
20 7 my ($class, %opt)=@_;
21 7 my $name=$opt{'name'};
22 $name='SECRETS_STORE_ERROR'
23 7 ▶ unless (defined($name)&&!ref($name)&&exists($message{$name}));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $name and not ref $name and exists $message{$name} 1 6 7
Condition50%3/6
defined $name and not ref $name and exists $message{$name}
!ll&&!rl&&r
016
defined $name and not ref $name
!ll&&!rl&&r
007
MC/DC33%1/3
defined $name and not ref $name and exists $message{$name}
defined $name not ref $name exists $message{$name}
Truth table50%2/4
A and not(B) and C
A= defined $nameB= not ref $nameC= exists $message{$name}
ABCresult
0XX0
10X0
1100
1111
24 7 my $self=bless({ name => $name, message => $message{$name} }, $class);
25 7 return $self;
26 }
27  
28  
29 1 ▶sub name { return shift()->{'name'}; }
Subroutine name: called CC=1 SCAR=0.0
Pod undocumented
30 0 ▶sub message { return shift()->{'message'}; }
Subroutine message: not called CC=1 SCAR=6.9
Pod undocumented
31  
32  
33 21 ▶sub as_string {
Subroutine as_string: called CC=1 SCAR=0.0
Pod undocumented
34 21 my ($self)=@_;
35 21 return "$self->{'name'}: $self->{'message'}";
36 }
37  
38 2 1;
« blib/lib/WebDyne/Cloudflare/D1/Blob.pm ↑ Summary blib/lib/WebDyne/Cloudflare/Hyperdrive/Error.pm »