VPNDetection/OauthError.pm

filter: Statementstmt 100% 40 / 40 Branchbran 100% 6 / 6 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 12 / 12 Podpod 75.0% 3 / 4 totaltotal 98.4% 64 / 65 CC 5 SCAR 5.6
CC
5
Cov
100%
new
3.0
_from
3.0
BEGIN
1.0
CRAP 1.8
« VPNDetection/Database.pm ↑ Summary VPNDetection/Bogons.pm »
1 package VPNDetection::OauthError;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 ▶use parent 'VPNDetection::Error';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 our $VERSION = '3.15.0';
9  
10 # The authorization server refused an OAuth request, with the reason it gave.
11 # `kind` follows the status like any other failure's. Never retryable: every
12 # refusal answers the request exactly as it was sent.
13 32 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
14 32 my ($class, %args) = @_;
15 32 my $code = $args{error_code};
16 32 my $description = $args{error_description};
17 my $self = $class->SUPER::new(
18 kind => $args{kind} || 'bad_request',
19 status => $args{status},
20 32 ▶ message => defined $description ? "$code: $description" : $code,
Branch: 1 branch
BranchTrueFalseTotal
defined $description ? : 9 23 32
Condition100%2/2
$args{'kind'} || 'bad_request'
l!l
257
MC/DC100%1/1
$args{'kind'} || 'bad_request'
$args{'kind'}
Truth table100%2/2
A
A= $args{'kind'}
Aresult
11
00
21 );
22 32 $self->{error_code} = $code;
23 32 $self->{error_description} = $description;
24 32 return $self;
25 }
26  
27 # The subtype for a refusal. A code we have never seen stays this base type.
28 25 ▶sub _from {
Subroutine _from: called CC=3 SCAR=11.0
29 25 my ($class, %args) = @_;
30 my $type = $args{error_code} eq 'access_denied' ? 'VPNDetection::OauthAccessDeniedError'
31 25 ▶ : $args{error_code} eq 'expired_token' ? 'VPNDetection::OauthExpiredTokenError'
Branch: 2 branches
BranchTrueFalseTotal
$args{'error_code'} eq 'access_denied' ? : 2 23 25
$args{'error_code'} eq 'expired_token' ? : 2 21 23
32 : $class;
33 25 return $type->new(%args);
34 }
35  
36 34 ▶sub error_code { $_[0]->{error_code} }
Subroutine error_code: called CC=1 SCAR=0.0
Pod documented
37 11 ▶sub error_description { $_[0]->{error_description} }
Subroutine error_description: called CC=1 SCAR=0.0
Pod documented
38 15 ▶sub retryable { 0 }
Subroutine retryable: called CC=1 SCAR=0.0
Pod documented
39  
40 package VPNDetection::OauthAccessDeniedError;
41  
42 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
44  
45 7 our @ISA = ('VPNDetection::OauthError');
46 7 our $VERSION = '3.15.0';
47  
48 package VPNDetection::OauthExpiredTokenError;
49  
50 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
51 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 7 our @ISA = ('VPNDetection::OauthError');
54 7 our $VERSION = '3.15.0';
55  
56 7 1;
57  
58 __END__
« VPNDetection/Database.pm ↑ Summary VPNDetection/Bogons.pm »