Cmd/Role/ConfigFromFile.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 96.6% 29 / 30 CC 2 SCAR 3.4
CC
2
Cov
96%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« Cmd.pm ↑ Summary Cmd/Role/AbbrevCmds.pm »
1 package MooX::Cmd::Role::ConfigFromFile;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = "0.016_001";
7  
8 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 MooX::Cmd::Role::ConfigFromFile - MooX::ConfigFromFile support role for MooX::Cmd
13  
14 =cut
15  
16 2 requires "config_prefixes";
17  
18 around _build_config_prefixes => sub {
19 9 ▶ my $next = shift;
Subroutine __ANON__: called CC=2 SCAR=6.9
20 9 my $class = shift;
21 9 my $params = shift;
22 9 my $cfg_pfxs = $class->$next($params, @_);
23  
24 ref $params->{command_chain} eq "ARRAY"
25 9 and push @{$cfg_pfxs},
26 9 ▶ grep { defined $_ } map { $_->command_name } grep { $_->can("command_name") } @{$params->{command_chain}};
Branch: 1 branch
BranchTrueFalseTotal
ref $params->{"command_chain"} eq "ARRAY" and push @{$cfg_pfxs;}, grep({defined $_;} map({$_->command_name;} grep({$_->can("command_name");} @{$$params{"command_chain"};}))) 9 0 9
27  
28 9 return $cfg_pfxs;
29 2 };
30  
31 =head1 LICENSE AND COPYRIGHT
32  
33 Copyright 2015-2017 Jens Rehsack.
34  
35 This program is free software; you can redistribute it and/or modify it
36 under the terms of either: the GNU General Public License as published
37 by the Free Software Foundation; or the Artistic License.
38  
39 See L<http://dev.perl.org/licenses/> for more information.
40  
41 =cut
42  
43 2 1;
« Cmd.pm ↑ Summary Cmd/Role/AbbrevCmds.pm »