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

filter: Statementstmt 62.8% 127 / 202 Branchbran 40.2% 41 / 102 Conditioncond 23.8% 52 / 218 MC/DCmcdc 3.5% 4 / 112 Subroutinesub 74.0% 20 / 27 Podpod 0.0% 0 / 3 totaltotal 36.7% 244 / 664 CC 156 SCAR 43.5
CC
156
Cov
42%
_bind_vm_ops
272.0
_bind_typename_slot
182.0
inflate_program
108.9
CRAP 77.5
« blib/lib/GraphQL/Houtou/Role/Abstract.pm ↑ Summary blib/lib/GraphQL/Houtou/Runtime/VMOp.pm »
1 package GraphQL::Houtou::Runtime::VMCompiler;
2  
3 46 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 46 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 46 ▶use GraphQL::Houtou::Runtime::OperationCompiler ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8 46 ▶use GraphQL::Houtou::Runtime::Slot ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 46 ▶use GraphQL::Houtou::Runtime::VMBlock ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 46 ▶use GraphQL::Houtou::Runtime::VMOp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 46 ▶use GraphQL::Houtou::Runtime::VMProgram ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 46 my %RESOLVE_CODE = (
14 RESOLVE_DEFAULT => 1,
15 RESOLVE_EXPLICIT => 2,
16 );
17  
18  
19 46 my %COMPLETE_CODE = (
20 COMPLETE_GENERIC => 1,
21 COMPLETE_OBJECT => 2,
22 COMPLETE_LIST => 3,
23 COMPLETE_ABSTRACT => 4,
24 );
25  
26 0 ▶sub lower_program {
Subroutine lower_program: not called CC=5 SCAR=34.0
Pod undocumented
27 0 my ($class, $runtime_schema, $program) = @_;
28 0 ▶ my @blocks = map { _lower_block($_) } @{ $program->blocks || [] };
Condition0%0/2
$program->blocks || []
l!l
00
MC/DC0%0/1
$program->blocks || []
$program->blocks
Truth table0%0/2
A
A= $program->blocks
Aresult
11
00
29 0 my %by_name = map { ($_->name => $_) } @blocks;
30 0 ▶ my $root_block = $program->root_block ? $by_name{ $program->root_block->name } : undef;
Branch: 1 branch
BranchTrueFalseTotal
$program->root_block ? : 0 0 0
31 0 ▶ my $vm_program = GraphQL::Houtou::Runtime::VMProgram->new(
Branch: 1 branch
BranchTrueFalseTotal
$program->can('variable_defs') ? : 0 0 0
Condition0%0/2
$program->variable_defs or {}
l!l
00
MC/DC0%0/1
$program->variable_defs or {}
$program->variable_defs
Truth table0%0/2
A
A= $program->variable_defs
Aresult
11
00
32 version => 1,
33 operation_type => $program->operation_type,
34 operation_name => $program->operation_name,
35 variable_defs => $program->can('variable_defs') ? ($program->variable_defs || {}) : {},
36 blocks => \@blocks,
37 root_block => $root_block,
38 args_payloads => [],
39 directives_payloads => [],
40 );
41 0 _bind_vm_ops($runtime_schema, $vm_program);
42 0 return $vm_program;
43 }
44  
45 9 ▶sub inflate_program {
Subroutine inflate_program: called CC=18 SCAR=46.9
Pod undocumented
46 9 my ($class, $runtime_schema, $struct) = @_;
47 9 ▶ if ($struct->{blocks_compact}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($struct->{"blocks_compact"}) 9 0 9
48 9 ▶ my @blocks = map { _inflate_native_block($_) } @{ $struct->{blocks_compact} || [] };
Condition50%1/2
$struct->{'blocks_compact'} || []
l!l
90
MC/DC0%0/1
$struct->{'blocks_compact'} || []
$struct->{'blocks_compact'}
Truth table50%1/2
A
A= $struct->{'blocks_compact'}
Aresult
11
00
49 my $root_block = defined $struct->{root_block_index}
50 9 ▶ ? $blocks[ $struct->{root_block_index} ]
Branch: 1 branch
BranchTrueFalseTotal
defined $struct->{'root_block_index'} ? : 9 0 9
51 : undef;
52 my $vm_program = GraphQL::Houtou::Runtime::VMProgram->new(
53 version => $struct->{version} || 1,
54 operation_type => $struct->{operation_type} || _operation_type_from_code($struct->{operation_type_code}),
55 operation_name => $struct->{operation_name},
56 variable_defs => $struct->{variable_defs} || {},
57 blocks => \@blocks,
58 root_block => $root_block,
59 args_payloads => $struct->{args_payloads_compact} || $struct->{args_payloads} || [],
60 9 ▶ directives_payloads => $struct->{directives_payloads_compact} || $struct->{directives_payloads} || [],
Condition41%7/17
$struct->{'version'} || 1
l!l
90
$struct->{'operation_type'} || _operation_type_from_code($struct->{'operation_type_code'})
l!l&&r!l&&!r
090
$struct->{'variable_defs'} || {}
l!l
90
$struct->{'args_payloads_compact'} || $struct->{'args_payloads'} || []
l!l
90
$struct->{"args_payloads_compact"} or $struct->{"args_payloads"}
l!l&&r!l&&!r
900
$struct->{'directives_payloads_compact'} || $struct->{'directives_payloads'} || []
l!l
90
$struct->{"directives_payloads_compact"} or $struct->{"directives_payloads"}
l!l&&r!l&&!r
900
MC/DC0%0/1
$struct->{'version'} || 1
$struct->{'version'}
MC/DC0%0/2
$struct->{'operation_type'} || _operation_type_from_code($struct->{'operation_type_code'})
$struct->{'operation_type'} _operation_type_from_code($struct->{'operation_type_code'})
MC/DC0%0/1
$struct->{'variable_defs'} || {}
$struct->{'variable_defs'}
MC/DC0%0/2
$struct->{'args_payloads_compact'} || $struct->{'args_payloads'} || []
$struct->{"args_payloads_compact"} $struct->{"args_payloads"}
MC/DC0%0/2
$struct->{'directives_payloads_compact'} || $struct->{'directives_payloads'} || []
$struct->{"directives_payloads_compact"} $struct->{"directives_payloads"}
Truth table50%1/2
A
A= $struct->{'version'}
Aresult
11
00
Truth table33%1/3
A || B
A= $struct->{'operation_type'}B= _operation_type_from_code($struct->{'operation_type_code'})
ABresult
1X1
011
000
Truth table50%1/2
A
A= $struct->{'variable_defs'}
Aresult
11
00
Truth table33%1/3
A or B
A= $struct->{"args_payloads_compact"}B= $struct->{"args_payloads"}
ABresult
1X1
011
000
Truth table33%1/3
A or B
A= $struct->{"directives_payloads_compact"}B= $struct->{"directives_payloads"}
ABresult
1X1
011
000
61 );
62 9 _bind_native_vm_ops($runtime_schema, $vm_program, $struct);
63 9 return $vm_program;
64 }
65 0 ▶ my @blocks = map { _inflate_block($_) } @{ $struct->{blocks} || [] };
Condition0%0/2
$struct->{'blocks'} || []
l!l
00
MC/DC0%0/1
$struct->{'blocks'} || []
$struct->{'blocks'}
Truth table0%0/2
A
A= $struct->{'blocks'}
Aresult
11
00
66 0 my %by_name = map { ($_->name => $_) } @blocks;
67 0 ▶ my $root_block = defined $struct->{root_block} ? $by_name{ $struct->{root_block} } : undef;
Branch: 1 branch
BranchTrueFalseTotal
defined $struct->{'root_block'} ? : 0 0 0
68 my $vm_program = GraphQL::Houtou::Runtime::VMProgram->new(
69 version => $struct->{version} || 1,
70 operation_type => $struct->{operation_type} || 'query',
71 operation_name => $struct->{operation_name},
72 variable_defs => $struct->{variable_defs} || {},
73 blocks => \@blocks,
74 root_block => $root_block,
75 args_payloads => $struct->{args_payloads} || [],
76 0 ▶ directives_payloads => $struct->{directives_payloads} || [],
Condition0%0/10
$struct->{'version'} || 1
l!l
00
$struct->{'operation_type'} || 'query'
l!l
00
$struct->{'variable_defs'} || {}
l!l
00
$struct->{'args_payloads'} || []
l!l
00
$struct->{'directives_payloads'} || []
l!l
00
MC/DC0%0/1
$struct->{'version'} || 1
$struct->{'version'}
MC/DC0%0/1
$struct->{'operation_type'} || 'query'
$struct->{'operation_type'}
MC/DC0%0/1
$struct->{'variable_defs'} || {}
$struct->{'variable_defs'}
MC/DC0%0/1
$struct->{'args_payloads'} || []
$struct->{'args_payloads'}
MC/DC0%0/1
$struct->{'directives_payloads'} || []
$struct->{'directives_payloads'}
Truth table0%0/2
A
A= $struct->{'version'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'operation_type'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'variable_defs'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'args_payloads'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'directives_payloads'}
Aresult
11
00
77 );
78 0 _bind_vm_ops($runtime_schema, $vm_program);
79 0 return $vm_program;
80 }
81  
82 1 ▶sub inflate_native_bundle {
Subroutine inflate_native_bundle: called CC=12 SCAR=31.1
Pod undocumented
83 1 my ($class, $runtime_schema, $struct) = @_;
84 1 ▶ my $program_struct = $struct->{program} || {};
Condition50%1/2
$struct->{'program'} || {}
l!l
10
MC/DC0%0/1
$struct->{'program'} || {}
$struct->{'program'}
Truth table50%1/2
A
A= $struct->{'program'}
Aresult
11
00
85 1 ▶ my $block_entries = $program_struct->{blocks_compact} || $program_struct->{blocks} || [];
Condition40%2/5
$program_struct->{'blocks_compact'} || $program_struct->{'blocks'} || []
l!l
10
$program_struct->{"blocks_compact"} or $program_struct->{"blocks"}
l!l&&r!l&&!r
100
MC/DC0%0/2
$program_struct->{'blocks_compact'} || $program_struct->{'blocks'} || []
$program_struct->{"blocks_compact"} $program_struct->{"blocks"}
Truth table33%1/3
A or B
A= $program_struct->{"blocks_compact"}B= $program_struct->{"blocks"}
ABresult
1X1
011
000
86 1 my @blocks = map { _inflate_native_block($_) } @{ $block_entries };
87 my $root_block = defined $program_struct->{root_block_index}
88 1 ▶ ? $blocks[ $program_struct->{root_block_index} ]
Branch: 1 branch
BranchTrueFalseTotal
defined $program_struct->{'root_block_index'} ? : 1 0 1
89 : undef;
90 my $vm_program = GraphQL::Houtou::Runtime::VMProgram->new(
91 version => $program_struct->{version} || 1,
92 operation_type => $program_struct->{operation_type} || _operation_type_from_code($program_struct->{operation_type_code}),
93 operation_name => $program_struct->{operation_name},
94 variable_defs => $program_struct->{variable_defs} || {},
95 blocks => \@blocks,
96 root_block => $root_block,
97 args_payloads => $program_struct->{args_payloads_compact} || $program_struct->{args_payloads} || [],
98 1 ▶ directives_payloads => $program_struct->{directives_payloads_compact} || $program_struct->{directives_payloads} || [],
Condition41%7/17
$program_struct->{'version'} || 1
l!l
10
$program_struct->{'operation_type'} || _operation_type_from_code($program_struct->{'operation_type_code'})
l!l&&r!l&&!r
010
$program_struct->{'variable_defs'} || {}
l!l
10
$program_struct->{'args_payloads_compact'} || $program_struct->{'args_payloads'} || []
l!l
10
$program_struct->{"args_payloads_compact"} or $program_struct->{"args_payloads"}
l!l&&r!l&&!r
100
$program_struct->{'directives_payloads_compact'} || $program_struct->{'directives_payloads'} || []
l!l
10
$program_struct->{"directives_payloads_compact"} or $program_struct->{"directives_payloads"}
l!l&&r!l&&!r
100
MC/DC0%0/1
$program_struct->{'version'} || 1
$program_struct->{'version'}
MC/DC0%0/2
$program_struct->{'operation_type'} || _operation_type_from_code($program_struct->{'operation_type_code'})
$program_struct->{'operation_type'} _operation_type_from_code($program_struct->{'operation_type_code'})
MC/DC0%0/1
$program_struct->{'variable_defs'} || {}
$program_struct->{'variable_defs'}
MC/DC0%0/2
$program_struct->{'args_payloads_compact'} || $program_struct->{'args_payloads'} || []
$program_struct->{"args_payloads_compact"} $program_struct->{"args_payloads"}
MC/DC0%0/2
$program_struct->{'directives_payloads_compact'} || $program_struct->{'directives_payloads'} || []
$program_struct->{"directives_payloads_compact"} $program_struct->{"directives_payloads"}
Truth table50%1/2
A
A= $program_struct->{'version'}
Aresult
11
00
Truth table33%1/3
A || B
A= $program_struct->{'operation_type'}B= _operation_type_from_code($program_struct->{'operation_type_code'})
ABresult
1X1
011
000
Truth table50%1/2
A
A= $program_struct->{'variable_defs'}
Aresult
11
00
Truth table33%1/3
A or B
A= $program_struct->{"args_payloads_compact"}B= $program_struct->{"args_payloads"}
ABresult
1X1
011
000
Truth table33%1/3
A or B
A= $program_struct->{"directives_payloads_compact"}B= $program_struct->{"directives_payloads"}
ABresult
1X1
011
000
99 );
100 1 _bind_native_vm_ops($runtime_schema, $vm_program, $program_struct);
101 1 return $vm_program;
102 }
103  
104 0 ▶sub _lower_block {
Subroutine _lower_block: not called CC=2 SCAR=17.9
105 0 my ($block) = @_;
106 return GraphQL::Houtou::Runtime::VMBlock->new(
107 name => $block->name,
108 type_name => $block->type_name,
109 family => $block->family,
110 0 ▶ ops => [ map { _lower_instruction($_) } @{ $block->instructions || [] } ],
Condition0%0/2
$block->instructions || []
l!l
00
MC/DC0%0/1
$block->instructions || []
$block->instructions
Truth table0%0/2
A
A= $block->instructions
Aresult
11
00
111 );
112 }
113  
114 0 ▶sub _inflate_block {
Subroutine _inflate_block: not called CC=3 SCAR=24.8
115 0 my ($struct) = @_;
116 return GraphQL::Houtou::Runtime::VMBlock->new(
117 name => $struct->{name},
118 type_name => $struct->{type_name},
119 family => $struct->{family} || 'OBJECT',
120 0 ▶ ops => [ map { _inflate_op($_) } @{ $struct->{ops} || [] } ],
Condition0%0/4
$struct->{'family'} || 'OBJECT'
l!l
00
$struct->{'ops'} || []
l!l
00
MC/DC0%0/1
$struct->{'family'} || 'OBJECT'
$struct->{'family'}
MC/DC0%0/1
$struct->{'ops'} || []
$struct->{'ops'}
Truth table0%0/2
A
A= $struct->{'family'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'ops'}
Aresult
11
00
121 );
122 }
123  
124 0 ▶sub _lower_instruction {
Subroutine _lower_instruction: not called CC=7 SCAR=40.3
125 0 my ($instruction) = @_;
126 0 ▶ my $resolve_family = $instruction->resolve_op || 'RESOLVE_DEFAULT';
Condition0%0/2
$instruction->resolve_op || 'RESOLVE_DEFAULT'
l!l
00
MC/DC0%0/1
$instruction->resolve_op || 'RESOLVE_DEFAULT'
$instruction->resolve_op
Truth table0%0/2
A
A= $instruction->resolve_op
Aresult
11
00
127 0 ▶ my $complete_family = $instruction->complete_op || 'COMPLETE_GENERIC';
Condition0%0/2
$instruction->complete_op || 'COMPLETE_GENERIC'
l!l
00
MC/DC0%0/1
$instruction->complete_op || 'COMPLETE_GENERIC'
$instruction->complete_op
Truth table0%0/2
A
A= $instruction->complete_op
Aresult
11
00
128 return GraphQL::Houtou::Runtime::VMOp->new(
129 opcode => join(q(:), $resolve_family, $complete_family),
130 opcode_code => (($RESOLVE_CODE{$resolve_family} || 0) * 16) + ($COMPLETE_CODE{$complete_family} || 0),
131 resolve_family => $resolve_family,
132 resolve_code => $RESOLVE_CODE{$resolve_family} || 0,
133 complete_family => $complete_family,
134 0 ▶ complete_code => $COMPLETE_CODE{$complete_family} || 0,
Condition0%0/8
$RESOLVE_CODE{$resolve_family} || 0
l!l
00
$COMPLETE_CODE{$complete_family} || 0
l!l
00
$RESOLVE_CODE{$resolve_family} || 0
l!l
00
$COMPLETE_CODE{$complete_family} || 0
l!l
00
MC/DC0%0/1
$RESOLVE_CODE{$resolve_family} || 0
$RESOLVE_CODE{$resolve_family}
MC/DC0%0/1
$COMPLETE_CODE{$complete_family} || 0
$COMPLETE_CODE{$complete_family}
MC/DC0%0/1
$RESOLVE_CODE{$resolve_family} || 0
$RESOLVE_CODE{$resolve_family}
MC/DC0%0/1
$COMPLETE_CODE{$complete_family} || 0
$COMPLETE_CODE{$complete_family}
Truth table0%0/2
A
A= $RESOLVE_CODE{$resolve_family}
Aresult
11
00
Truth table0%0/2
A
A= $COMPLETE_CODE{$complete_family}
Aresult
11
00
Truth table0%0/2
A
A= $RESOLVE_CODE{$resolve_family}
Aresult
11
00
Truth table0%0/2
A
A= $COMPLETE_CODE{$complete_family}
Aresult
11
00
135 field_name => $instruction->field_name,
136 result_name => $instruction->result_name,
137 return_type_name => $instruction->return_type_name,
138 dispatch_family => $instruction->dispatch_family,
139 child_block_name => $instruction->child_block_name,
140 abstract_child_blocks => $instruction->abstract_child_blocks,
141 abstract_child_blocks_index => undef,
142 args_mode => $instruction->args_mode,
143 args_payload => $instruction->args_payload,
144 args_payload_index => undef,
145 has_args => $instruction->has_args,
146 directives_mode => $instruction->directives_mode,
147 directives_payload => $instruction->directives_payload,
148 directives_payload_index => undef,
149 has_directives => $instruction->has_directives,
150 runtime_directives_mode => $instruction->runtime_directives_mode,
151 runtime_directives_payload => $instruction->runtime_directives_payload,
152 has_runtime_directives => $instruction->has_runtime_directives,
153 bound_slot => $instruction->bound_slot,
154 );
155 }
156  
157 0 ▶sub _inflate_op {
Subroutine _inflate_op: not called CC=8 SCAR=42.8
158 0 my ($struct) = @_;
159 return GraphQL::Houtou::Runtime::VMOp->new(
160 opcode => $struct->{opcode},
161 opcode_code => $struct->{opcode_code} || 0,
162 resolve_family => $struct->{resolve_family},
163 resolve_code => $struct->{resolve_code} || 0,
164 complete_family => $struct->{complete_family},
165 complete_code => $struct->{complete_code} || 0,
166 field_name => $struct->{field_name},
167 result_name => $struct->{result_name},
168 return_type_name => $struct->{return_type_name},
169 dispatch_family => $struct->{dispatch_family},
170 child_block_name => $struct->{child_block_name},
171 abstract_child_blocks => $struct->{abstract_child_blocks} || {},
172 abstract_child_blocks_index => $struct->{abstract_child_blocks_index},
173 args_mode => $struct->{args_mode} || 'NONE',
174 args_payload => $struct->{args_payload},
175 args_payload_index => $struct->{args_payload_index},
176 has_args => $struct->{has_args},
177 directives_mode => $struct->{directives_mode} || 'NONE',
178 directives_payload => $struct->{directives_payload},
179 directives_payload_index => $struct->{directives_payload_index},
180 has_directives => $struct->{has_directives},
181 runtime_directives_mode => $struct->{runtime_directives_mode} || 'NONE',
182 runtime_directives_payload => $struct->{runtime_directives_payload},
183 has_runtime_directives => $struct->{has_runtime_directives},
184 0 ▶ );
Condition0%0/14
$struct->{'opcode_code'} || 0
l!l
00
$struct->{'resolve_code'} || 0
l!l
00
$struct->{'complete_code'} || 0
l!l
00
$struct->{'abstract_child_blocks'} || {}
l!l
00
$struct->{'args_mode'} || 'NONE'
l!l
00
$struct->{'directives_mode'} || 'NONE'
l!l
00
$struct->{'runtime_directives_mode'} || 'NONE'
l!l
00
MC/DC0%0/1
$struct->{'opcode_code'} || 0
$struct->{'opcode_code'}
MC/DC0%0/1
$struct->{'resolve_code'} || 0
$struct->{'resolve_code'}
MC/DC0%0/1
$struct->{'complete_code'} || 0
$struct->{'complete_code'}
MC/DC0%0/1
$struct->{'abstract_child_blocks'} || {}
$struct->{'abstract_child_blocks'}
MC/DC0%0/1
$struct->{'args_mode'} || 'NONE'
$struct->{'args_mode'}
MC/DC0%0/1
$struct->{'directives_mode'} || 'NONE'
$struct->{'directives_mode'}
MC/DC0%0/1
$struct->{'runtime_directives_mode'} || 'NONE'
$struct->{'runtime_directives_mode'}
Truth table0%0/2
A
A= $struct->{'opcode_code'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'resolve_code'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'complete_code'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'abstract_child_blocks'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'args_mode'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'directives_mode'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'runtime_directives_mode'}
Aresult
11
00
185 }
186  
187 19 ▶sub _inflate_native_block {
Subroutine _inflate_native_block: called CC=5 SCAR=21.6
188 19 my ($struct) = @_;
189 19 ▶ if (ref($struct) eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $struct eq "ARRAY") 19 0 19
190 19 my ($name, $type_name, $family_code, $slots, $ops) = @$struct;
191 return GraphQL::Houtou::Runtime::VMBlock->new(
192 name => $name,
193 type_name => $type_name,
194 family => _family_from_code($family_code),
195 19 ▶ ops => [ map { _inflate_native_op($_) } @{ $ops || [] } ],
Condition50%1/2
$ops || []
l!l
190
MC/DC0%0/1
$ops || []
$ops
Truth table50%1/2
A
A= $ops
Aresult
11
00
196 );
197 }
198 return GraphQL::Houtou::Runtime::VMBlock->new(
199 name => $struct->{name},
200 type_name => $struct->{type_name},
201 family => $struct->{family} || 'OBJECT',
202 0 ▶ ops => [ map { _inflate_native_op($_) } @{ $struct->{ops} || [] } ],
Condition0%0/4
$struct->{'family'} || 'OBJECT'
l!l
00
$struct->{'ops'} || []
l!l
00
MC/DC0%0/1
$struct->{'family'} || 'OBJECT'
$struct->{'family'}
MC/DC0%0/1
$struct->{'ops'} || []
$struct->{'ops'}
Truth table0%0/2
A
A= $struct->{'family'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'ops'}
Aresult
11
00
203 );
204 }
205  
206 25 ▶sub _inflate_native_op {
Subroutine _inflate_native_op: called CC=14 SCAR=43.0
207 25 my ($struct) = @_;
208 25 ▶ if (ref($struct) eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $struct eq "ARRAY") 25 0 25
209 25 my ($opcode_code, $resolve_code, $complete_code, $dispatch_family_code, $slot_index, $child_block_index, $abstract_child_block_indexes, $args_mode_code, $args_payload_index, $args_payload, $has_args, $directives_mode_code, $directives_payload_index, $directives_payload, $has_directives, $field_name, $result_name, $return_type_name, $runtime_directives_mode_code, $runtime_directives_payload, $has_runtime_directives) = @$struct;
210 25 my $resolve_family = _resolve_family_from_code($resolve_code);
211 25 my $complete_family = _complete_family_from_code($complete_code);
212 25 ▶ my $op = GraphQL::Houtou::Runtime::VMOp->new(
Condition50%3/6
$opcode_code || 0
l!l
250
$resolve_code || 0
l!l
250
$complete_code || 0
l!l
250
MC/DC0%0/1
$opcode_code || 0
$opcode_code
MC/DC0%0/1
$resolve_code || 0
$resolve_code
MC/DC0%0/1
$complete_code || 0
$complete_code
Truth table50%1/2
A
A= $opcode_code
Aresult
11
00
Truth table50%1/2
A
A= $resolve_code
Aresult
11
00
Truth table50%1/2
A
A= $complete_code
Aresult
11
00
213 opcode => join(q(:), $resolve_family, $complete_family),
214 opcode_code => $opcode_code || 0,
215 resolve_family => $resolve_family,
216 resolve_code => $resolve_code || 0,
217 complete_family => $complete_family,
218 complete_code => $complete_code || 0,
219 dispatch_family => _dispatch_family_from_code($dispatch_family_code),
220 field_name => $field_name,
221 result_name => $result_name,
222 return_type_name => $return_type_name,
223 abstract_child_blocks_index => undef,
224 args_mode => _args_mode_from_code($args_mode_code),
225 args_payload => $args_payload,
226 args_payload_index => $args_payload_index,
227 has_args => $has_args,
228 directives_mode => _directives_mode_from_code($directives_mode_code),
229 directives_payload => $directives_payload,
230 directives_payload_index => $directives_payload_index,
231 has_directives => $has_directives,
232 runtime_directives_mode => _directives_mode_from_code($runtime_directives_mode_code),
233 runtime_directives_payload => $runtime_directives_payload,
234 has_runtime_directives => $has_runtime_directives,
235 );
236 25 $op->set_native_slot_index($slot_index);
237 25 $op->set_native_child_block_index($child_block_index);
238 25 ▶ $op->set_native_abstract_child_block_indexes($abstract_child_block_indexes || {});
Condition50%1/2
$abstract_child_block_indexes || {}
l!l
250
MC/DC0%0/1
$abstract_child_block_indexes || {}
$abstract_child_block_indexes
Truth table50%1/2
A
A= $abstract_child_block_indexes
Aresult
11
00
239 25 return $op;
240 }
241 0 my $resolve_family = _resolve_family_from_code($struct->{resolve_code});
242 0 my $complete_family = _complete_family_from_code($struct->{complete_code});
243 my $op = GraphQL::Houtou::Runtime::VMOp->new(
244 opcode => join(q(:), $resolve_family, $complete_family),
245 opcode_code => $struct->{opcode_code} || 0,
246 resolve_family => $resolve_family,
247 resolve_code => $struct->{resolve_code} || 0,
248 complete_family => $complete_family,
249 complete_code => $struct->{complete_code} || 0,
250 dispatch_family => $struct->{dispatch_family} || _dispatch_family_from_code($struct->{dispatch_family_code}),
251 return_type_name => $struct->{return_type_name},
252 args_mode => $struct->{args_mode} || 'NONE',
253 args_payload => $struct->{args_payload},
254 args_payload_index => $struct->{args_payload_index},
255 has_args => $struct->{has_args},
256 directives_mode => $struct->{directives_mode} || _directives_mode_from_code($struct->{directives_mode_code}),
257 directives_payload => $struct->{directives_payload},
258 directives_payload_index => $struct->{directives_payload_index},
259 has_directives => $struct->{has_directives},
260 runtime_directives_mode => $struct->{runtime_directives_mode} || _directives_mode_from_code($struct->{runtime_directives_mode_code}),
261 runtime_directives_payload => $struct->{runtime_directives_payload},
262 has_runtime_directives => $struct->{has_runtime_directives},
263 abstract_child_blocks_index => $struct->{abstract_child_blocks_index},
264 0 ▶ );
Condition0%0/17
$struct->{'opcode_code'} || 0
l!l
00
$struct->{'resolve_code'} || 0
l!l
00
$struct->{'complete_code'} || 0
l!l
00
$struct->{'dispatch_family'} || _dispatch_family_from_code($struct->{'dispatch_family_code'})
l!l&&r!l&&!r
000
$struct->{'args_mode'} || 'NONE'
l!l
00
$struct->{'directives_mode'} || _directives_mode_from_code($struct->{'directives_mode_code'})
l!l&&r!l&&!r
000
$struct->{'runtime_directives_mode'} || _directives_mode_from_code($struct->{'runtime_directives_mode_code'})
l!l&&r!l&&!r
000
MC/DC0%0/1
$struct->{'opcode_code'} || 0
$struct->{'opcode_code'}
MC/DC0%0/1
$struct->{'resolve_code'} || 0
$struct->{'resolve_code'}
MC/DC0%0/1
$struct->{'complete_code'} || 0
$struct->{'complete_code'}
MC/DC0%0/2
$struct->{'dispatch_family'} || _dispatch_family_from_code($struct->{'dispatch_family_code'})
$struct->{'dispatch_family'} _dispatch_family_from_code($struct->{'dispatch_family_code'})
MC/DC0%0/1
$struct->{'args_mode'} || 'NONE'
$struct->{'args_mode'}
MC/DC0%0/2
$struct->{'directives_mode'} || _directives_mode_from_code($struct->{'directives_mode_code'})
$struct->{'directives_mode'} _directives_mode_from_code($struct->{'directives_mode_code'})
MC/DC0%0/2
$struct->{'runtime_directives_mode'} || _directives_mode_from_code($struct->{'runtime_directives_mode_code'})
$struct->{'runtime_directives_mode'} _directives_mode_from_code($struct->{'runtime_directives_mode_code'})
Truth table0%0/2
A
A= $struct->{'opcode_code'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'resolve_code'}
Aresult
11
00
Truth table0%0/2
A
A= $struct->{'complete_code'}
Aresult
11
00
Truth table0%0/3
A || B
A= $struct->{'dispatch_family'}B= _dispatch_family_from_code($struct->{'dispatch_family_code'})
ABresult
1X1
011
000
Truth table0%0/2
A
A= $struct->{'args_mode'}
Aresult
11
00
Truth table0%0/3
A || B
A= $struct->{'directives_mode'}B= _directives_mode_from_code($struct->{'directives_mode_code'})
ABresult
1X1
011
000
Truth table0%0/3
A || B
A= $struct->{'runtime_directives_mode'}B= _directives_mode_from_code($struct->{'runtime_directives_mode_code'})
ABresult
1X1
011
000
265 0 $op->set_native_slot_index($struct->{slot_index});
266 0 $op->set_native_child_block_index($struct->{child_block_index});
267 0 ▶ $op->set_native_abstract_child_block_indexes($struct->{abstract_child_block_indexes} || {});
Condition0%0/2
$struct->{'abstract_child_block_indexes'} || {}
l!l
00
MC/DC0%0/1
$struct->{'abstract_child_block_indexes'} || {}
$struct->{'abstract_child_block_indexes'}
Truth table0%0/2
A
A= $struct->{'abstract_child_block_indexes'}
Aresult
11
00
268 0 return $op;
269 }
270  
271 19 ▶sub _family_from_code {
Subroutine _family_from_code: called CC=7 SCAR=33.6
272 19 my ($code) = @_;
273 19 ▶ return 'OBJECT' if ($code || 0) == 2;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 2 19 0 19
Condition50%1/2
$code || 0
l!l
190
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
274 0 ▶ return 'LIST' if ($code || 0) == 3;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 3 0 0 0
Condition0%0/2
$code || 0
l!l
00
MC/DC0%0/1
$code || 0
$code
Truth table0%0/2
A
A= $code
Aresult
11
00
275 0 ▶ return 'ABSTRACT' if ($code || 0) == 4;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 4 0 0 0
Condition0%0/2
$code || 0
l!l
00
MC/DC0%0/1
$code || 0
$code
Truth table0%0/2
A
A= $code
Aresult
11
00
276 0 return 'GENERIC';
277 }
278  
279 25 ▶sub _dispatch_family_from_code {
Subroutine _dispatch_family_from_code: called CC=7 SCAR=21.1
280 25 my ($code) = @_;
281 25 ▶ return 'RESOLVE_TYPE' if ($code || 0) == 2;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 2 0 25 25
Condition50%1/2
$code || 0
l!l
250
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
282 25 ▶ return 'TAG' if ($code || 0) == 3;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 3 2 23 25
Condition50%1/2
$code || 0
l!l
250
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
283 23 ▶ return 'POSSIBLE_TYPES' if ($code || 0) == 4;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 4 0 23 23
Condition50%1/2
$code || 0
l!l
230
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
284 23 return 'DEFAULT';
285 }
286  
287 10 ▶sub _operation_type_from_code {
Subroutine _operation_type_from_code: called CC=5 SCAR=17.8
288 10 my ($code) = @_;
289 10 ▶ return 'mutation' if ($code || 0) == 2;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 2 0 10 10
Condition50%1/2
$code || 0
l!l
100
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
290 10 ▶ return 'subscription' if ($code || 0) == 3;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 3 0 10 10
Condition50%1/2
$code || 0
l!l
100
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
291 10 return 'query';
292 }
293  
294 25 ▶sub _args_mode_from_code {
Subroutine _args_mode_from_code: called CC=5 SCAR=16.1
295 25 my ($code) = @_;
296 25 ▶ return 'STATIC' if ($code || 0) == 1;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 1 1 24 25
Condition100%2/2
$code || 0
l!l
322
MC/DC100%1/1
$code || 0
$code
Truth table100%2/2
A
A= $code
Aresult
11
00
297 24 ▶ return 'DYNAMIC' if ($code || 0) == 2;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 2 2 22 24
Condition100%2/2
$code || 0
l!l
222
MC/DC100%1/1
$code || 0
$code
Truth table100%2/2
A
A= $code
Aresult
11
00
298 22 return 'NONE';
299 }
300  
301 50 ▶sub _directives_mode_from_code {
Subroutine _directives_mode_from_code: called CC=5 SCAR=16.1
302 50 my ($code) = @_;
303 50 ▶ return 'STATIC' if ($code || 0) == 1;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 1 0 50 50
Condition100%2/2
$code || 0
l!l
149
MC/DC100%1/1
$code || 0
$code
Truth table100%2/2
A
A= $code
Aresult
11
00
304 50 ▶ return 'DYNAMIC' if ($code || 0) == 2;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 2 1 49 50
Condition100%2/2
$code || 0
l!l
149
MC/DC100%1/1
$code || 0
$code
Truth table100%2/2
A
A= $code
Aresult
11
00
305 49 return 'NONE';
306 }
307  
308 0 ▶sub _bind_vm_ops {
Subroutine _bind_vm_ops: not called CC=16 SCAR=56.1
309 0 my ($runtime_schema, $program) = @_;
310 0 ▶ my %blocks = map { ($_->name => $_) } @{ $program->blocks || [] };
Condition0%0/2
$program->blocks || []
l!l
00
MC/DC0%0/1
$program->blocks || []
$program->blocks
Truth table0%0/2
A
A= $program->blocks
Aresult
11
00
311 0 ▶ if (my $root = $program->root_block) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $root = $program->root_block) 0 0 0
312 0 $blocks{ $root->name } = $root;
313 }
314  
315 0 ▶ for my $block (@{ $program->blocks || [] }, ($program->root_block || ())) {
Condition0%0/5
$program->blocks || []
l!l
00
$program->root_block || ()
l!l&&r!l&&!r
000
MC/DC0%0/1
$program->blocks || []
$program->blocks
MC/DC0%0/2
$program->root_block || ()
$program->root_block ()
Truth table0%0/2
A
A= $program->blocks
Aresult
11
00
Truth table0%0/3
A || B
A= $program->root_blockB= ()
ABresult
1X1
011
000
316 0 ▶ next if !$block;
Branch: 1 branch
BranchTrueFalseTotal
unless $block 0 0 0
317 0 my $schema_block = $runtime_schema->block_by_type_name($block->type_name);
318 my %slots = $schema_block
319 0 ▶ ? map { ($_->field_name => $_) } @{ $schema_block->slots || [] }
Branch: 1 branch
BranchTrueFalseTotal
$schema_block ? : 0 0 0
Condition0%0/2
$schema_block->slots || []
l!l
00
MC/DC0%0/1
$schema_block->slots || []
$schema_block->slots
Truth table0%0/2
A
A= $schema_block->slots
Aresult
11
00
320 : ();
321  
322 0 ▶ for my $op (@{ $block->ops || [] }) {
Condition0%0/2
$block->ops || []
l!l
00
MC/DC0%0/1
$block->ops || []
$block->ops
Truth table0%0/2
A
A= $block->ops
Aresult
11
00
323 0 ▶ $op->set_bound_slot($op->bound_slot || $slots{ $op->field_name });
Condition0%0/3
$op->bound_slot || $slots{$op->field_name}
l!l&&r!l&&!r
000
MC/DC0%0/2
$op->bound_slot || $slots{$op->field_name}
$op->bound_slot $slots{$op->field_name}
Truth table0%0/3
A || B
A= $op->bound_slotB= $slots{$op->field_name}
ABresult
1X1
011
000
324 0 ▶ $op->set_bound_slot($op->bound_slot || _bind_typename_slot($runtime_schema, $block, $op));
Condition0%0/3
$op->bound_slot || _bind_typename_slot($runtime_schema, $block, $op)
l!l&&r!l&&!r
000
MC/DC0%0/2
$op->bound_slot || _bind_typename_slot($runtime_schema, $block, $op)
$op->bound_slot _bind_typename_slot($runtime_schema, $block, $op)
Truth table0%0/3
A || B
A= $op->bound_slotB= _bind_typename_slot($runtime_schema, $block, $op)
ABresult
1X1
011
000
325 $op->set_bound_child_block($op->child_block_name
326 0 ▶ ? $blocks{ $op->child_block_name }
Branch: 1 branch
BranchTrueFalseTotal
$op->child_block_name ? : 0 0 0
327 : undef);
328 $op->set_bound_abstract_child_blocks({
329 map {
330 0 my $child_name = $op->abstract_child_blocks->{$_};
331 0 ▶ ($_ => ($child_name ? $blocks{$child_name} : undef))
Branch: 1 branch
BranchTrueFalseTotal
$child_name ? : 0 0 0
332 0 ▶ } keys %{ $op->abstract_child_blocks || {} }
Condition0%0/2
$op->abstract_child_blocks || {}
l!l
00
MC/DC0%0/1
$op->abstract_child_blocks || {}
$op->abstract_child_blocks
Truth table0%0/2
A
A= $op->abstract_child_blocks
Aresult
11
00
333 });
334 }
335 }
336  
337 0 return $program;
338 }
339  
340 10 ▶sub _bind_native_vm_ops {
Subroutine _bind_native_vm_ops: called CC=32 SCAR=43.6
341 10 my ($runtime_schema, $program, $program_struct) = @_;
342 10 ▶ my @block_structs = @{ $program_struct->{blocks_compact} || $program_struct->{blocks} || [] };
Condition40%2/5
$program_struct->{'blocks_compact'} || $program_struct->{'blocks'} || []
l!l
100
$program_struct->{"blocks_compact"} or $program_struct->{"blocks"}
l!l&&r!l&&!r
1000
MC/DC0%0/2
$program_struct->{'blocks_compact'} || $program_struct->{'blocks'} || []
$program_struct->{"blocks_compact"} $program_struct->{"blocks"}
Truth table33%1/3
A or B
A= $program_struct->{"blocks_compact"}B= $program_struct->{"blocks"}
ABresult
1X1
011
000
343 10 ▶ my @blocks = @{ $program->blocks || [] };
Condition50%1/2
$program->blocks || []
l!l
100
MC/DC0%0/1
$program->blocks || []
$program->blocks
Truth table50%1/2
A
A= $program->blocks
Aresult
11
00
344 10 ▶ my @runtime_slots = @{ $runtime_schema->slot_catalog || [] };
Condition50%1/2
$runtime_schema->slot_catalog || []
l!l
100
MC/DC0%0/1
$runtime_schema->slot_catalog || []
$runtime_schema->slot_catalog
Truth table50%1/2
A
A= $runtime_schema->slot_catalog
Aresult
11
00
345  
346 10 for my $block_index (0 .. $#blocks) {
347 19 ▶ my $block = $blocks[$block_index] or next;
Branch: 1 branch
BranchTrueFalseTotal
my $block = $blocks[$block_index] or next 19 0 19
348 19 ▶ my $block_struct = $block_structs[$block_index] || {};
Condition50%1/2
$block_structs[$block_index] || {}
l!l
190
MC/DC0%0/1
$block_structs[$block_index] || {}
$block_structs[$block_index]
Truth table50%1/2
A
A= $block_structs[$block_index]
Aresult
11
00
349 my @native_slots = ref($block_struct) eq 'ARRAY'
350 19 ▶ ? @{ $block_struct->[3] || [] }
Condition50%1/2
$block_struct->[3] || []
l!l
190
MC/DC0%0/1
$block_struct->[3] || []
$block_struct->[3]
Truth table50%1/2
A
A= $block_struct->[3]
Aresult
11
00
351 0 ▶ : @{ $block_struct->{slots} || [] };
Branch: 1 branch
BranchTrueFalseTotal
ref $block_struct eq 'ARRAY' ? : 19 0 19
Condition0%0/2
$block_struct->{'slots'} || []
l!l
00
MC/DC0%0/1
$block_struct->{'slots'} || []
$block_struct->{'slots'}
Truth table0%0/2
A
A= $block_struct->{'slots'}
Aresult
11
00
352  
353 19 ▶ for my $op (@{ $block->ops || [] }) {
Condition50%1/2
$block->ops || []
l!l
190
MC/DC0%0/1
$block->ops || []
$block->ops
Truth table50%1/2
A
A= $block->ops
Aresult
11
00
354 25 ▶ my $slot_struct = defined $op->native_slot_index
Branch: 1 branch
BranchTrueFalseTotal
defined $op->native_slot_index ? : 25 0 25
355 ? $native_slots[ $op->native_slot_index ]
356 : undef;
357 my $schema_slot_index = ref($slot_struct) eq 'ARRAY'
358 ? $slot_struct->[3]
359 25 ▶ : ($slot_struct ? $slot_struct->{schema_slot_index} : undef);
Branch: 2 branches
BranchTrueFalseTotal
ref $slot_struct eq 'ARRAY' ? : 25 0 25
$slot_struct ? : 0 0 0
360 my $field_name = ref($slot_struct) eq 'ARRAY'
361 ? $slot_struct->[0]
362 25 ▶ : ($slot_struct ? $slot_struct->{field_name} : undef);
Branch: 2 branches
BranchTrueFalseTotal
ref $slot_struct eq 'ARRAY' ? : 25 0 25
$slot_struct ? : 0 0 0
363 my $result_name = ref($slot_struct) eq 'ARRAY'
364 ? $slot_struct->[1]
365 25 ▶ : ($slot_struct ? $slot_struct->{result_name} : undef);
Branch: 2 branches
BranchTrueFalseTotal
ref $slot_struct eq 'ARRAY' ? : 25 0 25
$slot_struct ? : 0 0 0
366 25 ▶ my $runtime_slot = defined $schema_slot_index
Branch: 1 branch
BranchTrueFalseTotal
defined $schema_slot_index ? : 25 0 25
367 ? $runtime_slots[ $schema_slot_index ]
368 : undef;
369  
370 25 ▶ $op->set_bound_slot($runtime_slot) if $runtime_slot;
Branch: 1 branch
BranchTrueFalseTotal
if $runtime_slot 25 0 25
371 25 ▶ $op->set_field_name($field_name) if defined $field_name;
Branch: 1 branch
BranchTrueFalseTotal
if defined $field_name 25 0 25
372 25 ▶ $op->set_result_name($result_name) if defined $result_name;
Branch: 1 branch
BranchTrueFalseTotal
if defined $result_name 25 0 25
373 25 ▶ $op->set_bound_slot($op->bound_slot || _bind_typename_slot($runtime_schema, $block, $op, $slot_struct));
Condition33%1/3
$op->bound_slot || _bind_typename_slot($runtime_schema, $block, $op, $slot_struct)
l!l&&r!l&&!r
2500
MC/DC0%0/2
$op->bound_slot || _bind_typename_slot($runtime_schema, $block, $op, $slot_struct)
$op->bound_slot _bind_typename_slot($runtime_schema, $block, $op, $slot_struct)
Truth table33%1/3
A || B
A= $op->bound_slotB= _bind_typename_slot($runtime_schema, $block, $op, $slot_struct)
ABresult
1X1
011
000
374  
375 25 ▶ if (defined $op->native_child_block_index) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $op->native_child_block_index) { } 10 15 25
376 10 my $child_block = $blocks[ $op->native_child_block_index ];
377 10 $op->set_bound_child_block($child_block);
378 10 ▶ $op->set_child_block_name($child_block ? $child_block->name : undef);
Branch: 1 branch
BranchTrueFalseTotal
$child_block ? : 10 0 10
379 } else {
380 15 $op->set_bound_child_block(undef);
381 15 $op->set_child_block_name(undef);
382 }
383  
384 my %abstract_children = map {
385 2 my $idx = $op->native_abstract_child_block_indexes->{$_};
386 2 ▶ ($_ => (defined $idx && $blocks[$idx] ? $blocks[$idx]->name : undef))
Branch: 1 branch
BranchTrueFalseTotal
defined $idx && $blocks[$idx] ? : 2 0 2
Condition33%1/3
defined $idx and $blocks[$idx]
!ll&&!rl&&r
002
MC/DC0%0/2
defined $idx and $blocks[$idx]
defined $idx $blocks[$idx]
Truth table33%1/3
A and B
A= defined $idxB= $blocks[$idx]
ABresult
0X0
100
111
387 25 ▶ } keys %{ $op->native_abstract_child_block_indexes || {} };
Condition50%1/2
$op->native_abstract_child_block_indexes || {}
l!l
250
MC/DC0%0/1
$op->native_abstract_child_block_indexes || {}
$op->native_abstract_child_block_indexes
Truth table50%1/2
A
A= $op->native_abstract_child_block_indexes
Aresult
11
00
388 25 $op->set_abstract_child_blocks(\%abstract_children);
389 $op->set_bound_abstract_child_blocks({
390 map {
391 2 my $idx = $op->native_abstract_child_block_indexes->{$_};
392 2 ▶ ($_ => (defined $idx ? $blocks[$idx] : undef))
Branch: 1 branch
BranchTrueFalseTotal
defined $idx ? : 2 0 2
393 25 ▶ } keys %{ $op->native_abstract_child_block_indexes || {} }
Condition50%1/2
$op->native_abstract_child_block_indexes || {}
l!l
250
MC/DC0%0/1
$op->native_abstract_child_block_indexes || {}
$op->native_abstract_child_block_indexes
Truth table50%1/2
A
A= $op->native_abstract_child_block_indexes
Aresult
11
00
394 });
395 }
396 }
397  
398 10 return $program;
399 }
400  
401 0 ▶sub _bind_typename_slot {
Subroutine _bind_typename_slot: not called CC=13 SCAR=52.0
402 0 my ($runtime_schema, $block, $op, $slot_struct) = @_;
403 0 ▶ return undef if ($op->field_name || q()) ne '__typename';
Branch: 1 branch
BranchTrueFalseTotal
if ($op->field_name || "") ne "__typename" 0 0 0
Condition0%0/2
$op->field_name || ''
l!l
00
MC/DC0%0/1
$op->field_name || ''
$op->field_name
Truth table0%0/2
A
A= $op->field_name
Aresult
11
00
404 my $return_type_name = ref($slot_struct) eq 'ARRAY'
405 ? $slot_struct->[2]
406 0 ▶ : ($slot_struct && $slot_struct->{return_type_name});
Branch: 1 branch
BranchTrueFalseTotal
ref $slot_struct eq 'ARRAY' ? : 0 0 0
Condition0%0/3
$slot_struct and $slot_struct->{"return_type_name"}
!ll&&!rl&&r
000
MC/DC0%0/2
$slot_struct and $slot_struct->{"return_type_name"}
$slot_struct $slot_struct->{"return_type_name"}
Truth table0%0/3
A and B
A= $slot_structB= $slot_struct->{"return_type_name"}
ABresult
0X0
100
111
407 my $return_type_kind_code = ref($slot_struct) eq 'ARRAY'
408 ? $slot_struct->[7]
409 0 ▶ : ($slot_struct && $slot_struct->{return_type_kind_code});
Branch: 1 branch
BranchTrueFalseTotal
ref $slot_struct eq 'ARRAY' ? : 0 0 0
Condition0%0/3
$slot_struct and $slot_struct->{"return_type_kind_code"}
!ll&&!rl&&r
000
MC/DC0%0/2
$slot_struct and $slot_struct->{"return_type_kind_code"}
$slot_struct $slot_struct->{"return_type_kind_code"}
Truth table0%0/3
A and B
A= $slot_structB= $slot_struct->{"return_type_kind_code"}
ABresult
0X0
100
111
410  
411 0 ▶ return GraphQL::Houtou::Runtime::Slot->new(
Branch: 2 branches
BranchTrueFalseTotal
defined $return_type_kind_code ? : 0 0 0
$op->has_directives || 0 ? : 0 0 0
Condition0%0/8
$block->type_name || ''
l!l
00
$op->result_name || '__typename'
l!l
00
$return_type_name || 'String'
l!l
00
$op->has_directives or 0
l!l
00
MC/DC0%0/1
$block->type_name || ''
$block->type_name
MC/DC0%0/1
$op->result_name || '__typename'
$op->result_name
MC/DC0%0/1
$return_type_name || 'String'
$return_type_name
MC/DC0%0/1
$op->has_directives or 0
$op->has_directives
Truth table0%0/2
A
A= $block->type_name
Aresult
11
00
Truth table0%0/2
A
A= $op->result_name
Aresult
11
00
Truth table0%0/2
A
A= $return_type_name
Aresult
11
00
Truth table0%0/2
A
A= $op->has_directives
Aresult
11
00
412 schema_slot_key => join(q(.), ($block->type_name || q()), '__typename'),
413 field_name => '__typename',
414 result_name => ($op->result_name || '__typename'),
415 return_type_name => ($return_type_name || 'String'),
416 return_type_kind_code => (defined $return_type_kind_code ? $return_type_kind_code : 1),
417 resolver_shape => 'DEFAULT',
418 resolver_mode => 'DEFAULT',
419 completion_family => 'GENERIC',
420 dispatch_family => 'GENERIC',
421 has_args => 0,
422 has_directives => (($op->has_directives || 0) ? 1 : 0),
423 );
424 }
425  
426 25 ▶sub _resolve_family_from_code {
Subroutine _resolve_family_from_code: called CC=3 SCAR=11.1
427 25 my ($code) = @_;
428 25 ▶ return 'RESOLVE_EXPLICIT' if ($code || 0) == 2;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 2 12 13 25
Condition50%1/2
$code || 0
l!l
250
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
429 13 return 'RESOLVE_DEFAULT';
430 }
431  
432 25 ▶sub _complete_family_from_code {
Subroutine _complete_family_from_code: called CC=7 SCAR=20.3
433 25 my ($code) = @_;
434 25 ▶ return 'COMPLETE_OBJECT' if ($code || 0) == 2;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 2 7 18 25
Condition50%1/2
$code || 0
l!l
250
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
435 18 ▶ return 'COMPLETE_LIST' if ($code || 0) == 3;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 3 0 18 18
Condition50%1/2
$code || 0
l!l
180
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
436 18 ▶ return 'COMPLETE_ABSTRACT' if ($code || 0) == 4;
Branch: 1 branch
BranchTrueFalseTotal
if ($code || 0) == 4 2 16 18
Condition50%1/2
$code || 0
l!l
180
MC/DC0%0/1
$code || 0
$code
Truth table50%1/2
A
A= $code
Aresult
11
00
437 16 return 'COMPLETE_GENERIC';
438 }
439  
440 46 1;
« blib/lib/GraphQL/Houtou/Role/Abstract.pm ↑ Summary blib/lib/GraphQL/Houtou/Runtime/VMOp.pm »