Cmd/cpanauthors_mods.pm

filter: Statementstmt 51.6% 16 / 31 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 50.0% 20 / 40 CC 4 SCAR 24.7
CC
4
Cov
46%
handle_cmd
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
↑ Summary CmdBundle/cpanauthors.pm »
1 package App::lcpan::Cmd::cpanauthors_mods;
2  
3 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4 1 our $DATE = '2019-12-26'; # DATE
5 1 our $DIST = 'App-lcpan-CmdBundle-cpanauthors'; # DIST
6 1 our $VERSION = '0.002'; # 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  
12 1 require App::lcpan;
13  
14 1 our %SPEC;
15  
16 $SPEC{handle_cmd} = {
17 1 v => 1.1,
18 summary => 'List Acme::CPANAuthors modules available on CPAN',
19 args => {
20 %App::lcpan::common_args,
21 %App::lcpan::query_multi_args,
22 %App::lcpan::fauthor_args,
23 %App::lcpan::fdist_args,
24 %App::lcpan::flatest_args,
25 %App::lcpan::sort_modules_args,
26 },
27 };
28 0 ▶sub handle_cmd {
Subroutine handle_cmd: not called CC=4 SCAR=30.0
Pod documented
29 0 my %args = @_;
30  
31 0 my $res = App::lcpan::modules(%args, namespaces=>['Acme::CPANAuthors']);
32  
33 # remove Acme::CPANAuthors itself
34 0 ▶ if ($args{detail}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($args{'detail'}) { } 0 0 0
35 0 $res->[2] = [grep {$_->{module} ne 'Acme::CPANAuthors'} @{$res->[2]}];
36 } else {
37 0 $res->[2] = [grep {$_ ne 'Acme::CPANAuthors'} @{$res->[2]}];
38 }
39  
40 0 for (@{$res->[2]}) {
41 0 ▶ if ($args{detail}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($args{'detail'}) { } 0 0 0
42 0 ($_->{name} = $_->{module}) =~ s/^Acme::CPANAuthors:://;
43 } else {
44 0 s/^Acme::CPANAuthors:://;
45 }
46 }
47  
48 0 $res;
49 }
50  
51 1 1;
52 # ABSTRACT: List Acme::CPANAuthors modules available on CPAN
53  
54 __END__
↑ Summary CmdBundle/cpanauthors.pm »