blib/lib/TableData/Acme/CPANModules.pm

filter: Statementstmt 67.3% 33 / 49 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod n/a totaltotal 68.8% 42 / 61 SCAR 12.2
CC
3
Cov
65%
__ANON__
8.7
BEGIN
1.0
BEGIN
1.0
CRAP 3.4
↑ Summary
1 package ## no critic: Modules::RequireFilenameMatchesPackage
2 # hide from PAUSE
3 TableDataRole::Acme::CPANModules;
4  
5 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 with 'TableDataRole::Source::AOA';
11  
12 around new => sub {
13 0 ▶ my $orig = shift;
Subroutine __ANON__: not called CC=3 SCAR=21.6
14 0 my ($self, %args) = @_;
15  
16 my $ac_module = delete $args{module}
17 0 ▶ or die "Please specify 'module' argument";
Branch: 1 branch
BranchTrueFalseTotal
my $ac_module = delete $args{"module"} or die "Please specify 'module' argument" 0 0 0
18 0 $ac_module =~ s/\AAcme::CPANModules:://;
19 0 my $list = do {
20 0 my $module = "Acme::CPANModules::$ac_module";
21 0 (my $module_pm = "$module.pm") =~ s!::!/!g;
22 0 require $module_pm;
23 1 ▶ no strict 'refs'; ## no critic: TestingAndDebugging::ProhibitNoStrict
Subroutine BEGIN: called CC=1 SCAR=0.0
24 0 ${"$module\::LIST"};
25 };
26  
27 0 my $aoa = [];
28 0 my $column_names = [qw/
29 module
30 script
31 summary
32 description
33 rating
34 /];
35 0 for my $entry (@{ $list->{entries} }) {
36 push @$aoa, [
37 $entry->{module},
38 $entry->{script},
39 $entry->{summary},
40 $entry->{description},
41 0 ];
42 }
43  
44 0 $orig->($self, %args, aoa => $aoa, column_names=>$column_names);
45 1 };
46  
47 package TableData::Acme::CPANModules;
48  
49 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
51 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 1 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
54  
55 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
56 1 our $DATE = '2023-06-17'; # DATE
57 1 our $DIST = 'TableData-Acme-CPANModules'; # DIST
58 1 our $VERSION = '0.002'; # VERSION
59  
60 1 with 'TableDataRole::Acme::CPANModules';
61  
62 # STATS
63  
64 1 1;
65 # ABSTRACT: Entries from a Acme::CPANModules::* module
66  
67 __END__
↑ Summary