blib/lib/Net/POP3/XOAuth2.pm

filter: Statementstmt 75.0% 21 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 6 / 8 Podpod n/a totaltotal 60.0% 27 / 45 CC 4 SCAR 20.7
CC
4
Cov
60%
__ANON__
20.0
__ANON__
1.1
BEGIN
1.0
CRAP 7.9
↑ Summary Build »
1 package Net::POP3::XOAuth2;
2  
3 1 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Net::POP3;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our $VERSION = '0.0.1';
12  
13 0 ▶*Net::POP3::_AUTH = sub { shift->command('AUTH', $_[0])->response() == Net::POP3::CMD_OK };
Subroutine __ANON__: not called CC=1 SCAR=1.2
14 *Net::POP3::xoauth2 = sub {
15 0 ▶ @_ >= 1 && @_ <= 3 or croak 'usage: $pop3->xoauth2( USER, TOKEN )';
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 1 and @_ <= 3 or croak("usage: \$pop3->xoauth2( USER, TOKEN )") 0 0 0
Condition0%0/3
@_ >= 1 and @_ <= 3
!ll&&!rl&&r
000
MC/DC0%0/2
@_ >= 1 and @_ <= 3
@_ >= 1 @_ <= 3
Truth table0%0/3
A and B
A= @_ >= 1B= @_ <= 3
ABresult
0X0
100
111
16 0 my ($me, $user, $token) = @_;
17 0 my $xoauth2_token = encode_base64("user=$user\001auth=Bearer $token\001\001");
18 0 $xoauth2_token =~ s/[\r\n]//g;
19  
20 0 ▶ return unless ($me->_AUTH("XOAUTH2 $xoauth2_token"));
Branch: 1 branch
BranchTrueFalseTotal
unless $me->_AUTH("XOAUTH2 $xoauth2_token") 0 0 0
21  
22 0 $me->_get_mailbox_count();
23 1 };
24  
25 1 1;
26 __END__
↑ Summary Build »