PostgreSQL/Backend/NoticeResponse.pm

filter: Statementstmt 47.8% 11 / 23 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 50.0% 1 / 2 totaltotal 36.5% 15 / 41 CC 5 SCAR 28.5
CC
5
Cov
34%
new_from_message
30.0
type
2.0
BEGIN
1.0
CRAP 17.2
↑ Summary PostgreSQL/Backend/AuthenticationRequest.pm »
1 package Protocol::Database::PostgreSQL::Backend::NoticeResponse;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 our $VERSION = '2.000'; # VERSION
7  
8 4 ▶use parent qw(Protocol::Database::PostgreSQL::Backend);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 Protocol::Database::PostgreSQL::Backend::NoticeResponse
13  
14 =head1 DESCRIPTION
15  
16 =cut
17  
18 0 ▶sub type { 'notice_response' }
Subroutine type: not called CC=1 SCAR=6.9
Pod undocumented
19  
20 sub new_from_message {
21 0 ▶ my ($class, $msg) = @_;
Subroutine new_from_message: not called CC=5 SCAR=34.0
Pod documented
22 0 (undef, my $size) = unpack('C1N1', $msg);
23 0 substr $msg, 0, 5, '';
24 0 my %notice;
25 FIELD:
26 0 ▶ while(length($msg)) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $msg) 0 0 0
27 0 my ($code, $str) = unpack('A1Z*', $msg);
28 0 ▶ last FIELD unless $code && $code ne "\0";
Branch: 1 branch
BranchTrueFalseTotal
unless $code and $code ne "\0" 0 0 0
Condition0%0/3
$code and $code ne "\0"
!ll&&!rl&&r
000
MC/DC0%0/2
$code and $code ne "\0"
$code $code ne "\0"
Truth table0%0/3
A and B
A= $codeB= $code ne "\0"
ABresult
0X0
100
111
29  
30 0 ▶ die "Unknown NOTICE code [$code]" unless exists $Protocol::Database::PostgreSQL::NOTICE_CODE{$code};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $Protocol::Database::PostgreSQL::NOTICE_CODE{$code} 0 0 0
31 0 $notice{$Protocol::Database::PostgreSQL::NOTICE_CODE{$code}} = $str;
32 0 substr $msg, 0, 2+length($str), '';
33 }
34 0 return $class->new(
35 %notice
36 );
37 }
38  
39 4 1;
40  
41 =head1 AUTHOR
42  
43 Tom Molesworth <TEAM@cpan.org>
44  
45 =head1 LICENSE
46  
47 Copyright Tom Molesworth 2010-2019. Licensed under the same terms as Perl itself.
48  
↑ Summary PostgreSQL/Backend/AuthenticationRequest.pm »