meta/FunctionalPerl/ModuleList.pm

filter: Statementstmt 92.3% 36 / 39 Branchbran 83.3% 5 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 80.3% 49 / 61 CC 5 SCAR 10.2
CC
5
Cov
88%
modulenameandpathlist
5.1
modulepathlist
2.0
BEGIN
1.0
CRAP 2.8
« lib/FP/TransparentLazy.pm ↑ Summary lib/FP/Stream.pm »
1 #
2 # Copyright (c) 2015-2021 Christian Jaeger, copying@christianjaeger.ch
3 #
4 # This is free software, offered under either the same terms as perl 5
5 # or the terms of the Artistic License version 2 or the terms of the
6 # MIT License (Expat version). See the file COPYING.md that came
7 # bundled with this file.
8 #
9  
10 =head1 NAME
11  
12 FunctionalPerl::ModuleList
13  
14 =head1 SYNOPSIS
15  
16 =head1 DESCRIPTION
17  
18  
19 =head1 NOTE
20  
21 This is alpha software! Read the status section in the package README
22 or on the L<website|http://functional-perl.org/>.
23  
24 =cut
25  
26 package FunctionalPerl::ModuleList;
27 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 2 ▶use warnings FATAL => 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
30 2 ▶use Exporter "import";
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 2 our @EXPORT = qw(modulenamelist modulepathlist);
33 2 our @EXPORT_OK = qw();
34 2 our %EXPORT_TAGS = (all => [@EXPORT, @EXPORT_OK]);
35  
36 2 ▶use Chj::xopen 'xopen_read';
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 2 our $modulenameandpathlist; # [[ name, path ] ...]
39  
40 2 ▶sub modulenameandpathlist {
Subroutine modulenameandpathlist: called CC=5 SCAR=16.2
Pod undocumented
41 2 ▶ $modulenameandpathlist //= do {
Condition33%1/3
$FunctionalPerl::ModuleList::modulenameandpathlist //= do { my $f = xopen_read("MANIFEST"); my @m; local $_; while (defined($_ = readline $f)) { chomp $_; my $path = $_; next unless s/\.pm$//; s[^(lib|meta|htmlgen)/][] or die "no match: $_"; s[/][::]gs; push @m, [$_, $path]; } ; $f->xclose; \@m }
l!l&&r!l&&!r
020
MC/DC0%0/2
$FunctionalPerl::ModuleList::modulenameandpathlist //= do { my $f = xopen_read("MANIFEST"); my @m; local $_; while (defined($_ = readline $f)) { chomp $_; my $path = $_; next unless s/\.pm$//; s[^(lib|meta|htmlgen)/][] or die "no match: $_"; s[/][::]gs; push @m, [$_, $path]; } ; $f->xclose; \@m }
$FunctionalPerl::ModuleList::modulenameandpathlist do { my $f = xopen_read("MANIFEST"); my @m; local $_; while (defined($_ = readline $f)) { chomp $_; my $path = $_; next unless s/\.pm$//; s[^(lib|meta|htmlgen)/][] or die "no match: $_"; s[/][::]gs; push @m, [$_, $path]; } ; $f->xclose; \@m }
Truth table33%1/3
A //= B
A= $FunctionalPerl::ModuleList::modulenameandpathlistB= do { my $f = xopen_read("MANIFEST"); my @m; local $_; while (defined($_ = readline $f)) { chomp $_; my $path = $_; next unless s/\.pm$//; s[^(lib|meta|htmlgen)/][] or die "no match: $_"; s[/][::]gs; push @m, [$_, $path]; } ; $f->xclose; \@m }
ABresult
1X1
011
000
42 2 my $f = xopen_read "MANIFEST";
43 2 my @m;
44 2 local $_;
45 2 ▶ while (<$f>) { ## no critic, $_ is localized
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $f)) 648 2 650
46 648 chomp;
47 648 my $path = $_;
48 648 ▶ next unless s/\.pm$//;
Branch: 1 branch
BranchTrueFalseTotal
unless s/\.pm$// 316 332 648
49 332 ▶ s|^(lib\|meta\|htmlgen)/|| or die "no match: $_";
Branch: 1 branch
BranchTrueFalseTotal
s[^(lib|meta|htmlgen)/][] or die "no match: $_" 332 0 332
50 332 s|/|::|sg;
51 332 push @m, [$_, $path]
52 }
53 2 $f->xclose;
54 \@m
55 2 }
56 }
57  
58 2 ▶sub modulenamelist {
Subroutine modulenamelist: called CC=1 SCAR=0.0
Pod undocumented
59 2 [map { $$_[0] } @{ modulenameandpathlist() }]
60 }
61  
62 0 ▶sub modulepathlist {
Subroutine modulepathlist: not called CC=1 SCAR=6.9
Pod undocumented
63 0 [map { $$_[1] } @{ modulenameandpathlist() }]
64 }
65  
66 2 1
« lib/FP/TransparentLazy.pm ↑ Summary lib/FP/Stream.pm »