Catmandu/Store/Hash.pm

filter: Statementstmt 87.8% 29 / 33 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 3 totaltotal 81.6% 40 / 49 CC 5 SCAR 8.7
CC
5
Cov
86%
drop
6.0
BUILD
3.0
transaction
2.0
CRAP 2.4
« Catmandu/Fix/log.pm ↑ Summary Catmandu/Fix/paste.pm »
1 package Catmandu::Store::Hash;
2  
3 16 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 16 our $VERSION = '1.2025';
6  
7 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 16 ▶use Catmandu::Util qw(:is);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 16 ▶use Catmandu::Store::Hash::Bag;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 16 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 16 with 'Catmandu::Store';
13 16 with 'Catmandu::Droppable';
14 16 with 'Catmandu::Transactional';
15  
16 has _hashes =>
17 23 ▶ (is => 'ro', lazy => 1, init_arg => undef, default => sub {+{}});
Subroutine __ANON__: called CC=1 SCAR=0.0
18 16 has init_data => (is => 'ro');
19  
20 30 ▶sub BUILD {
Subroutine BUILD: called CC=3 SCAR=11.0
Pod undocumented
21 30 my ($self) = @_;
22 30 ▶ if (my $data = $self->init_data) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $data = $self->init_data) 6 24 30
23 6 $self->bag->add($_) for @$data;
24 }
25 }
26  
27 0 ▶sub drop {
Subroutine drop: not called CC=2 SCAR=17.9
Pod undocumented
28 0 my ($self) = @_;
29 0 $_->drop for values %{$self->bags};
30 0 return;
31 }
32  
33 2 ▶sub transaction {
Subroutine transaction: called CC=2 SCAR=7.1
Pod undocumented
34 2 my ($self, $coderef) = @_;
35 2 ▶ &{$coderef} if is_code_ref($coderef);
Branch: 1 branch
BranchTrueFalseTotal
if is_code_ref($coderef) 2 0 2
36 }
37  
38 16 1;
39  
40 __END__
« Catmandu/Fix/log.pm ↑ Summary Catmandu/Fix/paste.pm »