blib/lib/GraphQL/Houtou/Runtime/VMOp.pm

filter: Statementstmt 54.1% 79 / 146 Branchbran 17.6% 12 / 68 Conditioncond 18.4% 12 / 65 MC/DCmcdc 0.0% 0 / 35 Subroutinesub 60.2% 41 / 68 Podpod 0.0% 0 / 58 totaltotal 32.7% 144 / 440 CC 65 SCAR 41.7
CC
65
Cov
37%
to_native_struct
380.0
_dispatch_family_code
56.0
_args_mode_code
30.0
CRAP 64.5
« blib/lib/GraphQL/Houtou/Runtime/VMCompiler.pm ↑ Summary blib/lib/GraphQL/Houtou/Type/Object.pm »
1 package GraphQL::Houtou::Runtime::VMOp;
2  
3 62 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 62 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 62 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 62 ▶use Scalar::Util qw(refaddr);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 62 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
10 62 OPCODE_SLOT => 0,
11 OPCODE_CODE_SLOT => 1,
12 RESOLVE_FAMILY_SLOT => 2,
13 RESOLVE_CODE_SLOT => 3,
14 COMPLETE_FAMILY_SLOT => 4,
15 COMPLETE_CODE_SLOT => 5,
16 FIELD_NAME_SLOT => 6,
17 RESULT_NAME_SLOT => 7,
18 RETURN_TYPE_NAME_SLOT => 8,
19 DISPATCH_FAMILY_SLOT => 9,
20 CHILD_BLOCK_NAME_SLOT => 10,
21 ABSTRACT_CHILD_BLOCKS_SLOT => 11,
22 ARGS_MODE_SLOT => 12,
23 ARGS_PAYLOAD_SLOT => 13,
24 HAS_ARGS_SLOT => 14,
25 DIRECTIVES_MODE_SLOT => 15,
26 DIRECTIVES_PAYLOAD_SLOT => 16,
27 HAS_DIRECTIVES_SLOT => 17,
28 BOUND_SLOT_SLOT => 18,
29 BOUND_CHILD_BLOCK_SLOT => 19,
30 BOUND_ABSTRACT_CHILD_BLOCKS_SLOT => 20,
31 NATIVE_SLOT_INDEX_SLOT => 21,
32 NATIVE_CHILD_BLOCK_INDEX_SLOT => 22,
33 NATIVE_ABSTRACT_CHILD_BLOCK_INDEXES_SLOT => 23,
34 ARGS_PAYLOAD_INDEX_SLOT => 24,
35 DIRECTIVES_PAYLOAD_INDEX_SLOT => 25,
36 BLOCK_SLOT => 26,
37 ABSTRACT_CHILD_BLOCKS_INDEX_SLOT => 27,
38 RUNTIME_DIRECTIVES_MODE_SLOT => 28,
39 RUNTIME_DIRECTIVES_PAYLOAD_SLOT => 29,
40 HAS_RUNTIME_DIRECTIVES_SLOT => 30,
41 62 };
42  
43 26 ▶sub new {
Subroutine new: called CC=13 SCAR=31.2
Pod undocumented
44 26 my ($class, %args) = @_;
45 return bless [
46 $args{opcode},
47 $args{opcode_code} || 0,
48 $args{resolve_family},
49 $args{resolve_code} || 0,
50 $args{complete_family},
51 $args{complete_code} || 0,
52 $args{field_name},
53 $args{result_name},
54 $args{return_type_name},
55 $args{dispatch_family},
56 $args{child_block_name},
57 $args{abstract_child_blocks} || {},
58 $args{args_mode} || 'NONE',
59 $args{args_payload},
60 $args{has_args} ? 1 : 0,
61 $args{directives_mode} || 'NONE',
62 $args{directives_payload},
63 $args{has_directives} ? 1 : 0,
64 $args{bound_slot},
65 $args{bound_child_block},
66 $args{bound_abstract_child_blocks} || {},
67 $args{native_slot_index},
68 $args{native_child_block_index},
69 $args{native_abstract_child_block_indexes} || {},
70 $args{args_payload_index},
71 $args{directives_payload_index},
72 undef,
73 $args{abstract_child_blocks_index},
74 $args{runtime_directives_mode} || 'NONE',
75 $args{runtime_directives_payload},
76 26 ▶ $args{has_runtime_directives} ? 1 : 0,
Branch: 3 branches
BranchTrueFalseTotal
$args{'has_args'} ? : 3 23 26
$args{'has_directives'} ? : 1 25 26
$args{'has_runtime_directives'} ? : 0 26 26
Condition50%9/18
$args{'opcode_code'} || 0
l!l
260
$args{'resolve_code'} || 0
l!l
260
$args{'complete_code'} || 0
l!l
260
$args{'abstract_child_blocks'} || {}
l!l
026
$args{'args_mode'} || 'NONE'
l!l
260
$args{'directives_mode'} || 'NONE'
l!l
260
$args{'bound_abstract_child_blocks'} || {}
l!l
026
$args{'native_abstract_child_block_indexes'} || {}
l!l
026
$args{'runtime_directives_mode'} || 'NONE'
l!l
260
MC/DC0%0/1
$args{'opcode_code'} || 0
$args{'opcode_code'}
MC/DC0%0/1
$args{'resolve_code'} || 0
$args{'resolve_code'}
MC/DC0%0/1
$args{'complete_code'} || 0
$args{'complete_code'}
MC/DC0%0/1
$args{'abstract_child_blocks'} || {}
$args{'abstract_child_blocks'}
MC/DC0%0/1
$args{'args_mode'} || 'NONE'
$args{'args_mode'}
MC/DC0%0/1
$args{'directives_mode'} || 'NONE'
$args{'directives_mode'}
MC/DC0%0/1
$args{'bound_abstract_child_blocks'} || {}
$args{'bound_abstract_child_blocks'}
MC/DC0%0/1
$args{'native_abstract_child_block_indexes'} || {}
$args{'native_abstract_child_block_indexes'}
MC/DC0%0/1
$args{'runtime_directives_mode'} || 'NONE'
$args{'runtime_directives_mode'}
Truth table50%1/2
A
A= $args{'opcode_code'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'resolve_code'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'complete_code'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'abstract_child_blocks'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'args_mode'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'directives_mode'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'bound_abstract_child_blocks'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'native_abstract_child_block_indexes'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'runtime_directives_mode'}
Aresult
11
00
77 ], $class;
78 }
79  
80 2 ▶sub opcode { return $_[0][OPCODE_SLOT] }
Subroutine opcode: called CC=1 SCAR=0.0
Pod undocumented
81 2 ▶sub opcode_code { return $_[0][OPCODE_CODE_SLOT] }
Subroutine opcode_code: called CC=1 SCAR=0.0
Pod undocumented
82 1 ▶sub resolve_family { return $_[0][RESOLVE_FAMILY_SLOT] }
Subroutine resolve_family: called CC=1 SCAR=0.0
Pod undocumented
83 2 ▶sub resolve_code { return $_[0][RESOLVE_CODE_SLOT] }
Subroutine resolve_code: called CC=1 SCAR=0.0
Pod undocumented
84 2 ▶sub complete_family { return $_[0][COMPLETE_FAMILY_SLOT] }
Subroutine complete_family: called CC=1 SCAR=0.0
Pod undocumented
85 2 ▶sub complete_code { return $_[0][COMPLETE_CODE_SLOT] }
Subroutine complete_code: called CC=1 SCAR=0.0
Pod undocumented
86 13 ▶sub field_name { return $_[0][FIELD_NAME_SLOT] }
Subroutine field_name: called CC=1 SCAR=0.0
Pod undocumented
87 0 ▶sub result_name { return $_[0][RESULT_NAME_SLOT] }
Subroutine result_name: not called CC=1 SCAR=6.9
Pod undocumented
88 0 ▶sub return_type_name { return $_[0][RETURN_TYPE_NAME_SLOT] }
Subroutine return_type_name: not called CC=1 SCAR=6.9
Pod undocumented
89 1 ▶sub dispatch_family { return $_[0][DISPATCH_FAMILY_SLOT] }
Subroutine dispatch_family: called CC=1 SCAR=0.0
Pod undocumented
90 6 ▶sub child_block_name { return $_[0][CHILD_BLOCK_NAME_SLOT] }
Subroutine child_block_name: called CC=1 SCAR=0.0
Pod undocumented
91 0 ▶sub abstract_child_blocks_index { return $_[0][ABSTRACT_CHILD_BLOCKS_INDEX_SLOT] }
Subroutine abstract_child_blocks_index: not called CC=1 SCAR=6.9
Pod undocumented
92 2 ▶sub args_mode { return $_[0][ARGS_MODE_SLOT] }
Subroutine args_mode: called CC=1 SCAR=0.0
Pod undocumented
93 41 ▶sub args_payload {
Subroutine args_payload: called CC=1 SCAR=0.0
Pod undocumented
94 41 return _catalog_payload($_[0], ARGS_PAYLOAD_SLOT, ARGS_PAYLOAD_INDEX_SLOT, 'args_payloads');
95 }
96 0 ▶sub has_args { return $_[0][HAS_ARGS_SLOT] }
Subroutine has_args: not called CC=1 SCAR=6.9
Pod undocumented
97 1 ▶sub directives_mode { return $_[0][DIRECTIVES_MODE_SLOT] }
Subroutine directives_mode: called CC=1 SCAR=0.0
Pod undocumented
98 40 ▶sub directives_payload {
Subroutine directives_payload: called CC=1 SCAR=0.0
Pod undocumented
99 40 return _catalog_payload($_[0], DIRECTIVES_PAYLOAD_SLOT, DIRECTIVES_PAYLOAD_INDEX_SLOT, 'directives_payloads');
100 }
101 0 ▶sub has_directives { return $_[0][HAS_DIRECTIVES_SLOT] }
Subroutine has_directives: not called CC=1 SCAR=6.9
Pod undocumented
102 25 ▶sub bound_slot { return $_[0][BOUND_SLOT_SLOT] }
Subroutine bound_slot: called CC=1 SCAR=0.0
Pod undocumented
103 0 ▶sub bound_child_block { return $_[0][BOUND_CHILD_BLOCK_SLOT] }
Subroutine bound_child_block: not called CC=1 SCAR=6.9
Pod undocumented
104 0 ▶sub bound_abstract_child_blocks { return $_[0][BOUND_ABSTRACT_CHILD_BLOCKS_SLOT] }
Subroutine bound_abstract_child_blocks: not called CC=1 SCAR=6.9
Pod undocumented
105 50 ▶sub native_slot_index { return $_[0][NATIVE_SLOT_INDEX_SLOT] }
Subroutine native_slot_index: called CC=1 SCAR=0.0
Pod undocumented
106 35 ▶sub native_child_block_index { return $_[0][NATIVE_CHILD_BLOCK_INDEX_SLOT] }
Subroutine native_child_block_index: called CC=1 SCAR=0.0
Pod undocumented
107 54 ▶sub native_abstract_child_block_indexes { return $_[0][NATIVE_ABSTRACT_CHILD_BLOCK_INDEXES_SLOT] }
Subroutine native_abstract_child_block_indexes: called CC=1 SCAR=0.0
Pod undocumented
108 0 ▶sub args_payload_index { return $_[0][ARGS_PAYLOAD_INDEX_SLOT] }
Subroutine args_payload_index: not called CC=1 SCAR=6.9
Pod undocumented
109 0 ▶sub directives_payload_index { return $_[0][DIRECTIVES_PAYLOAD_INDEX_SLOT] }
Subroutine directives_payload_index: not called CC=1 SCAR=6.9
Pod undocumented
110 0 ▶sub runtime_directives_mode { return $_[0][RUNTIME_DIRECTIVES_MODE_SLOT] }
Subroutine runtime_directives_mode: not called CC=1 SCAR=6.9
Pod undocumented
111 0 ▶sub runtime_directives_payload { return $_[0][RUNTIME_DIRECTIVES_PAYLOAD_SLOT] }
Subroutine runtime_directives_payload: not called CC=1 SCAR=6.9
Pod undocumented
112 0 ▶sub has_runtime_directives { return $_[0][HAS_RUNTIME_DIRECTIVES_SLOT] }
Subroutine has_runtime_directives: not called CC=1 SCAR=6.9
Pod undocumented
113 22 ▶sub block { return $_[0][BLOCK_SLOT] }
Subroutine block: called CC=1 SCAR=0.0
Pod undocumented
114  
115 25 ▶sub set_field_name { $_[0][FIELD_NAME_SLOT] = $_[1]; return $_[1] }
Subroutine set_field_name: called CC=1 SCAR=0.0
Pod undocumented
116 25 ▶sub set_result_name { $_[0][RESULT_NAME_SLOT] = $_[1]; return $_[1] }
Subroutine set_result_name: called CC=1 SCAR=0.0
Pod undocumented
117 25 ▶sub set_child_block_name { $_[0][CHILD_BLOCK_NAME_SLOT] = $_[1]; return $_[1] }
Subroutine set_child_block_name: called CC=1 SCAR=0.0
Pod undocumented
118 50 ▶sub set_bound_slot { $_[0][BOUND_SLOT_SLOT] = $_[1]; return $_[1] }
Subroutine set_bound_slot: called CC=1 SCAR=0.0
Pod undocumented
119 27 ▶sub set_bound_child_block { $_[0][BOUND_CHILD_BLOCK_SLOT] = $_[1]; return $_[1] }
Subroutine set_bound_child_block: called CC=1 SCAR=0.0
Pod undocumented
120 27 ▶sub set_bound_abstract_child_blocks { $_[0][BOUND_ABSTRACT_CHILD_BLOCKS_SLOT] = $_[1] || {}; return $_[0][BOUND_ABSTRACT_CHILD_BLOCKS_SLOT] }
Subroutine set_bound_abstract_child_blocks: called CC=2 SCAR=7.2
Pod undocumented
Condition50%1/2
$_[1] || {}
l!l
270
MC/DC0%0/1
$_[1] || {}
$_[1]
Truth table50%1/2
A
A= $_[1]
Aresult
11
00
121 25 ▶sub set_abstract_child_blocks { $_[0][ABSTRACT_CHILD_BLOCKS_SLOT] = $_[1]; return $_[0][ABSTRACT_CHILD_BLOCKS_SLOT] }
Subroutine set_abstract_child_blocks: called CC=1 SCAR=0.0
Pod undocumented
122 25 ▶sub set_native_slot_index { $_[0][NATIVE_SLOT_INDEX_SLOT] = $_[1]; return $_[1] }
Subroutine set_native_slot_index: called CC=1 SCAR=0.0
Pod undocumented
123 25 ▶sub set_native_child_block_index { $_[0][NATIVE_CHILD_BLOCK_INDEX_SLOT] = $_[1]; return $_[1] }
Subroutine set_native_child_block_index: called CC=1 SCAR=0.0
Pod undocumented
124 25 ▶sub set_native_abstract_child_block_indexes { $_[0][NATIVE_ABSTRACT_CHILD_BLOCK_INDEXES_SLOT] = $_[1] || {}; return $_[0][NATIVE_ABSTRACT_CHILD_BLOCK_INDEXES_SLOT] }
Subroutine set_native_abstract_child_block_indexes: called CC=2 SCAR=7.2
Pod undocumented
Condition50%1/2
$_[1] || {}
l!l
250
MC/DC0%0/1
$_[1] || {}
$_[1]
Truth table50%1/2
A
A= $_[1]
Aresult
11
00
125 0 ▶sub set_abstract_child_blocks_index { $_[0][ABSTRACT_CHILD_BLOCKS_INDEX_SLOT] = $_[1]; return $_[1] }
Subroutine set_abstract_child_blocks_index: not called CC=1 SCAR=6.9
Pod undocumented
126 6 ▶sub set_args_payload_index { $_[0][ARGS_PAYLOAD_INDEX_SLOT] = $_[1]; return $_[1] }
Subroutine set_args_payload_index: called CC=1 SCAR=0.0
Pod undocumented
127 1 ▶sub set_directives_payload_index { $_[0][DIRECTIVES_PAYLOAD_INDEX_SLOT] = $_[1]; return $_[1] }
Subroutine set_directives_payload_index: called CC=1 SCAR=0.0
Pod undocumented
128 0 ▶sub set_runtime_directives_mode { $_[0][RUNTIME_DIRECTIVES_MODE_SLOT] = $_[1] || 'NONE'; return $_[0][RUNTIME_DIRECTIVES_MODE_SLOT] }
Subroutine set_runtime_directives_mode: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/2
$_[1] || 'NONE'
l!l
00
MC/DC0%0/1
$_[1] || 'NONE'
$_[1]
Truth table0%0/2
A
A= $_[1]
Aresult
11
00
129 0 ▶sub set_runtime_directives_payload { $_[0][RUNTIME_DIRECTIVES_PAYLOAD_SLOT] = $_[1]; return $_[1] }
Subroutine set_runtime_directives_payload: not called CC=1 SCAR=6.9
Pod undocumented
130 0 ▶sub set_has_runtime_directives { $_[0][HAS_RUNTIME_DIRECTIVES_SLOT] = $_[1] ? 1 : 0; return $_[0][HAS_RUNTIME_DIRECTIVES_SLOT] }
Subroutine set_has_runtime_directives: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
$_[1] ? : 0 0 0
131 0 ▶sub set_has_args { $_[0][HAS_ARGS_SLOT] = $_[1] ? 1 : 0; return $_[0][HAS_ARGS_SLOT] }
Subroutine set_has_args: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
$_[1] ? : 0 0 0
132 0 ▶sub set_args_mode { $_[0][ARGS_MODE_SLOT] = $_[1] || 'NONE'; return $_[0][ARGS_MODE_SLOT] }
Subroutine set_args_mode: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/2
$_[1] || 'NONE'
l!l
00
MC/DC0%0/1
$_[1] || 'NONE'
$_[1]
Truth table0%0/2
A
A= $_[1]
Aresult
11
00
133 6 ▶sub set_args_payload { $_[0][ARGS_PAYLOAD_SLOT] = $_[1]; return $_[1] }
Subroutine set_args_payload: called CC=1 SCAR=0.0
Pod undocumented
134 0 ▶sub set_has_directives { $_[0][HAS_DIRECTIVES_SLOT] = $_[1] ? 1 : 0; return $_[0][HAS_DIRECTIVES_SLOT] }
Subroutine set_has_directives: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
$_[1] ? : 0 0 0
135 0 ▶sub set_directives_mode { $_[0][DIRECTIVES_MODE_SLOT] = $_[1] || 'NONE'; return $_[0][DIRECTIVES_MODE_SLOT] }
Subroutine set_directives_mode: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/2
$_[1] || 'NONE'
l!l
00
MC/DC0%0/1
$_[1] || 'NONE'
$_[1]
Truth table0%0/2
A
A= $_[1]
Aresult
11
00
136 1 ▶sub set_directives_payload { $_[0][DIRECTIVES_PAYLOAD_SLOT] = $_[1]; return $_[1] }
Subroutine set_directives_payload: called CC=1 SCAR=0.0
Pod undocumented
137 65 ▶sub set_block {
Subroutine set_block: called CC=2 SCAR=7.0
Pod undocumented
138 65 my ($self, $block) = @_;
139 65 $self->[BLOCK_SLOT] = $block;
140 65 ▶ Scalar::Util::weaken($self->[BLOCK_SLOT]) if ref($self->[BLOCK_SLOT]);
Branch: 1 branch
BranchTrueFalseTotal
if ref $self->[26] 65 0 65
141 65 return $self->[BLOCK_SLOT];
142 }
143  
144 0 ▶sub to_struct {
Subroutine to_struct: not called CC=1 SCAR=6.9
Pod undocumented
145 0 my ($self) = @_;
146 return {
147 0 opcode => $self->opcode,
148 opcode_code => $self->opcode_code,
149 resolve_family => $self->resolve_family,
150 resolve_code => $self->resolve_code,
151 complete_family => $self->complete_family,
152 complete_code => $self->complete_code,
153 field_name => $self->field_name,
154 result_name => $self->result_name,
155 return_type_name => $self->return_type_name,
156 dispatch_family => $self->dispatch_family,
157 child_block_name => $self->child_block_name,
158 abstract_child_blocks => _clone_value($self->abstract_child_blocks),
159 abstract_child_blocks_index => $self->abstract_child_blocks_index,
160 args_mode => $self->args_mode,
161 args_payload => _clone_value($self->args_payload),
162 args_payload_index => $self->args_payload_index,
163 has_args => $self->has_args,
164 directives_mode => $self->directives_mode,
165 directives_payload => _clone_value($self->directives_payload),
166 directives_payload_index => $self->directives_payload_index,
167 has_directives => $self->has_directives,
168 runtime_directives_mode => $self->runtime_directives_mode,
169 runtime_directives_payload => _clone_value($self->runtime_directives_payload),
170 has_runtime_directives => $self->has_runtime_directives,
171 };
172 }
173  
174 0 ▶sub to_native_struct {
Subroutine to_native_struct: not called CC=19 SCAR=59.4
Pod undocumented
175 0 my ($self, $block_index, $slot_index, $payload_catalog) = @_;
176 0 my $slot = $self->bound_slot;
177 0 ▶ my $slot_id = $slot
Branch: 1 branch
BranchTrueFalseTotal
$slot ? : 0 0 0
Condition0%0/2
$self->result_name // ""
l!l
00
MC/DC0%0/1
$self->result_name // ""
$self->result_name
Truth table0%0/2
A
A= $self->result_name
Aresult
11
00
178 ? join("\x1E", refaddr($slot), ($self->result_name // q()))
179 : undef;
180 0 ▶ my $native_abstract_child_block_indexes = $self->native_abstract_child_block_indexes || {};
Condition0%0/2
$self->native_abstract_child_block_indexes || {}
l!l
00
MC/DC0%0/1
$self->native_abstract_child_block_indexes || {}
$self->native_abstract_child_block_indexes
Truth table0%0/2
A
A= $self->native_abstract_child_block_indexes
Aresult
11
00
181 0 ▶ my $abstract_child_blocks = $self->abstract_child_blocks || {};
Condition0%0/2
$self->abstract_child_blocks || {}
l!l
00
MC/DC0%0/1
$self->abstract_child_blocks || {}
$self->abstract_child_blocks
Truth table0%0/2
A
A= $self->abstract_child_blocks
Aresult
11
00
182 0 ▶ my $args_payload_index = defined $self->args_payload_index
Branch: 2 branches
BranchTrueFalseTotal
defined $self->args_payload_index ? : 0 0 0
$payload_catalog ? : 0 0 0
183 ? $self->args_payload_index
184 : ($payload_catalog ? $payload_catalog->intern_args_payload($self->args_payload) : undef);
185 0 ▶ my $directives_payload_index = defined $self->directives_payload_index
Branch: 2 branches
BranchTrueFalseTotal
defined $self->directives_payload_index ? : 0 0 0
$payload_catalog ? : 0 0 0
186 ? $self->directives_payload_index
187 : ($payload_catalog ? $payload_catalog->intern_directives_payload($self->directives_payload) : undef);
188 return {
189 opcode_code => $self->opcode_code,
190 resolve_code => $self->resolve_code,
191 complete_code => $self->complete_code,
192 return_type_name => $self->return_type_name,
193 dispatch_family_code => _dispatch_family_code($self->dispatch_family),
194 slot_index => defined $slot_id && exists $slot_index->{$slot_id}
195 ? $slot_index->{$slot_id}
196 : undef,
197 args_mode_code => _args_mode_code($self->args_mode),
198 args_payload_index => $args_payload_index,
199 args_payload => defined $args_payload_index ? undef : _clone_value($self->args_payload),
200 args_mode => $self->args_mode,
201 has_args => $self->has_args,
202 directives_mode => $self->directives_mode,
203 directives_mode_code => _directives_mode_code($self->directives_mode),
204 directives_payload_index => $directives_payload_index,
205 directives_payload => defined $directives_payload_index ? undef : _clone_value($self->directives_payload),
206 has_directives => $self->has_directives,
207 runtime_directives_mode => $self->runtime_directives_mode,
208 runtime_directives_mode_code => _directives_mode_code($self->runtime_directives_mode),
209 runtime_directives_payload => _clone_value($self->runtime_directives_payload),
210 has_runtime_directives => $self->has_runtime_directives,
211 child_block_index => defined $self->child_block_name && exists $block_index->{ $self->child_block_name }
212 ? $block_index->{ $self->child_block_name }
213 : undef,
214 abstract_child_block_indexes =>
215 (ref($native_abstract_child_block_indexes) eq 'HASH' && keys %$native_abstract_child_block_indexes)
216 ? { %$native_abstract_child_block_indexes }
217 : {
218 map {
219 0 ▶ my $child_name = $abstract_child_blocks->{$_};
Branch: 5 branches
BranchTrueFalseTotal
defined $slot_id && exists $slot_index->{$slot_id} ? : 0 0 0
defined $args_payload_index ? : 0 0 0
defined $directives_payload_index ? : 0 0 0
defined $self->child_block_name && exists $$block_index{$self->child_block_name} ? : 0 0 0
ref $native_abstract_child_block_indexes eq 'HASH' && keys %$native_abstract_child_block_indexes ? : 0 0 0
Condition0%0/9
defined $slot_id and exists $slot_index->{$slot_id}
!ll&&!rl&&r
000
defined $self->child_block_name and exists $$block_index{$self->child_block_name}
!ll&&!rl&&r
000
ref $native_abstract_child_block_indexes eq "HASH" and keys %$native_abstract_child_block_indexes
!ll&&!rl&&r
000
MC/DC0%0/2
defined $slot_id and exists $slot_index->{$slot_id}
defined $slot_id exists $slot_index->{$slot_id}
MC/DC0%0/2
defined $self->child_block_name and exists $$block_index{$self->child_block_name}
defined $self->child_block_name exists $$block_index{$self->child_block_name}
MC/DC0%0/2
ref $native_abstract_child_block_indexes eq "HASH" and keys %$native_abstract_child_block_indexes
ref $native_abstract_child_block_indexes eq "HASH" keys %$native_abstract_child_block_indexes
Truth table0%0/3
A and B
A= defined $slot_idB= exists $slot_index->{$slot_id}
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $self->child_block_nameB= exists $$block_index{$self->child_block_name}
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= ref $native_abstract_child_block_indexes eq "HASH"B= keys %$native_abstract_child_block_indexes
ABresult
0X0
100
111
220 0 ▶ ($_ => (defined $child_name && exists $block_index->{$child_name} ? $block_index->{$child_name} : undef))
Branch: 1 branch
BranchTrueFalseTotal
defined $child_name && exists $block_index->{$child_name} ? : 0 0 0
Condition0%0/3
defined $child_name and exists $block_index->{$child_name}
!ll&&!rl&&r
000
MC/DC0%0/2
defined $child_name and exists $block_index->{$child_name}
defined $child_name exists $block_index->{$child_name}
Truth table0%0/3
A and B
A= defined $child_nameB= exists $block_index->{$child_name}
ABresult
0X0
100
111
221 } keys %$abstract_child_blocks
222 },
223 abstract_child_blocks_index => undef,
224 };
225 }
226  
227 0 ▶sub to_native_compact_struct {
Subroutine to_native_compact_struct: not called CC=1 SCAR=6.9
Pod undocumented
228 0 my ($self, $block_index, $slot_index, $payload_catalog) = @_;
229 0 my $struct = $self->to_native_struct($block_index, $slot_index, $payload_catalog);
230 return [
231 $struct->{opcode_code},
232 $struct->{resolve_code},
233 $struct->{complete_code},
234 $struct->{dispatch_family_code},
235 $struct->{slot_index},
236 $struct->{child_block_index},
237 $struct->{abstract_child_block_indexes},
238 $struct->{args_mode_code},
239 $struct->{args_payload_index},
240 $struct->{args_payload},
241 $struct->{has_args},
242 $struct->{directives_mode_code},
243 $struct->{directives_payload_index},
244 $struct->{directives_payload},
245 $struct->{has_directives},
246 $self->field_name,
247 $self->result_name,
248 $self->return_type_name,
249 $struct->{runtime_directives_mode_code},
250 $struct->{runtime_directives_payload},
251 $struct->{has_runtime_directives},
252 0 ];
253 }
254  
255 0 ▶sub _dispatch_family_code {
Subroutine _dispatch_family_code: not called CC=7 SCAR=40.3
256 0 my ($family) = @_;
257 0 ▶ return 2 if ($family || q()) eq 'RESOLVE_TYPE';
Branch: 1 branch
BranchTrueFalseTotal
if ($family || "") eq "RESOLVE_TYPE" 0 0 0
Condition0%0/2
$family || ''
l!l
00
MC/DC0%0/1
$family || ''
$family
Truth table0%0/2
A
A= $family
Aresult
11
00
258 0 ▶ return 3 if ($family || q()) eq 'TAG';
Branch: 1 branch
BranchTrueFalseTotal
if ($family || "") eq "TAG" 0 0 0
Condition0%0/2
$family || ''
l!l
00
MC/DC0%0/1
$family || ''
$family
Truth table0%0/2
A
A= $family
Aresult
11
00
259 0 ▶ return 4 if ($family || q()) eq 'POSSIBLE_TYPES';
Branch: 1 branch
BranchTrueFalseTotal
if ($family || "") eq "POSSIBLE_TYPES" 0 0 0
Condition0%0/2
$family || ''
l!l
00
MC/DC0%0/1
$family || ''
$family
Truth table0%0/2
A
A= $family
Aresult
11
00
260 0 return 1;
261 }
262  
263 0 ▶sub _args_mode_code {
Subroutine _args_mode_code: not called CC=5 SCAR=34.0
264 0 my ($mode) = @_;
265 0 ▶ return 1 if ($mode || q()) eq 'STATIC';
Branch: 1 branch
BranchTrueFalseTotal
if ($mode || "") eq "STATIC" 0 0 0
Condition0%0/2
$mode || ''
l!l
00
MC/DC0%0/1
$mode || ''
$mode
Truth table0%0/2
A
A= $mode
Aresult
11
00
266 0 ▶ return 2 if ($mode || q()) eq 'DYNAMIC';
Branch: 1 branch
BranchTrueFalseTotal
if ($mode || "") eq "DYNAMIC" 0 0 0
Condition0%0/2
$mode || ''
l!l
00
MC/DC0%0/1
$mode || ''
$mode
Truth table0%0/2
A
A= $mode
Aresult
11
00
267 0 return 0;
268 }
269  
270 0 ▶sub _directives_mode_code {
Subroutine _directives_mode_code: not called CC=5 SCAR=34.0
271 0 my ($mode) = @_;
272 0 ▶ return 1 if ($mode || q()) eq 'STATIC';
Branch: 1 branch
BranchTrueFalseTotal
if ($mode || "") eq "STATIC" 0 0 0
Condition0%0/2
$mode || ''
l!l
00
MC/DC0%0/1
$mode || ''
$mode
Truth table0%0/2
A
A= $mode
Aresult
11
00
273 0 ▶ return 2 if ($mode || q()) eq 'DYNAMIC';
Branch: 1 branch
BranchTrueFalseTotal
if ($mode || "") eq "DYNAMIC" 0 0 0
Condition0%0/2
$mode || ''
l!l
00
MC/DC0%0/1
$mode || ''
$mode
Truth table0%0/2
A
A= $mode
Aresult
11
00
274 0 return 0;
275 }
276  
277 0 ▶sub _clone_value {
Subroutine _clone_value: not called CC=4 SCAR=30.0
278 0 my ($value) = @_;
279 0 my $ref = ref($value);
280 0 ▶ return $value if !$ref;
Branch: 1 branch
BranchTrueFalseTotal
unless $ref 0 0 0
281 0 ▶ return [ map { _clone_value($_) } @$value ] if $ref eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
if $ref eq "ARRAY" 0 0 0
282 0 ▶ return { map { $_ => _clone_value($value->{$_}) } keys %$value } if $ref eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if $ref eq "HASH" 0 0 0
283 0 return $value;
284 }
285  
286 81 ▶sub _catalog_payload {
Subroutine _catalog_payload: called CC=6 SCAR=18.5
287 81 my ($self, $payload_slot, $index_slot, $catalog_method) = @_;
288 81 my $payload = $self->[$payload_slot];
289 81 ▶ return $payload if defined $payload;
Branch: 1 branch
BranchTrueFalseTotal
if defined $payload 0 81 81
290 81 my $index = $self->[$index_slot];
291 81 ▶ return undef if !defined $index;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $index 59 22 81
292 22 ▶ my $block = $self->block or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $block = $self->block or return undef 22 0 22
293 22 ▶ my $program = $block->program or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $program = $block->program or return undef 22 0 22
294 22 ▶ my $catalog = $program->$catalog_method || [];
Condition50%1/2
$program->$catalog_method || []
l!l
220
MC/DC0%0/1
$program->$catalog_method || []
$program->$catalog_method
Truth table50%1/2
A
A= $program->$catalog_method
Aresult
11
00
295 22 return $catalog->[$index];
296 }
297  
298 3 ▶sub abstract_child_blocks {
Subroutine abstract_child_blocks: called CC=4 SCAR=22.3
Pod undocumented
299 3 my ($self) = @_;
300 3 my $payload = $self->[ABSTRACT_CHILD_BLOCKS_SLOT];
301 3 ▶ return $payload if defined $payload;
Branch: 1 branch
BranchTrueFalseTotal
if defined $payload 3 0 3
302 0 my $native = $self->[NATIVE_ABSTRACT_CHILD_BLOCK_INDEXES_SLOT];
303 0 ▶ return $native if ref($native) eq 'HASH' && keys %$native;
Branch: 1 branch
BranchTrueFalseTotal
if ref $native eq "HASH" and keys %$native 0 0 0
Condition0%0/3
ref $native eq "HASH" and keys %$native
!ll&&!rl&&r
000
MC/DC0%0/2
ref $native eq "HASH" and keys %$native
ref $native eq "HASH" keys %$native
Truth table0%0/3
A and B
A= ref $native eq "HASH"B= keys %$native
ABresult
0X0
100
111
304 0 return _catalog_payload($self, ABSTRACT_CHILD_BLOCKS_SLOT, ABSTRACT_CHILD_BLOCKS_INDEX_SLOT, 'abstract_child_maps');
305 }
306  
307 62 1;
« blib/lib/GraphQL/Houtou/Runtime/VMCompiler.pm ↑ Summary blib/lib/GraphQL/Houtou/Type/Object.pm »