OAuth2/Client.pm

filter: Statementstmt 65.7% 23 / 35 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 53.8% 7 / 13 Podpod 100% 6 / 6 totaltotal 61.0% 36 / 59 CC 2 SCAR 7.3
CC
2
Cov
61%
new
6.0
id
2.0
secret
2.0
CRAP 2.1
« OAuth2/Profile/Password.pm ↑ Summary OAuth2.pm »
1 # Copyrights 2013-2019 by [Mark Overmeer <markov@cpan.org>].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.02.
5 # This code is part of distribution Net-OAuth2. Meta-POD processed
6 # with OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package Net::OAuth2::Client;
10 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 $VERSION = '0.67';
12  
13 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶use LWP::UserAgent ();
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use URI ();
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use Net::OAuth2::Profile::WebServer;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use Net::OAuth2::Profile::Password;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22  
23 sub new($$@)
24 0 ▶{ my ($class, $id, $secret, %opts) = @_;
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
25  
26 0 $opts{client_id} = $id;
27 0 $opts{client_secret} = $secret;
28  
29 # auto-shared user-agent
30 0 ▶ $opts{user_agent} ||= LWP::UserAgent->new;
Condition0%0/3
$opts{"user_agent"} ||= "LWP::UserAgent"->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts{"user_agent"} ||= "LWP::UserAgent"->new
$opts{"user_agent"} "LWP::UserAgent"->new
Truth table0%0/3
A ||= B
A= $opts{"user_agent"}B= "LWP::UserAgent"->new
ABresult
1X1
011
000
31  
32 0 bless \%opts, $class;
33 }
34  
35 #----------------
36  
37 0 ▶sub id() {shift->{NOC_id}}
Subroutine id: not called CC=1 SCAR=6.9
Pod documented
38 0 ▶sub secret() {shift->{NOC_secret}}
Subroutine secret: not called CC=1 SCAR=6.9
Pod documented
39 0 ▶sub user_agent() {shift->{NOC_agent}}
Subroutine user_agent: not called CC=1 SCAR=6.9
Pod documented
40  
41 #----------------
42  
43 sub web_server(@)
44 0 ▶{ my $self = shift;
Subroutine web_server: not called CC=1 SCAR=6.9
Pod documented
45 0 Net::OAuth2::Profile::WebServer->new(%$self, @_);
46 }
47  
48  
49  
50 sub password(@)
51 0 ▶{ my $self = shift;
Subroutine password: not called CC=1 SCAR=6.9
Pod documented
52 0 Net::OAuth2::Profile::Password->new(%$self, @_);
53 }
54  
55 1 1;
« OAuth2/Profile/Password.pm ↑ Summary OAuth2.pm »