APIClient/TransportBase/TLSVerificationBase.pm

filter: Statementstmt 94.1% 16 / 17 Branchbran 75.0% 3 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 92.8% 26 / 28 CC 4 SCAR 7.7
CC
4
Cov
91%
_parse_tls_verification
3.0
_get_tls_verification
2.0
BEGIN
1.0
CRAP 2.2
« APIClient/Utils/HTTPSession.pm ↑ Summary APIClient/Authn/Username.pm »
1 package cPanel::APIClient::TransportBase::TLSVerificationBase;
2  
3 # Copyright 2020 cPanel, L. L. C.
4 # All rights reserved.
5 # http://cpanel.net
6 #
7 # This is free software; you can redistribute it and/or modify it under the
8 # same terms as Perl itself. See L<perlartistic>.
9  
10 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 8 ▶sub _parse_tls_verification {
Subroutine _parse_tls_verification: called CC=3 SCAR=11.1
14 8 my ( $self, $opts_hr ) = @_;
15  
16 8 ▶ if ( exists $opts_hr->{'tls_verification'} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $opts_hr->{"tls_verification"}) 7 1 8
17 7 my $tls_verification = delete $opts_hr->{'tls_verification'};
18  
19 7 ▶ if ( !grep { $_ eq $tls_verification } qw( on off ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {$_ eq $tls_verification;} "on", "off") 0 7 7
20 0 die "Bad “tls_verification”: $tls_verification";
21 }
22  
23 7 $self->{'tls_verification'} = $tls_verification;
24 }
25  
26 8 return $self->_get_tls_verification();
27 }
28  
29 8 ▶sub _get_tls_verification {
Subroutine _get_tls_verification: called CC=2 SCAR=6.9
30 8 my ($self) = @_;
31  
32 8 ▶ return $self->{'tls_verification'} || 'on';
Condition100%2/2
$self->{'tls_verification'} || 'on'
l!l
71
MC/DC100%1/1
$self->{'tls_verification'} || 'on'
$self->{'tls_verification'}
Truth table100%2/2
A
A= $self->{'tls_verification'}
Aresult
11
00
33 }
34  
35 2 1;
« APIClient/Utils/HTTPSession.pm ↑ Summary APIClient/Authn/Username.pm »