Extension/Component/Stash.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%
stash
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 21.7
« Extension/Component/Config.pm ↑ Summary Extension/Component/OriginalArgv.pm »
1 package App::CLI::Extension::Component::Stash;
2  
3 =pod
4  
5 =head1 NAME
6  
7 App::CLI::Extension::Component::Stash - for App::CLI::Extension stash 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" => "_stash");
21 18 __PACKAGE__->_stash({});
22  
23  
24 0 ▶sub stash {
Subroutine stash: not called CC=5 SCAR=34.0
Pod undocumented
25  
26 0 my $self = shift;
27  
28 0 my %hash;
29 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
30 0 %hash = %{$_[0]};
31 } elsif (scalar(@_) > 1) {
32 0 %hash = @_;
33 }
34 0 my @keys = keys %hash;
35 0 ▶ if (scalar(@keys) > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @keys > 0) 0 0 0
36 0 map { $self->_stash->{$_} = $hash{$_} } @keys;
37 }
38 0 return $self->_stash;
39 }
40  
41 18 1;
42  
43 __END__
« Extension/Component/Config.pm ↑ Summary Extension/Component/OriginalArgv.pm »