« blib/lib/GraphQL/Houtou/Validation/NodeLimit.pm
↑ Summary
blib/lib/GraphQL/Houtou/Type/InputObject.pm »
| 1 | package GraphQL::Houtou::Runtime::VMProgram; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | 62 | ▶ | use Scalar::Util qw(refaddr); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 62 | ▶ | use GraphQL::Houtou (); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 62 | ▶ | use constant { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 62 | VERSION_SLOT => 0, | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | OPERATION_TYPE_SLOT => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | OPERATION_NAME_SLOT => 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | VARIABLE_DEFS_SLOT => 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | BLOCKS_SLOT => 4, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | ROOT_BLOCK_SLOT => 5, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | BLOCK_MAP_SLOT => 6, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | DISPATCH_BOUND_SLOT => 7, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | NATIVE_COMPACT_STRUCT_SLOT => 8, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | ROOT_BLOCK_INDEX_SLOT => 9, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | ARGS_PAYLOADS_SLOT => 10, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | DIRECTIVES_PAYLOADS_SLOT => 11, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | ABSTRACT_CHILD_MAPS_SLOT => 12, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 62 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | package GraphQL::Houtou::Runtime::VMProgram::PayloadCatalog; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 62 | ▶ | use 5.014; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 62 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 62 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 11 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 11 | my ($class, %args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 11 | ▶ | my $args_payloads = [ map { GraphQL::Houtou::Runtime::VMProgram::_clone_value($_) } @{ $args{args_payloads} || [] } ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args{'args_payloads'} || []
MC/DC0%0/1
$args{'args_payloads'} || []
$args{'args_payloads'}
Truth table50%1/2
A
A= $args{'args_payloads'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 11 | ▶ | my $directives_payloads = [ map { GraphQL::Houtou::Runtime::VMProgram::_clone_value($_) } @{ $args{directives_payloads} || [] } ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args{'directives_payloads'} || []
MC/DC0%0/1
$args{'directives_payloads'} || []
$args{'directives_payloads'}
Truth table50%1/2
A
A= $args{'directives_payloads'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | my %args_index = map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 11 | (_canonical_key($args_payloads->[$_]) => $_) | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } 0 .. $#$args_payloads; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | my %directives_index = map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 11 | (_canonical_key($directives_payloads->[$_]) => $_) | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } 0 .. $#$directives_payloads; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 11 | return bless { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | args_payloads => $args_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | directives_payloads => $directives_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | args_index => \%args_index, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | directives_index => \%directives_index, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 11 | ▶ | sub args_payloads { return $_[0]{args_payloads} } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
args_payloads: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 11 | ▶ | sub directives_payloads { return $_[0]{directives_payloads} } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
directives_payloads: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 6 | ▶ | sub intern_args_payload { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
intern_args_payload: called CC=3 SCAR=15.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 6 | my ($self, $payload) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 6 | ▶ | return undef if !_payload_present($payload); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 6 | my $key = _canonical_key($payload); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 6 | ▶ | return $self->{args_index}{$key} if exists $self->{args_index}{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | my $index = @{ $self->{args_payloads} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | push @{ $self->{args_payloads} }, GraphQL::Houtou::Runtime::VMProgram::_clone_value($payload); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | $self->{args_index}{$key} = $index; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | return $index; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 1 | ▶ | sub intern_directives_payload { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
intern_directives_payload: called CC=3 SCAR=15.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | ▶ | return undef if !_payload_present($payload); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 1 | my $key = _canonical_key($payload); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1 | ▶ | return $self->{directives_index}{$key} if exists $self->{directives_index}{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | my $index = @{ $self->{directives_payloads} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | push @{ $self->{directives_payloads} }, GraphQL::Houtou::Runtime::VMProgram::_clone_value($payload); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | $self->{directives_index}{$key} = $index; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | return $index; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 85 | ▶ | sub _payload_present { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_payload_present: called CC=7 SCAR=20.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 85 | my ($value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 85 | ▶ | return 0 if !defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 14 | my $ref = ref($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 14 | ▶ | return 1 if !$ref; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 14 | ▶ | return scalar(@$value) ? 1 : 0 if $ref eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 12 | ▶ | return scalar(keys %$value) ? 1 : 0 if $ref eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 28 | ▶ | sub _canonical_key { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_canonical_key: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 28 | my ($value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 28 | my $ref = ref($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 28 | ▶ | return '!undef' if !defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 28 | ▶ | return "S:$value" if !$ref; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 23 | ▶ | return 'A:[' . join(',', map { _canonical_key($_) } @$value) . ']' if $ref eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 21 | ▶ | return 'H:{' . join(',', map { $_ . '=>' . _canonical_key($value->{$_}) } sort keys %$value) . '}' if $ref eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 8 | return "$ref:$value"; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 62 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=17 SCAR=29.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 11 | my ($class, %args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 11 | my $root_block = $args{root_block}; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 11 | ▶ | my @blocks = @{ $args{blocks} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args{'blocks'} || []
MC/DC0%0/1
$args{'blocks'} || []
$args{'blocks'}
Truth table50%1/2
A
A= $args{'blocks'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 11 | ▶ | my %block_map = map { defined $_->name ? ($_->name => $_) : () } @blocks; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 11 | ▶ | $block_map{ $root_block->name } = $root_block if $root_block && defined $root_block->name; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$root_block and defined $root_block->name
MC/DC50%1/2
$root_block and defined $root_block->name
$root_block
defined $root_block->name
Truth table66%2/3
A and B
A= $root_blockB= defined $root_block->name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | my $self = bless [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | $args{version} || 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | $args{operation_type} || 'query', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | $args{operation_name}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | $args{variable_defs} || {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | \@blocks, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | $root_block, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | \%block_map, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | $args{args_payloads} || [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 11 | ▶ | $args{directives_payloads} || [], | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition80%8/10
$args{'version'} || 1
$args{'operation_type'} || 'query'
$args{'variable_defs'} || {}
$args{'args_payloads'} || []
$args{'directives_payloads'} || []
MC/DC100%1/1
$args{'version'} || 1
$args{'version'}
MC/DC0%0/1
$args{'operation_type'} || 'query'
$args{'operation_type'}
MC/DC0%0/1
$args{'variable_defs'} || {}
$args{'variable_defs'}
MC/DC100%1/1
$args{'args_payloads'} || []
$args{'args_payloads'}
MC/DC100%1/1
$args{'directives_payloads'} || []
$args{'directives_payloads'}
Truth table100%2/2
A
A= $args{'version'}
Truth table50%1/2
A
A= $args{'operation_type'}
Truth table50%1/2
A
A= $args{'variable_defs'}
Truth table100%2/2
A
A= $args{'args_payloads'}
Truth table100%2/2
A
A= $args{'directives_payloads'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | ], $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 11 | ▶ | for my $block (@blocks, ($root_block || ())) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$root_block || ()
MC/DC0%0/2
$root_block || ()
$root_block
()
Truth table33%1/3
A || B
A= $root_blockB= ()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 31 | ▶ | next if !$block; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 31 | ▶ | my $owner = $block->can('program') ? $block->program : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 31 | ▶ | next if $owner && refaddr($owner) == refaddr($self); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$owner and builtin::refaddr($owner) == builtin::refaddr($self)
MC/DC50%1/2
$owner and builtin::refaddr($owner) == builtin::refaddr($self)
$owner
builtin::refaddr($owner) == builtin::refaddr($self)
Truth table66%2/3
A and B
A= $ownerB= builtin::refaddr($owner) == builtin::refaddr($self)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 20 | ▶ | $block->set_program($self) if $block->can('set_program'); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 11 | _canonicalize_catalog_backed_payloads($self); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 11 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | sub version { return $_[0][VERSION_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
version: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 3 | ▶ | sub operation_type { return $_[0][OPERATION_TYPE_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
operation_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | sub operation_name { return $_[0][OPERATION_NAME_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
operation_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 1 | ▶ | sub variable_defs { return $_[0][VARIABLE_DEFS_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
variable_defs: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 25 | ▶ | sub blocks { return $_[0][BLOCKS_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
blocks: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 29 | ▶ | sub root_block { return $_[0][ROOT_BLOCK_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
root_block: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 1 | ▶ | sub root_block_index { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
root_block_index: called CC=4 SCAR=14.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 1 | ▶ | return $self->[ROOT_BLOCK_INDEX_SLOT] if defined $self->[ROOT_BLOCK_INDEX_SLOT]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 1 | ▶ | my @blocks = @{ $self->blocks || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->blocks || []
MC/DC0%0/1
$self->blocks || []
$self->blocks
Truth table50%1/2
A
A= $self->blocks
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 1 | my %block_index = map { ($blocks[$_]->name => $_) } 0 .. $#blocks; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | return $self->[ROOT_BLOCK_INDEX_SLOT] = | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 1 | ▶ | ($self->root_block ? $block_index{ $self->root_block->name } : undef); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | sub dispatch_bound { return $_[0][DISPATCH_BOUND_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dispatch_bound: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 25 | ▶ | sub args_payloads { return $_[0][ARGS_PAYLOADS_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
args_payloads: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 19 | ▶ | sub directives_payloads { return $_[0][DIRECTIVES_PAYLOADS_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
directives_payloads: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | sub abstract_child_maps { return $_[0][ABSTRACT_CHILD_MAPS_SLOT] } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
abstract_child_maps: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | ▶ | sub set_variable_defs { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_variable_defs: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | $_[0][VARIABLE_DEFS_SLOT] = $_[1] || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$_[1] || {}
MC/DC0%0/1
$_[1] || {}
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | $_[0][NATIVE_COMPACT_STRUCT_SLOT] = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | $_[0][ROOT_BLOCK_INDEX_SLOT] = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | return $_[0][VARIABLE_DEFS_SLOT]; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | sub set_dispatch_bound { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_dispatch_bound: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | $_[0][DISPATCH_BOUND_SLOT] = $_[1] ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | $_[0][NATIVE_COMPACT_STRUCT_SLOT] = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | $_[0][ROOT_BLOCK_INDEX_SLOT] = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | return $_[0][DISPATCH_BOUND_SLOT]; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 4 | ▶ | sub block_by_name { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
block_by_name: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 4 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 4 | ▶ | return if !defined $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 4 | return $self->[BLOCK_MAP_SLOT]{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | sub to_struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_struct: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | version => $self->version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | operation_type => $self->operation_type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | operation_name => $self->operation_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | variable_defs => { %{ $self->variable_defs || {} } }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->variable_defs || {}
MC/DC0%0/1
$self->variable_defs || {}
$self->variable_defs
Truth table0%0/2
A
A= $self->variable_defs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | args_payloads => [ map { _clone_value($_) } @{ $self->args_payloads || [] } ], | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->args_payloads || []
MC/DC0%0/1
$self->args_payloads || []
$self->args_payloads
Truth table0%0/2
A
A= $self->args_payloads
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | directives_payloads => [ map { _clone_value($_) } @{ $self->directives_payloads || [] } ], | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$self->directives_payloads || []
MC/DC0%0/1
$self->directives_payloads || []
$self->directives_payloads
Truth table0%0/2
A
A= $self->directives_payloads
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | root_block => $self->root_block ? $self->root_block->name : undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | blocks => [ map { $_->to_struct } @{ $self->blocks || [] } ], | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->blocks || []
MC/DC0%0/1
$self->blocks || []
$self->blocks
Truth table0%0/2
A
A= $self->blocks
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | sub to_native_struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_native_struct: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | my @blocks = @{ $self->blocks || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->blocks || []
MC/DC0%0/1
$self->blocks || []
$self->blocks
Truth table0%0/2
A
A= $self->blocks
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | my %block_index = map { ($blocks[$_]->name => $_) } 0 .. $#blocks; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | my $payload_catalog = GraphQL::Houtou::Runtime::VMProgram::PayloadCatalog->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | args_payloads => $self->args_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | directives_payloads => $self->directives_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | version => $self->version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | operation_type => $self->operation_type, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | operation_type_code => _operation_type_code($self->operation_type), | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | operation_name => $self->operation_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | variable_defs => { %{ $self->variable_defs || {} } }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->variable_defs || {}
MC/DC0%0/1
$self->variable_defs || {}
$self->variable_defs
Truth table0%0/2
A
A= $self->variable_defs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | args_payloads => $payload_catalog->args_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | directives_payloads => $payload_catalog->directives_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | root_block_index => $self->root_block_index, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | blocks => [ map { $_->to_native_struct(\%block_index, $payload_catalog) } @blocks ], | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | sub to_native_compact_struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_native_compact_struct: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | return $self->[NATIVE_COMPACT_STRUCT_SLOT] if $self->[NATIVE_COMPACT_STRUCT_SLOT]; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | my @blocks = @{ $self->blocks || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->blocks || []
MC/DC0%0/1
$self->blocks || []
$self->blocks
Truth table0%0/2
A
A= $self->blocks
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | my %block_index = map { ($blocks[$_]->name => $_) } 0 .. $#blocks; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | my $payload_catalog = GraphQL::Houtou::Runtime::VMProgram::PayloadCatalog->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | args_payloads => $self->args_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | directives_payloads => $self->directives_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | return $self->[NATIVE_COMPACT_STRUCT_SLOT] = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | version => $self->version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | operation_type_code => _operation_type_code($self->operation_type), | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | operation_name => $self->operation_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | variable_defs => { %{ $self->variable_defs || {} } }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->variable_defs || {}
MC/DC0%0/1
$self->variable_defs || {}
$self->variable_defs
Truth table0%0/2
A
A= $self->variable_defs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | args_payloads_compact => $payload_catalog->args_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | directives_payloads_compact => $payload_catalog->directives_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | root_block_index => $self->root_block_index, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | blocks_compact => [ map { $_->to_native_compact_struct(\%block_index, $payload_catalog) } @blocks ], | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | sub _operation_type_code { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_operation_type_code: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | my ($type) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | return 2 if ($type || q()) eq 'mutation'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$type || ''
MC/DC0%0/1
$type || ''
$type
Truth table0%0/2
A
A= $type
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | return 3 if ($type || q()) eq 'subscription'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$type || ''
MC/DC0%0/1
$type || ''
$type
Truth table0%0/2
A
A= $type
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 11 | ▶ | sub _clone_value { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_clone_value: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 11 | my ($value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 11 | my $ref = ref($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 11 | ▶ | return $value if !$ref; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 9 | ▶ | return [ map { _clone_value($_) } @$value ] if $ref eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 8 | ▶ | return { map { $_ => _clone_value($value->{$_}) } keys %$value } if $ref eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 3 | return $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 11 | ▶ | sub _canonicalize_catalog_backed_payloads { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_canonicalize_catalog_backed_payloads: called CC=11 SCAR=24.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 11 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 11 | my $catalog = GraphQL::Houtou::Runtime::VMProgram::PayloadCatalog->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | args_payloads => $self->args_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | directives_payloads => $self->directives_payloads, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 11 | ▶ | for my $block (@{ $self->blocks || [] }, ($self->root_block || ())) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition40%2/5
$self->blocks || []
$self->root_block || ()
MC/DC0%0/1
$self->blocks || []
$self->blocks
MC/DC0%0/2
$self->root_block || ()
$self->root_block
()
Truth table50%1/2
A
A= $self->blocks
Truth table33%1/3
A || B
A= $self->root_blockB= ()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 31 | ▶ | next if !$block; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 31 | ▶ | $block->set_program($self) if $block->can('set_program'); | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 31 | ▶ | for my $op (@{ $block->ops || [] }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$block->ops || []
MC/DC0%0/1
$block->ops || []
$block->ops
Truth table50%1/2
A
A= $block->ops
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 39 | ▶ | next if !$op; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 39 | my $args_payload = $op->args_payload; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 39 | ▶ | if (GraphQL::Houtou::Runtime::VMProgram::PayloadCatalog::_payload_present($args_payload)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 6 | my $index = $catalog->intern_args_payload($args_payload); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 6 | $op->set_args_payload_index($index); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 6 | $op->set_args_payload(undef); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 39 | my $directives_payload = $op->directives_payload; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 39 | ▶ | if (GraphQL::Houtou::Runtime::VMProgram::PayloadCatalog::_payload_present($directives_payload)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 1 | my $index = $catalog->intern_directives_payload($directives_payload); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 1 | $op->set_directives_payload_index($index); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 1 | $op->set_directives_payload(undef); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 11 | $self->[ARGS_PAYLOADS_SLOT] = $catalog->args_payloads; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 11 | $self->[DIRECTIVES_PAYLOADS_SLOT] = $catalog->directives_payloads; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 11 | $self->[ABSTRACT_CHILD_MAPS_SLOT] = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 11 | $self->[NATIVE_COMPACT_STRUCT_SLOT] = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 62 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||