YADV/Structure/Hash.pm

filter: Statementstmt 100% 22 / 22 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 91.1% 31 / 34 CC 4 SCAR 6.4
CC
4
Cov
96%
_get_child_node
3.0
each
2.0
BEGIN
1.0
CRAP 1.9
« YADV/CheckerASub.pm ↑ Summary YADV/Structure/Array.pm »
1 package Data::YADV::Structure::Hash;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base 'Data::YADV::Structure::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 14 ▶sub _get_child_node {
Subroutine _get_child_node: called CC=3 SCAR=11.0
9 14 my ($self, $entry) = @_;
10  
11 14 ▶ die qq(Wrong hash key format "$entry")
Branch: 1 branch
BranchTrueFalseTotal
unless $entry =~ /^\{(.+)\}$/ 0 14 14
12 unless $entry =~ /^\{(.+)\}$/;
13 14 my $key = $1;
14  
15 14 my $structure = $self->get_structure;
16 14 ▶ return undef unless exists $structure->{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $structure->{$key} 1 13 14
17  
18 13 $self->_build_node($entry, $structure->{$key})
19 }
20  
21 1 ▶sub get_size { keys %{$_[0]->get_structure} }
Subroutine get_size: called CC=1 SCAR=0.0
Pod undocumented
22  
23 1 ▶sub each {
Subroutine each: called CC=2 SCAR=6.9
Pod undocumented
24 1 my ($self, $cb) = @_;
25  
26 1 foreach my $key (keys %{$self->get_structure}) {
27 2 $cb->($self->get_child("{$key}"), $key);
28 }
29 }
30  
31 1 1;
« YADV/CheckerASub.pm ↑ Summary YADV/Structure/Array.pm »