Ext/Funcs.pm

filter: Statementstmt 74.0% 20 / 27 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 62.5% 5 / 8 Podpod 100% 1 / 1 totaltotal 65.8% 27 / 41 CC 2 SCAR 3.3
CC
2
Cov
70%
new
2.1
__ANON__
2.0
AUTOLOAD
1.3
CRAP 1.4
« Ext/MsgPack/RPC/Stream.pm ↑ Summary Ext/RemoteApi.pm »
1 package Neovim::Ext::Funcs;
2 55 $Neovim::Ext::Funcs::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  
7 55 __PACKAGE__->mk_accessors (qw/nvim/);
8  
9  
10 sub new
11 {
12 11 ▶ my ($this, $nvim) = @_;
Subroutine new: called CC=2 SCAR=7.4
Pod documented
13  
14 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
15 11 my $self =
16 {
17 nvim => $nvim,
18 };
19  
20 11 return bless $self, $class;
21 }
22  
23  
24  
25 sub DESTROY
26 ▶{
Subroutine DESTROY: not called CC=1 SCAR=0.0
27 }
28  
29  
30 55 our $AUTOLOAD;
31  
32 sub AUTOLOAD
33 {
34 0 ▶ my $methodName;
Subroutine AUTOLOAD: not called CC=1 SCAR=2.9
35 0 ($methodName = $AUTOLOAD) =~ s/.*:://;
36  
37 # Install
38 55 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
39 0 *{$AUTOLOAD} = sub
40 {
41 0 ▶ my $this = shift;
Subroutine __ANON__: not called CC=1 SCAR=6.9
42 0 $this->nvim->call ($methodName, @_);
43 0 };
44  
45 0 goto &$AUTOLOAD;
46 }
47  
48 =head1 NAME
49  
50 Neovim::Ext::Funcs - Neovim Funcs class
51  
52 =head1 VERSION
53  
54 version 0.01
55  
56 =head2 SYNOPSIS
57  
58 use Neovim::Ext;
59  
60 my $funcs = Neovim::Ext::Funcs->new ($nvim);
61  
62 # Call the vimscript 'join' function.
63 # Produces 'first, last'
64 my $out = $funcs->join (['first', 'last'], ', ');
65  
66 =head2 DESCRIPTION
67  
68 Helper package for functional vimscript interface. Methods are created on first use.
69  
70 =cut
71  
72 55 1;
« Ext/MsgPack/RPC/Stream.pm ↑ Summary Ext/RemoteApi.pm »