Tangence/Client/via/sshexec.pm

filter: Statementstmt 33.3% 6 / 18 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 21.0% 8 / 38 CC 6 SCAR 34.6
CC
6
Cov
20%
connect
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 31.8
↑ Summary Tangence/Client/via/sshunix.pm »
1 # You may distribute under the terms of either the GNU General Public License
2 # or the Artistic License (the same terms as Perl itself)
3 #
4 # (C) Paul Evans, 2010-2021 -- leonerd@leonerd.org.uk
5  
6 package Net::Async::Tangence::Client::via::sshexec 0.16;
7  
8 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub connect
12 0 ▶{
Subroutine connect: not called CC=6 SCAR=37.4
Pod undocumented
13 0 my $client = shift;
14 0 my ( $uri, %args ) = @_;
15  
16 0 my @sshargs;
17 0 ▶ push @sshargs, "-4" if $args{family} and $args{family} eq "inet4";
Branch: 1 branch
BranchTrueFalseTotal
if $args{"family"} and $args{"family"} eq "inet4" 0 0 0
Condition0%0/3
$args{"family"} and $args{"family"} eq "inet4"
!ll&&!rl&&r
000
MC/DC0%0/2
$args{"family"} and $args{"family"} eq "inet4"
$args{"family"} $args{"family"} eq "inet4"
Truth table0%0/3
A and B
A= $args{"family"}B= $args{"family"} eq "inet4"
ABresult
0X0
100
111
18 0 ▶ push @sshargs, "-6" if $args{family} and $args{family} eq "inet6";
Branch: 1 branch
BranchTrueFalseTotal
if $args{"family"} and $args{"family"} eq "inet6" 0 0 0
Condition0%0/3
$args{"family"} and $args{"family"} eq "inet6"
!ll&&!rl&&r
000
MC/DC0%0/2
$args{"family"} and $args{"family"} eq "inet6"
$args{"family"} $args{"family"} eq "inet6"
Truth table0%0/3
A and B
A= $args{"family"}B= $args{"family"} eq "inet6"
ABresult
0X0
100
111
19  
20 0 my $host = $uri->authority;
21  
22 0 my $path = $uri->path;
23 # Path will start with a leading /; we need to trim that
24 0 $path =~ s{^/}{};
25  
26 0 my $query = $uri->query;
27 0 ▶ defined $query or $query = "";
Branch: 1 branch
BranchTrueFalseTotal
defined $query or $query = "" 0 0 0
28 # $query will contain args to exec - split them on +
29 0 my @argv = split( m/\+/, $query );
30  
31 0 return $client->connect_exec( [ "ssh", @sshargs, $host, $path, @argv ] );
32 }
33  
34 1 0x55AA;
↑ Summary Tangence/Client/via/sshunix.pm »