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

filter: Statementstmt 41.6% 15 / 36 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 50.0% 5 / 10 Podpod 0.0% 0 / 3 totaltotal 29.8% 20 / 67 CC 7 SCAR 18.6
CC
7
Cov
31%
new
12.0
_require_native_program
12.0
build_for_program
6.0
CRAP 6.4
« blib/lib/GraphQL/Houtou/Type/List.pm ↑ Summary blib/lib/GraphQL/Houtou/DataLoader.pm »
1 package GraphQL::Houtou::Runtime::ExecState;
2  
3 1 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use GraphQL::Houtou ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use GraphQL::Houtou::Runtime::InputCoercion ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
11 0 my ($class, %args) = @_;
12 0 GraphQL::Houtou::_bootstrap_xs();
13 return GraphQL::Houtou::XS::VM::exec_state_new_xs(
14 $class,
15 $args{runtime_schema},
16 $args{program},
17 $args{cursor},
18 $args{writer},
19 $args{context},
20 ($args{variables} || {}),
21 $args{root_value},
22 0 ▶ ($args{empty_args} || {}),
Condition0%0/4
$args{'variables'} || {}
l!l
00
$args{'empty_args'} || {}
l!l
00
MC/DC0%0/1
$args{'variables'} || {}
$args{'variables'}
MC/DC0%0/1
$args{'empty_args'} || {}
$args{'empty_args'}
Truth table0%0/2
A
A= $args{'variables'}
Aresult
11
00
Truth table0%0/2
A
A= $args{'empty_args'}
Aresult
11
00
23 );
24 }
25  
26 0 ▶sub build_for_program {
Subroutine build_for_program: not called CC=2 SCAR=17.9
Pod undocumented
27 0 my ($class, $runtime_schema, $program, %opts) = @_;
28 0 my $native_program = _require_native_program($program);
29 0 my $root_block_index = _root_block_index($native_program);
30 return $class->new(
31 runtime_schema => $runtime_schema,
32 program => $native_program,
33 cursor => GraphQL::Houtou::XS::VM::cursor_new_xs(
34 'GraphQL::Houtou::Runtime::Cursor',
35 undef,
36 $native_program,
37 $root_block_index,
38 0,
39 0,
40 undef,
41 undef,
42 ),
43 writer => GraphQL::Houtou::XS::VM::writer_new_xs('GraphQL::Houtou::Runtime::Writer'),
44 context => $opts{context},
45 variables => GraphQL::Houtou::Runtime::InputCoercion::prepare_variables(
46 $runtime_schema,
47 $native_program,
48 $opts{variables} || {},
49 ),
50 root_value => $opts{root_value},
51 0 ▶ );
Condition0%0/2
$opts{'variables'} || {}
l!l
00
MC/DC0%0/1
$opts{'variables'} || {}
$opts{'variables'}
Truth table0%0/2
A
A= $opts{'variables'}
Aresult
11
00
52 }
53  
54 0 ▶sub run_program {
Subroutine run_program: not called CC=1 SCAR=6.9
Pod undocumented
55 0 my ($class, $runtime_schema, $program, %opts) = @_;
56 0 my $native_program = _require_native_program($program);
57 0 my $state = $class->build_for_program(
58 $runtime_schema,
59 $native_program,
60 %opts,
61 );
62 0 GraphQL::Houtou::_bootstrap_xs();
63 0 return GraphQL::Houtou::XS::VM::exec_state_run_program_async_xs($state, $opts{root_value});
64 }
65  
66 0 ▶sub _require_native_program {
Subroutine _require_native_program: not called CC=3 SCAR=24.8
67 0 my ($program) = @_;
68 return $program
69 0 ▶ if ref($program) && eval { $program->isa('GraphQL::Houtou::Runtime::NativeProgram') };
Branch: 1 branch
BranchTrueFalseTotal
if ref $program and eval { do { $program->isa("GraphQL::Houtou::Runtime::NativeProgram") } } 0 0 0
Condition0%0/3
ref $program and eval { do { $program->isa("GraphQL::Houtou::Runtime::NativeProgram") } }
!ll&&!rl&&r
000
MC/DC0%0/2
ref $program and eval { do { $program->isa("GraphQL::Houtou::Runtime::NativeProgram") } }
ref $program eval { do { $program->isa("GraphQL::Houtou::Runtime::NativeProgram") } }
Truth table0%0/3
A and B
A= ref $programB= eval { do { $program->isa("GraphQL::Houtou::Runtime::NativeProgram") } }
ABresult
0X0
100
111
70 0 die "Active runtime paths expect a GraphQL::Houtou::Runtime::NativeProgram.\n";
71 }
72  
73 0 ▶sub _root_block_index {
Subroutine _root_block_index: not called CC=2 SCAR=17.9
74 0 my ($program) = @_;
75 0 my $native_program = _require_native_program($program);
76 0 GraphQL::Houtou::_bootstrap_xs();
77 0 my $index = GraphQL::Houtou::XS::VM::native_program_root_block_index_xs($native_program);
78 0 ▶ return defined $index ? $index : -1;
Branch: 1 branch
BranchTrueFalseTotal
defined $index ? : 0 0 0
79 }
80  
81 1 1;
« blib/lib/GraphQL/Houtou/Type/List.pm ↑ Summary blib/lib/GraphQL/Houtou/DataLoader.pm »