App/lcpan/Cmd/author_deps.pm

filter: Statementstmt 48.7% 19 / 39 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 48.9% 24 / 49 CC 3 SCAR 17.4
CC
3
Cov
44%
handle_cmd
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« App/lcpan/Cmd/mod2rel.pm ↑ Summary App/lcpan/Cmd/author_rdeps.pm »
1 package App::lcpan::Cmd::author_deps;
2  
3 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
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  
7 1 require App::lcpan;
8 1 ▶use Hash::Subset qw(hash_subset);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11 1 our $DATE = '2023-09-26'; # DATE
12 1 our $DIST = 'App-lcpan'; # DIST
13 1 our $VERSION = '1.074'; # VERSION
14  
15 1 our %SPEC;
16  
17 1 $SPEC{'handle_cmd'} = {
18 v => 1.1,
19 summary => "List dependencies for all of the dists of an author",
20 description => <<'_',
21  
22 For a CPAN author, this subcommand is a shortcut for doing:
23  
24 % lcpan deps Your-Dist
25  
26 for all of your distributions. It shows just how many modules are you currently
27 using in one of your distros on CPAN.
28  
29 To show how many modules from other authors you are depending:
30  
31 % lcpan author-deps YOURCPANID --module-author-isnt YOURCPANID
32  
33 To show how many of your own modules you are depending in your own distros:
34  
35 % lcpan author-deps YOURCPANID --module-author-is YOURCPANID
36  
37 To find whether there are any prerequisites that you mention in your
38 distributions that are currently broken (not indexed on CPAN):
39  
40 % lcpan author-deps YOURCPANID --broken --dont-uniquify
41  
42 _
43 args => {
44 %App::lcpan::common_args,
45 %App::lcpan::author_args,
46 %App::lcpan::deps_args,
47 %App::lcpan::argspecsopt_module_authors,
48 },
49 };
50 0 ▶sub handle_cmd {
Subroutine handle_cmd: not called CC=3 SCAR=24.8
Pod documented
51 0 my %args = @_;
52  
53 0 my $author = $args{author};
54  
55 0 my $res = App::lcpan::dists(
56 hash_subset(\%args, \%App::lcpan::common_args, \%App::lcpan::author_args),
57 );
58 0 ▶ return $res if $res->[0] != 200;
Branch: 1 branch
BranchTrueFalseTotal
if $res->[0] != 200 0 0 0
59 0 my $dists = $res->[2];
60  
61 0 my %deps_args = %args;
62 0 $deps_args{dists} = $dists;
63 0 delete $deps_args{author};
64 0 delete $deps_args{authors};
65 0 delete $deps_args{authors_arent};
66 0 $deps_args{authors} = delete $args{module_authors};
67 0 $deps_args{authors_arent} = delete $args{module_authors_arent};
68 0 $deps_args{phase} = delete $args{phase};
69 0 $deps_args{rel} = delete $args{rel};
70 0 $deps_args{added_since} = delete $args{added_since};
71 0 $deps_args{updated_since} = delete $args{updated_since};
72 0 $deps_args{added_or_updated_since} = delete $args{added_or_updated_since};
73 0 $res = App::lcpan::deps(%deps_args);
74 0 ▶ return $res if $res->[0] != 200;
Branch: 1 branch
BranchTrueFalseTotal
if $res->[0] != 200 0 0 0
75  
76 0 $res;
77 }
78  
79 1 1;
80 # ABSTRACT: List dependencies for all of the dists of an author
81  
82 __END__
« App/lcpan/Cmd/mod2rel.pm ↑ Summary App/lcpan/Cmd/author_rdeps.pm »