Extension/Component/Config.pm

filter: Statementstmt 47.6% 10 / 21 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 33.3% 12 / 36 CC 5 SCAR 30.8
CC
5
Cov
33%
config
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 21.7
↑ Summary Extension/Component/Stash.pm »
1 package App::CLI::Extension::Component::Config;
2  
3 =pod
4  
5 =head1 NAME
6  
7 App::CLI::Extension::Component::Config - for App::CLI::Extension config module
8  
9 =head1 VERSION
10  
11 1.421
12  
13 =cut
14  
15 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 18 ▶use base qw(Class::Accessor::Grouped);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 18 our $VERSION = '1.421';
19  
20 18 __PACKAGE__->mk_group_accessors( "inherited" => "_config" );
21 18 __PACKAGE__->_config({});
22  
23 0 ▶sub config {
Subroutine config: not called CC=5 SCAR=34.0
Pod undocumented
24  
25 0 my $self = shift;
26  
27 0 my %hash;
28 0 ▶ if(scalar(@_) == 1 && ref($_[0]) eq "HASH"){
Branch: 2 branches
BranchTrueFalseTotal
if (scalar @_ == 1 and ref $_[0] eq 'HASH') { } 0 0 0
elsif (scalar @_ > 1) { } 0 0 0
Condition0%0/3
scalar @_ == 1 and ref $_[0] eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
scalar @_ == 1 and ref $_[0] eq "HASH"
scalar @_ == 1 ref $_[0] eq "HASH"
Truth table0%0/3
A and B
A= scalar @_ == 1B= ref $_[0] eq "HASH"
ABresult
0X0
100
111
29 0 %hash = %{$_[0]};
30 } elsif(scalar(@_) > 1) {
31 0 %hash = @_;
32 }
33 0 my @keys = keys %hash;
34 0 ▶ if (scalar(@keys) > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @keys > 0) 0 0 0
35 0 map { $self->_config->{$_} = $hash{$_} } @keys;
36 }
37 0 return $self->_config;
38 }
39  
40 18 1;
41  
42 __END__
↑ Summary Extension/Component/Stash.pm »