Virt/Connection/Local.pm

filter: Statementstmt 64.0% 41 / 64 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 73.3% 11 / 15 Podpod 50.0% 2 / 4 totaltotal 61.3% 54 / 88 CC 3 SCAR 11.2
CC
3
Cov
60%
connect
12.0
is_secure
2.0
close
1.6
CRAP 3.1
« Virt/NwFilter.pm ↑ Summary Virt/Callback.pm »
1 ####################################################################
2 #
3 # This file was generated using XDR::Parse version v1.0.1
4 # and LibVirt version v12.9.0
5 #
6 # Don't edit this file, use the source template instead
7 #
8 # ANY CHANGES HERE WILL BE LOST !
9 #
10 ####################################################################
11  
12  
13 1 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use Future::AsyncAwait;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use Object::Pad ':experimental(inherit_field)';
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 class Sys::Async::Virt::Connection::Local v0.6.9;
20  
21 1 ▶inherit Sys::Async::Virt::Connection '$_in', '$_out';
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Future::IO;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use IO::Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use IO::Socket::UNIX;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Log::Any qw($log);
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 0 ▶field $_url :param :reader;
Subroutine url: not called CC=1 SCAR=2.6
Pod undocumented
30 field $_readonly :param = undef;
31 1 field $_socket :param = undef;
32  
33 0 ▶async method close() {
Subroutine close: not called CC=1 SCAR=4.9
Pod undocumented
34 # Work around for Future::IO which doesn't
35 # like handles being closed when there are
36 # outstanding read/write requests (causing
37 # warnings of undefined values)
38 0 $self->_finalize_io();
39 # When Future::IO and/or IO::Async are changed
40 # (ready_for_input() is where this happens),
41 # the handle *can* be closed.
42 # $_in->close;
43 0 return;
44 1 }
45  
46 0 ▶async method connect() {
Subroutine connect: not called CC=3 SCAR=24.8
Pod documented
47 # disect URL
48 0 ▶ $_socket //=
Branch: 1 branch
BranchTrueFalseTotal
$_readonly ? : 0 0 0
Condition0%0/2
$_socket //= '/run/libvirt/libvirt-sock' . ($_readonly ? "-ro" : "")
l!l
00
MC/DC0%0/1
$_socket //= '/run/libvirt/libvirt-sock' . ($_readonly ? "-ro" : "")
$_socket
Truth table0%0/2
A
A= $_socket
Aresult
11
00
49 '/run/libvirt/libvirt-sock' . ($_readonly ? '-ro' : '');
50  
51 0 my $sock = IO::Socket->new(
52 Domain => AF_UNIX,
53 Type => SOCK_STREAM,
54 );
55 0 binmode $sock, ':bytes';
56 0 $sock->blocking( 0 );
57  
58 0 $_in = $_out = $sock;
59 0 my $addr = sockaddr_un( $_socket );
60 0 await Future::IO->connect( $sock, $addr );
61 1 }
62  
63 0 ▶method is_secure() {
Subroutine is_secure: not called CC=1 SCAR=6.9
Pod documented
64 0 return 1;
65 1 }
66  
67 1 1;
68  
69  
70 __END__
« Virt/NwFilter.pm ↑ Summary Virt/Callback.pm »