blib/lib/App/Prove/Elasticsearch/Indexer/MMDist.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran 66.6% 4 / 6 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 90.9% 30 / 33 CC 1 SCAR 0.0
CC
1
Cov
90%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/App/Prove/Elasticsearch/Blamer/System.pm ↑ Summary blib/lib/App/Prove/Elasticsearch/Indexer/DzilDist.pm »
1 # ABSTRACT: Names your elasticsearch index after your distribution as defined in Makefile.PL
2 # PODNAME: App::Prove::Elasticsearch::Indexer::MMDist
3  
4 package App::Prove::Elasticsearch::Indexer::MMDist;
5 2 $App::Prove::Elasticsearch::Indexer::MMDist::VERSION = '0.001';
6 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use parent qw{App::Prove::Elasticsearch::Indexer};
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 our $index = __CLASS__->SUPER::index;
12 2 ▶our $dfile //= 'Makefile.PL';
Condition100%2/2
our $dfile //= "Makefile.PL"
l!l
11
MC/DC100%1/1
our $dfile //= "Makefile.PL"
our $dfile
Truth table100%2/2
A
A= our $dfile
Aresult
11
00
13  
14 2 ▶if (open(my $dh, '<', $dfile)) {
Branch: 1 branch
BranchTrueFalseTotal
if (open my $dh, '<', $App::Prove::Elasticsearch::Indexer::MMDist::dfile) { } 2 0 2
15 ;
16 2 ▶ while (<$dh>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $dh)) 30 0 30
17 30 ($index) = $_ =~ /DISTNAME.*\s*?=>\s*?["|'](.*)["|'],?/;
18 30 ▶ if ($index) {
Branch: 1 branch
BranchTrueFalseTotal
if ($App::Prove::Elasticsearch::Indexer::MMDist::index) 2 28 30
19 2 $index =~ s/^\s+//;
20 2 last;
21 }
22 }
23 2 close $dh;
24 } else {
25 0 print
26 "# WARNING: Could not open $dfile, falling back to index name '$index'\n";
27 }
28  
29 2 1;
30  
31 __END__
« blib/lib/App/Prove/Elasticsearch/Blamer/System.pm ↑ Summary blib/lib/App/Prove/Elasticsearch/Indexer/DzilDist.pm »