lib/Neovim/RPC/API/AutoDiscover.pm

filter: Statementstmt 57.5% 19 / 33 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 55.5% 5 / 9 Podpod 0.0% 0 / 1 totaltotal 51.0% 24 / 47 CC 4 SCAR 20.3
CC
4
Cov
51%
__ANON__
20.0
BUILD
2.0
__ANON__
2.0
CRAP 7.6
« lib/Neovim/RPC/Plugin.pm ↑ Summary lib/Neovim/RPC/Plugin/FileToPackageName.pm »
1 package Neovim::RPC::API::AutoDiscover;
2 3 our $AUTHORITY = 'cpan:YANICK';
3 3 $Neovim::RPC::API::AutoDiscover::VERSION = '1.0.1';
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 with 'Neovim::RPC::API';
9  
10 3 ▶use Promises qw/ deferred /;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 ▶use experimental 'postderef';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 ▶sub BUILD {
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
15 0 my $self = shift;
16
17 0 $self->add_command({ name => 'vim_get_api_info' });
18  
19 0 ▶ $self->vim_get_api_info->then(sub {
Subroutine __ANON__: not called CC=4 SCAR=30.0
20 0 my( $response ) = @_;
21  
22 0 $self->channel_id( $response->[0] );
23  
24 0 my @funcs = $response->[1]{'functions'}->@*;
25  
26 0 for my $f ( @funcs ) {
27 0 ▶ next if $self->has_command( $f->{name} );
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_command($f->{"name"}) 0 0 0
28 0 $self->log->debugf( "adding function %s", $f->{name} );
29 0 $self->add_command( $f );
30 }
31  
32 0 ▶ while ( my ( $type, $val ) = each $response->[1]{'types'}->%* ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$$response[1]{"types"}}) 0 0 0
33 0 $self->types->{$type} = $val->{id};
34 }
35 })
36 0 ▶ ->then(sub{
Subroutine __ANON__: not called CC=1 SCAR=6.9
37 0 $self->vim_set_var( name => 'nvimx_channel', value => $self->channel_id );
38 })
39 0 ▶ ->then(sub{ $self->ready->resolve($self) });
Subroutine __ANON__: not called CC=1 SCAR=6.9
40 }
41  
42 3 1;
43  
44 __END__
« lib/Neovim/RPC/Plugin.pm ↑ Summary lib/Neovim/RPC/Plugin/FileToPackageName.pm »