Megaport.pm

filter: Statementstmt 78.5% 22 / 28 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 70.0% 7 / 10 Podpod 0.0% 0 / 1 totaltotal 65.9% 29 / 44 CC 3 SCAR 10.2
CC
3
Cov
69%
__ANON__
6.0
BUILD
6.0
__ANON__
2.0
CRAP 2.8
« Megaport/Internal/_Obj.pm ↑ Summary Megaport/Session.pm »
1 package Megaport;
2  
3 3 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = "1.00";
8  
9 3 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Megaport::Client;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use Megaport::Session;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use Class::Tiny qw(token username password client errstr), {
Subroutine BEGIN: called CC=1 SCAR=1.7
14 0 ▶ uri => sub { $ENV{MEGAPORT_URI} // 'https://api.megaport.com/v2' },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Condition0%0/2
$ENV{"MEGAPORT_URI"} // "https://api.megaport.com/v2"
l!l
00
MC/DC0%0/1
$ENV{"MEGAPORT_URI"} // "https://api.megaport.com/v2"
$ENV{"MEGAPORT_URI"}
Truth table0%0/2
A
A= $ENV{"MEGAPORT_URI"}
Aresult
11
00
15 debug => 0,
16 no_verify => 0,
17  
18 0 ▶ session => sub { Megaport::Session->new(client => shift->client) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
19 3 };
20  
21 0 ▶sub BUILD {
Subroutine BUILD: not called CC=2 SCAR=17.9
Pod undocumented
22 0 my ($self, $args) = @_;
23  
24 0 $self->client(
25 Megaport::Client->new(
26 uri => $self->uri,
27 no_verify => $self->no_verify,
28 debug => $self->debug
29 )
30 );
31  
32 0 ▶ if (!$self->client->login($args)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->client->login($args)) 0 0 0
33 0 croak 'Error logging in to Megaport: ' . $self->client->errstr;
34 }
35 }
36  
37 3 1;
38 __END__
« Megaport/Internal/_Obj.pm ↑ Summary Megaport/Session.pm »