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

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