lib/Rex/Interface/Connection/Local.pm

filter: Statementstmt 87.8% 29 / 33 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 3 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 80.0% 12 / 15 Podpod 0.0% 0 / 10 totaltotal 60.8% 45 / 74 CC 5 SCAR 8.2
CC
5
Cov
75%
get_connection_type
6.0
new
2.0
get_fs_connection_object
2.0
CRAP 2.3
« lib/Rex/Batch.pm ↑ Summary lib/Rex/Shared/Var/Common.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Interface::Connection::Local;
6  
7 69 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 69 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 69 our $VERSION = '1.16.1'; # VERSION
11  
12 69 ▶use Rex::Interface::Connection::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 69 ▶use Rex::Group::Entry::Server;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 69 ▶use base qw(Rex::Interface::Connection::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 103 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod undocumented
18 103 my $that = shift;
19 103 ▶ my $proto = ref($that) || $that;
Condition33%1/3
ref $that || $that
l!l&&r!l&&!r
01030
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table33%1/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
20 103 my $self = $that->SUPER::new(@_);
21  
22 103 $self->{server} = Rex::Group::Entry::Server->new( name => "<local>" );
23  
24 103 bless( $self, $proto );
25  
26 103 return $self;
27 }
28  
29 0 ▶sub error { }
Subroutine error: not called CC=1 SCAR=0.0
Pod undocumented
30 34 ▶sub connect { }
Subroutine connect: called CC=1 SCAR=0.0
Pod undocumented
31 27 ▶sub disconnect { }
Subroutine disconnect: called CC=1 SCAR=0.0
Pod undocumented
32 214 ▶sub get_connection_object { my ($self) = @_; return $self; }
Subroutine get_connection_object: called CC=1 SCAR=0.0
Pod undocumented
33 0 ▶sub get_fs_connection_object { my ($self) = @_; return $self; }
Subroutine get_fs_connection_object: not called CC=1 SCAR=6.9
Pod undocumented
34 34 ▶sub is_connected { return 1; }
Subroutine is_connected: called CC=1 SCAR=0.0
Pod undocumented
35 34 ▶sub is_authenticated { return 1; }
Subroutine is_authenticated: called CC=1 SCAR=0.0
Pod undocumented
36  
37 0 ▶sub get_auth_user {
Subroutine get_auth_user: not called CC=1 SCAR=6.9
Pod undocumented
38 0 return Rex::Config::get_user();
39 }
40  
41 3721 ▶sub get_connection_type {
Subroutine get_connection_type: called CC=4 SCAR=17.9
Pod undocumented
42 3721 my ($self) = @_;
43  
44 3721 ▶ if ( ( $self->{is_sudo} && $self->{is_sudo} == 1 ) || Rex::is_sudo() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"is_sudo"} and $self->{"is_sudo"} == 1 or Rex::is_sudo()) 0 3721 3721
Condition33%2/6
$self->{"is_sudo"} and $self->{"is_sudo"} == 1 or Rex::is_sudo()
l!l&&r!l&&!r
003721
$self->{"is_sudo"} and $self->{"is_sudo"} == 1
!ll&&!rl&&r
372100
MC/DC0%0/3
$self->{"is_sudo"} and $self->{"is_sudo"} == 1 or Rex::is_sudo()
$self->{"is_sudo"} $self->{"is_sudo"} == 1 Rex::is_sudo()
Truth table20%1/5
A and B or C
A= $self->{"is_sudo"}B= $self->{"is_sudo"} == 1C= Rex::is_sudo()
ABCresult
11X1
0X11
1011
0X00
1000
45 0 return "Sudo";
46 }
47  
48 3721 return "Local";
49 }
50  
51 69 1;
« lib/Rex/Batch.pm ↑ Summary lib/Rex/Shared/Var/Common.pm »