blib/lib/Iterator/Flex/Role/State/Closure.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 1 / 2 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 97.7% 43 / 44 CC 3 SCAR 4.4
CC
3
Cov
97%
set_state
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« blib/lib/Iterator/Flex/Role/State/Registry.pm ↑ Summary blib/lib/Iterator/Flex/Role/Next/ClosedSelf.pm »
1 package Iterator::Flex::Role::State::Closure;
2  
3 # ABSTRACT: Iterator State is kept in a closure variable
4  
5 36 ▶use v5.28;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 36 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 36 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 36 our $VERSION = '0.33';
10  
11 36 ▶use Iterator::Flex::Utils qw( :default REG_ITERATOR REG_ITER_STATE :IterStates );
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 36 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 36 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 36 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19  
20  
21  
22  
23  
24  
25  
26 ▶sub set_state ( $self, $state ) {
Subroutine set_state: called CC=3 SCAR=11.1
Pod documented
27  
28 906 ${ $REGISTRY{ refaddr $self }[REG_ITERATOR][REG_ITER_STATE] } = $state
29 906 ▶ unless ( ${ $REGISTRY{ refaddr $self }[REG_ITERATOR][REG_ITER_STATE] } // IterState_CLEAR )
Branch: 1 branch
BranchTrueFalseTotal
unless (${$Iterator::Flex::Role::State::Closure::REGISTRY{builtin::refaddr($self)}[0][8];} // 0) == 2 906 0 906
Condition100%2/2
${$Iterator::Flex::Role::State::Closure::REGISTRY{builtin::refaddr($self)}[0][8];} // 0
l!l
634272
MC/DC100%1/1
${$Iterator::Flex::Role::State::Closure::REGISTRY{builtin::refaddr($self)}[0][8];} // 0
${$Iterator::Flex::Role::State::Closure::REGISTRY{builtin::refaddr($self)}[0][8];}
Truth table100%2/2
A
A= ${$Iterator::Flex::Role::State::Closure::REGISTRY{builtin::refaddr($self)}[0][8];}
Aresult
11
00
30 == IterState_ERROR;
31 }
32  
33  
34  
35  
36  
37  
38  
39  
40  
41 ▶sub get_state ( $self ) {
Subroutine get_state: called CC=1 SCAR=0.0
Pod documented
42 1128 ${ $REGISTRY{ refaddr $self }[REG_ITERATOR][REG_ITER_STATE] };
43 }
44  
45 36 with 'Iterator::Flex::Role::State';
46  
47 36 1;
48  
49 #
50 # This file is part of Iterator-Flex
51 #
52 # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
53 #
54 # This is free software, licensed under:
55 #
56 # The GNU General Public License, Version 3, June 2007
57 #
58  
59 __END__
« blib/lib/Iterator/Flex/Role/State/Registry.pm ↑ Summary blib/lib/Iterator/Flex/Role/Next/ClosedSelf.pm »