Ext/Remote.pm

filter: Statementstmt 61.7% 21 / 34 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 6 / 9 Podpod 100% 2 / 2 totaltotal 58.0% 29 / 50 CC 2 SCAR 7.9
CC
2
Cov
57%
new
6.0
__ANON__
2.0
request
2.0
CRAP 2.2
« Ext/RemoteMap.pm ↑ Summary Ext/MsgPack/RPC/AsyncSession.pm »
1 package Neovim::Ext::Remote;
2 58 $Neovim::Ext::Remote::VERSION = '0.01';
3 58 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 58 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 58 ▶use base qw/Class::Accessor/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 use overload
7 0 ▶ '==' => sub { $_[0]->{code_data} == $_[1]->{code_data} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
8 58 fallback => 1,
9 58 ▶;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 58 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 58 ▶use MsgPack::Raw;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 58 __PACKAGE__->mk_accessors (qw/session handle code_data api_prefix api vars options/);
14  
15  
16 sub new
17 {
18 0 ▶ my ($this, $session, $api_prefix, $code_data) = @_;
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
19  
20 0 my $unpacker = MsgPack::Raw::Unpacker->new;
21 0 $unpacker->feed ($code_data->{data});
22  
23 0 ▶ my $class = ref ($this) || $this;
Condition0%0/3
ref $this || $this
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table0%0/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
24 0 my $self =
25 {
26 session => $session,
27 api_prefix => $api_prefix,
28 code_data => $code_data,
29 handle => $unpacker->next,
30 };
31  
32 0 my $obj = bless $self, $class;
33 0 $obj->api (Neovim::Ext::RemoteApi->new ($self, $api_prefix));
34 0 $obj->vars (Neovim::Ext::RemoteMap->new ($self, $api_prefix.'get_var',
35 $api_prefix.'set_var', $api_prefix.'del_var'));
36 0 $obj->options (Neovim::Ext::RemoteMap->new ($self, $api_prefix.'get_option',
37 $api_prefix.'set_option'));
38 0 return $obj;
39 }
40  
41  
42  
43 sub request
44 {
45 0 ▶ my ($this, $name, @args) = @_;
Subroutine request: not called CC=1 SCAR=6.9
Pod documented
46 0 $this->session->request ($name, $this, @args);
47 }
48  
49  
50 =head1 NAME
51  
52 Neovim::Ext::Remote - Neovim Remote class
53  
54 =head1 VERSION
55  
56 version 0.01
57  
58 =head1 SYNOPSIS
59  
60 use Neovim::Ext;
61  
62 =head1 METHODS
63  
64 =head2 request( $name, @args )
65  
66 Wrapper around C<$nvim>'s C<$request>.
67  
68 =cut
69  
70 58 1;
« Ext/RemoteMap.pm ↑ Summary Ext/MsgPack/RPC/AsyncSession.pm »