Perinci/Sub/XCompletion/sortsub_spec.pm

filter: Statementstmt 54.5% 18 / 33 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod 100% 1 / 1 totaltotal 45.1% 23 / 51 CC 6 SCAR 26.4
CC
6
Cov
44%
__ANON__
30.0
__ANON__
6.0
gen_completion
2.0
CRAP 14.0
↑ Summary Sah/Schema/sortsub/spec.pm »
1 package Perinci::Sub::XCompletion::sortsub_spec;
2  
3 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4 1 our $DATE = '2020-05-27'; # DATE
5 1 our $DIST = 'Sah-Schemas-SortSub'; # DIST
6 1 our $VERSION = '0.004'; # VERSION
7  
8 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Log::ger;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 our %SPEC;
14  
15 $SPEC{gen_completion} = {
16 1 v => 1.1,
17 };
18 0 ▶sub gen_completion {
Subroutine gen_completion: not called CC=1 SCAR=6.9
Pod documented
19 0 require Complete::Sequence;
20 0 require Complete::Util;
21 0 require Module::List::Tiny;
22  
23 0 my %fargs = @_;
24  
25 0 ▶ sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
26 0 my %cargs = @_;
27 0 ▶ my $word = $cargs{word} // '';
Condition0%0/2
$cargs{"word"} // ""
l!l
00
MC/DC0%0/1
$cargs{"word"} // ""
$cargs{"word"}
Truth table0%0/2
A
A= $cargs{"word"}
Aresult
11
00
28  
29 Complete::Sequence::complete_sequence(
30 word => $word,
31 sequence => [
32 0 ▶ sub {
Subroutine __ANON__: not called CC=5 SCAR=34.0
33 0 my $mods = Module::List::Tiny::list_modules("Sort::Sub::", {list_modules=>1});
34 0 my @words;
35 0 for (sort keys %$mods) {
36 0 s/\ASort::Sub:://;
37 0 ▶ push @words, $_ if $cargs{offer_unprefixed} // 1;
Branch: 1 branch
BranchTrueFalseTotal
if $cargs{"offer_unprefixed"} // 1 0 0 0
Condition0%0/2
$cargs{"offer_unprefixed"} // 1
l!l
00
MC/DC0%0/1
$cargs{"offer_unprefixed"} // 1
$cargs{"offer_unprefixed"}
Truth table0%0/2
A
A= $cargs{"offer_unprefixed"}
Aresult
11
00
38 0 ▶ push @words, "\$$_" if $cargs{offer_dollar_prefixed};
Branch: 1 branch
BranchTrueFalseTotal
if $cargs{"offer_dollar_prefixed"} 0 0 0
39 }
40 0 \@words;
41 },
42 0 ["", "<>", "<i>", "<r>", "<ir>"],
43 ],
44 );
45 0 };
46 }
47  
48 1 1;
49 # ABSTRACT: Generate completion for Sort::Sub spec
50  
51 __END__
↑ Summary Sah/Schema/sortsub/spec.pm »