blib/lib/Salvation/TC/Meta/Type/Parameterized/HashRef.pm

filter: Statementstmt 96.4% 27 / 28 Branchbran 100% 4 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 100% 2 / 2 totaltotal 89.3% 42 / 47 SCAR 13.9
CC
4
Cov
94%
iterate
3.0
signed_type_generator
2.0
__ANON__
1.0
CRAP 4.0
« blib/lib/Salvation/TC/Meta/Type/Parameterized/ArrayRef.pm ↑ Summary blib/lib/Salvation/TC/Type/SessionId.pm »
1 package Salvation::TC::Meta::Type::Parameterized::HashRef;
2  
3 =head1 NAME
4  
5 Salvation::TC::Meta::Type::Parameterized::HashRef - Класс для типа параметризованного HashRef.
6  
7 =cut
8  
9 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use boolean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use base 'Salvation::TC::Meta::Type::Parameterized';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 =head1 METHODS
17  
18 =cut
19  
20 =head2 iterate( HashRef $value, CodeRef $code )
21  
22 =cut
23  
24 sub iterate {
25  
26 29 ▶ my ( $self, $value, $code ) = @_;
Subroutine iterate: called CC=3 SCAR=11.0
Pod documented
27 29 my %clone = ();
28  
29 29 ▶ while( my ( $key, $item ) = each( %$value ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$value) 33 13 46
30  
31 33 ▶ eval { $code -> ( $item, $key, sub { $clone{ $key } = $_[ 0 ] } ) };
Subroutine __ANON__: not called CC=1 SCAR=0.4
32  
33 33 ▶ if( $@ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 16 17 33
34  
35 16 keys( %$value ); # сбрасываем итератор
36 16 die( $@ );
37 }
38 }
39  
40 13 return \%clone;
41 }
42  
43 =head2 signed_type_generator()
44  
45 =cut
46  
47 sub signed_type_generator {
48  
49 2 ▶ my ( $self ) = @_;
Subroutine signed_type_generator: called CC=2 SCAR=7.1
Pod documented
50  
51 2 ▶ return $self -> { 'signed_type_generator' } //= Salvation::TC -> get( 'HashRef' ) -> signed_type_generator();
Condition66%2/3
$self->{"signed_type_generator"} //= "Salvation::TC"->get("HashRef")->signed_type_generator
l!l&&r!l&&!r
110
MC/DC0%0/2
$self->{"signed_type_generator"} //= "Salvation::TC"->get("HashRef")->signed_type_generator
$self->{"signed_type_generator"} "Salvation::TC"->get("HashRef")->signed_type_generator
Truth table66%2/3
A //= B
A= $self->{"signed_type_generator"}B= "Salvation::TC"->get("HashRef")->signed_type_generator
ABresult
1X1
011
000
52 }
53  
54  
55 3 1;
56  
57 __END__
« blib/lib/Salvation/TC/Meta/Type/Parameterized/ArrayRef.pm ↑ Summary blib/lib/Salvation/TC/Type/SessionId.pm »