Reply/Plugin/Autocomplete/Packages.pm

filter: Statementstmt 66.6% 18 / 27 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 57.1% 24 / 42 CC 5 SCAR 27.4
CC
5
Cov
51%
tab_handler
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 15.5
« Reply/Util.pm ↑ Summary Reply/Plugin/DataDump.pm »
1 package Reply::Plugin::Autocomplete::Packages;
2 1 our $AUTHORITY = 'cpan:DOY';
3 1 $Reply::Plugin::Autocomplete::Packages::VERSION = '0.42';
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 # ABSTRACT: tab completion for package names
7  
8 1 ▶use base 'Reply::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Module::Runtime '$module_name_rx';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Reply::Util 'all_packages';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 0 ▶sub tab_handler {
Subroutine tab_handler: not called CC=5 SCAR=34.0
Pod documented
16 0 my $self = shift;
17 0 my ($line) = @_;
18  
19 # $module_name_rx does not permit trailing ::
20 0 my ($before, $package_fragment) = $line =~ /(.*?)(${module_name_rx}:?:?)$/;
21 0 ▶ return unless $package_fragment;
Branch: 1 branch
BranchTrueFalseTotal
unless $package_fragment 0 0 0
22 0 ▶ return if $before =~ /^#/; # command
Branch: 1 branch
BranchTrueFalseTotal
if $before =~ /^#/ 0 0 0
23 0 ▶ return if $before =~ /->\s*$/; # method call
Branch: 1 branch
BranchTrueFalseTotal
if $before =~ /->\s*$/ 0 0 0
24 0 ▶ return if $before =~ /[\$\@\%\&\*]\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
if $before =~ /[\$\@\%\&\*]\s*$/ 0 0 0
25  
26 0 return sort grep { index($_, $package_fragment) == 0 } all_packages();
27 }
28  
29 1 1;
30  
31 __END__
« Reply/Util.pm ↑ Summary Reply/Plugin/DataDump.pm »