Ext/Current.pm

filter: Statementstmt 63.0% 29 / 46 Branchbran 0.0% 0 / 10 Conditioncond 20.0% 1 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 66.6% 8 / 12 Podpod 100% 5 / 5 totaltotal 53.0% 43 / 81 CC 8 SCAR 19.0
CC
8
Cov
49%
line
20.0
buffer
6.0
window
6.0
CRAP 6.7
« Ext/MsgPack/RPC/Session.pm ↑ Summary Ext.pm »
1 package Neovim::Ext::Current;
2 55 $Neovim::Ext::Current::VERSION = '0.01';
3 55 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 55 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 55 ▶use base qw/Class::Accessor/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 55 ▶use Neovim::Ext::Plugin::Host;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 55 ▶use Neovim::Ext::RemoteApi;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 55 ▶use Neovim::Ext::RemoteMap;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 55 ▶use Neovim::Ext::RemoteSequence;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 55 __PACKAGE__->mk_accessors (qw/session/);
12  
13 55 my %fields;
14  
15  
16 sub new
17 {
18 11 ▶ my ($this, $session) = @_;
Subroutine new: called CC=2 SCAR=7.4
Pod documented
19  
20 11 ▶ my $class = ref ($this) || $this;
Condition33%1/3
ref $this || $this
l!l&&r!l&&!r
0110
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table33%1/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
21 11 my $self =
22 {
23 session => $session,
24 };
25  
26 11 return bless $self, $class;
27 }
28  
29  
30  
31 sub line
32 {
33 0 ▶ my $self = shift;
Subroutine line: not called CC=4 SCAR=30.0
Pod documented
34  
35 0 ▶ if (@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
36 {
37 0 my $line = shift;
38 0 ▶ defined ($line) ?
Branch: 1 branch
BranchTrueFalseTotal
defined $line ? : 0 0 0
39 $self->session->request ('nvim_set_current_line', $line) :
40 $self->session->request ('nvim_del_current_line');
41 }
42  
43 0 ▶ return $self->session->request ('nvim_get_current_line') // '';
Condition0%0/2
$self->session->request("nvim_get_current_line") // ""
l!l
00
MC/DC0%0/1
$self->session->request("nvim_get_current_line") // ""
$self->session->request("nvim_get_current_line")
Truth table0%0/2
A
A= $self->session->request("nvim_get_current_line")
Aresult
11
00
44 }
45  
46  
47  
48 sub buffer
49 {
50 0 ▶ my $self = shift;
Subroutine buffer: not called CC=2 SCAR=17.9
Pod documented
51  
52 0 ▶ if (@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
53 {
54 0 $self->session->request ('nvim_set_current_buf', shift);
55 }
56  
57 0 return $self->session->request ('nvim_get_current_buf');
58 }
59  
60  
61  
62 sub window
63 {
64 0 ▶ my $self = shift;
Subroutine window: not called CC=2 SCAR=17.9
Pod documented
65  
66 0 ▶ if (@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
67 {
68 0 $self->session->request ('nvim_set_current_win', shift);
69 }
70  
71 0 return $self->session->request ('nvim_get_current_win');
72 }
73  
74  
75  
76 sub tabpage
77 {
78 0 ▶ my $self = shift;
Subroutine tabpage: not called CC=2 SCAR=17.9
Pod documented
79  
80 0 ▶ if (@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
81 {
82 0 $self->session->request ('nvim_set_current_tabpage', shift);
83 }
84  
85 0 return $self->session->request ('nvim_get_current_tabpage');
86 }
87  
88  
89 =head1 NAME
90  
91 Neovim::Ext::Current - Neovim Current class
92  
93 =head1 VERSION
94  
95 version 0.01
96  
97 =head1 SYNOPSIS
98  
99 use Neovim::Ext;
100  
101 =head1 METHODS
102  
103 =head2 line( [$line] )
104  
105 Get or set the current line.
106  
107 =head2 buffer( [$buffer] )
108  
109 Get or set the current buffer.
110  
111 =head2 window( [$window] )
112  
113 Get or set the current window.
114  
115 =head2 tabpage( [$tabpage] )
116  
117 Get or set the current tabpage.
118  
119 =cut
120  
121 55 1;
« Ext/MsgPack/RPC/Session.pm ↑ Summary Ext.pm »