blib/lib/WebDyne/Cloudflare/KV/Blob.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 4 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.7% 36 / 38 CC 4 SCAR 8.5
CC
4
Cov
100%
new
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.3
« blib/lib/WebDyne/Cloudflare/Hyperdrive/Blob.pm ↑ Summary blib/lib/WebDyne/Cloudflare/R2/Blob.pm »
1 package WebDyne::Cloudflare::KV::Blob;
2  
3 3 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use MIME::Base64 qw(encode_base64);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 our $VERSION='0.001';
9  
10 22 ▶sub new {
Subroutine new: called CC=4 SCAR=13.9
Pod undocumented
11 22 my ($class, $bytes)=@_;
12 22 ▶ die "KV blob requires a defined byte string\n"
Branch: 1 branch
BranchTrueFalseTotal
if not defined $bytes or ref $bytes 3 19 22
Condition100%3/3
not defined $bytes or ref $bytes
l!l&&r!l&&!r
1219
MC/DC100%2/2
not defined $bytes or ref $bytes
not defined $bytes ref $bytes
Truth table100%3/3
not(A) or B
A= not defined $bytesB= ref $bytes
ABresult
1X1
011
000
13 if (!defined($bytes)||ref($bytes));
14 19 ▶ die "KV blob requires bytes, not wide characters\n"
Branch: 1 branch
BranchTrueFalseTotal
unless utf8::downgrade($bytes, 1) 1 18 19
15 unless utf8::downgrade($bytes, 1);
16 18 my $self=bless(\$bytes, $class);
17 18 return $self;
18 }
19  
20  
21 18 ▶sub wire_value {
Subroutine wire_value: called CC=1 SCAR=0.0
Pod undocumented
22 18 my ($self)=@_;
23 18 return { type => 'bytes', base64 => encode_base64(${$self}, '') };
24 }
25  
26 3 1;
« blib/lib/WebDyne/Cloudflare/Hyperdrive/Blob.pm ↑ Summary blib/lib/WebDyne/Cloudflare/R2/Blob.pm »