API/Base.pm

filter: Statementstmt 71.4% 15 / 21 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 3 / 3 totaltotal 64.8% 24 / 37 CC 4 SCAR 11.7
CC
4
Cov
59%
base_uri
6.0
xml
6.0
api_uri
2.1
CRAP 3.2
« API/Request.pm ↑ Summary API/Notification.pm »
1 package PagSeguro::API::Base;
2 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 3 ▶use XML::LibXML;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # attributes
7 3 has email => (is => 'rw');
8 3 has token => (is => 'rw');
9  
10 4 ▶has environment => (is => 'rw', default => sub { 'production' });
Subroutine __ANON__: called CC=1 SCAR=0.0
11 4 ▶has debug => (is => 'rw', default => sub { 0 });
Subroutine __ANON__: called CC=1 SCAR=0.0
12  
13 0 ▶sub base_uri {
Subroutine base_uri: not called CC=2 SCAR=17.9
Pod documented
14 0 my $self = shift;
15 0 ▶ return $self->environment eq 'production'?
Branch: 1 branch
BranchTrueFalseTotal
$self->environment eq 'production' ? : 0 0 0
16 'https://pagseguro.uol.com.br' :
17 'https://sandbox.pagseguro.uol.com.br';
18 }
19  
20 1 ▶sub api_uri {
Subroutine api_uri: called CC=2 SCAR=7.2
Pod documented
21 1 my $self = shift;
22 1 ▶ return $self->environment eq 'production'?
Branch: 1 branch
BranchTrueFalseTotal
$self->environment eq 'production' ? : 1 0 1
23 'https://ws.pagseguro.uol.com.br/v2' :
24 'https://ws.sandbox.pagseguro.uol.com.br/v2';
25 }
26  
27 0 ▶sub xml {
Subroutine xml: not called CC=2 SCAR=17.9
Pod documented
28 0 my $self = shift;
29  
30 0 my $xml = XML::LibXML->new;
31 0 ▶ my $doc = $xml->parse_string( $_[0] ) if $_[0];
Branch: 1 branch
BranchTrueFalseTotal
if $_[0] 0 0 0
32  
33 0 return $doc;
34 }
35  
36 3 1;
37  
38 __END__
« API/Request.pm ↑ Summary API/Notification.pm »