lib/Rex/Helper/UserAgent.pm

filter: Statementstmt 40.0% 10 / 25 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 32.0% 16 / 50 CC 6 SCAR 20.7
CC
6
Cov
27%
get_basic_credentials
12.0
get
12.0
new
6.0
CRAP 7.9
« lib/Rex/Helper/SSH2/Expect.pm ↑ Summary lib/Rex/Interface/File/SSH.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Helper::UserAgent;
6  
7 32 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 32 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 32 our $VERSION = '1.16.1'; # VERSION
11  
12 32 ▶use base 'LWP::UserAgent';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
15 0 my $that = shift;
16 0 ▶ my $proto = ref($that) || $that;
Condition0%0/3
ref $that || $that
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table0%0/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
17 0 my $self = $proto->SUPER::new(@_);
18  
19 0 bless( $self, $proto );
20  
21 0 return $self;
22 }
23  
24 0 ▶sub get_basic_credentials {
Subroutine get_basic_credentials: not called CC=3 SCAR=24.8
Pod documented
25 0 my ($self) = @_;
26  
27 0 ▶ if ( exists $self->{__user__} && $self->{__password__} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"__user__"} and $self->{"__password__"}) 0 0 0
Condition0%0/3
exists $self->{"__user__"} and $self->{"__password__"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{"__user__"} and $self->{"__password__"}
exists $self->{"__user__"} $self->{"__password__"}
Truth table0%0/3
A and B
A= exists $self->{"__user__"}B= $self->{"__password__"}
ABresult
0X0
100
111
28 0 return $self->{__user__}, $self->{__password__};
29 }
30 0 return;
31 }
32  
33 0 ▶sub get {
Subroutine get: not called CC=3 SCAR=24.8
Pod documented
34 0 my ( $self, $url, %option ) = @_;
35 0 ▶ if ( exists $option{user} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $option{"user"}) 0 0 0
36 0 $self->{__user__} = $option{user};
37 }
38 0 ▶ if ( exists $option{password} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $option{"password"}) 0 0 0
39 0 $self->{__password__} = $option{password};
40 }
41  
42 0 return $self->SUPER::get($url);
43 }
44  
45 32 1;
« lib/Rex/Helper/SSH2/Expect.pm ↑ Summary lib/Rex/Interface/File/SSH.pm »