Remote/Connector/SSH.pm

filter: Statementstmt 80.0% 24 / 30 Branchbran 25.0% 1 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 1 totaltotal 62.9% 34 / 54 CC 7 SCAR 23.0
CC
7
Cov
62%
__ANON__
30.0
_build_ssh_perl_command
2.7
_build_ssh_perl_command
2.7
CRAP 9.9
« Remote/Role/LogForwarder.pm ↑ Summary Remote/Proxy.pm »
1 package Object::Remote::Connector::SSH;
2  
3 12 ▶use Object::Remote::ModuleSender;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use Object::Remote::Handle;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 24 ▶use String::ShellQuote;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 24 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 with 'Object::Remote::Role::Connector::PerlInterpreter';
9  
10 has ssh_to => (is => 'ro', required => 1);
11  
12 has ssh_perl_command => (is => 'lazy');
13  
14 1 ▶has ssh_options => (is => 'ro', default => sub { [ '-A' ] });
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 1 ▶has ssh_command => (is => 'ro', default => sub { 'ssh' });
Subroutine __ANON__: called CC=1 SCAR=0.0
17  
18 1 ▶sub _build_ssh_perl_command {
Subroutine _build_ssh_perl_command: called CC=2 SCAR=10.0
19 0 ▶ my ($self) = @_;
Subroutine _build_ssh_perl_command: not called CC=2 SCAR=10.0
20 0 my $perl_command = $self->perl_command;
21  
22 return [
23 0 ▶ do { my $c = $self->ssh_command; ref($c) ? @$c : $c },
Branch: 2 branches
BranchTrueFalseTotal
ref $c ? : 0 0 0
ref $c ? : 0 1 1
24 0 @{$self->ssh_options}, $self->ssh_to,
25 shell_quote(@$perl_command),
26 ];
27 }
28  
29 1 ▶sub final_perl_command { shift->ssh_perl_command }
Subroutine final_perl_command: called CC=1 SCAR=0.0
Pod undocumented
30  
31 12 ▶no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 push @Object::Remote::Connection::Guess, sub {
34 for ($_[0]) {
35 # 0-9 a-z _ - first char, those or . subsequent - hostnamish
36 ▶ if (defined and !ref and /^(?:.*?\@)?[\w\-][\w\-\.]/) {
Condition0%0/6
defined $_ and not ref $_ and /^(?:.*?\@)?[\w\-][\w\-\.]/
!ll&&!rl&&r
000
defined $_ and not ref $_
!ll&&!rl&&r
000
MC/DC0%0/3
defined $_ and not ref $_ and /^(?:.*?\@)?[\w\-][\w\-\.]/
defined $_ not ref $_ /^(?:.*?\@)?[\w\-][\w\-\.]/
Truth table0%0/4
A and not(B) and C
A= defined $_B= not ref $_C= /^(?:.*?\@)?[\w\-][\w\-\.]/
ABCresult
0XX0
10X0
1100
1111
37 my $host = shift(@_);
38 return __PACKAGE__->new(@_, ssh_to => $host);
39 }
40 }
41 return;
42 };
43  
44 1;
« Remote/Role/LogForwarder.pm ↑ Summary Remote/Proxy.pm »