STRling/Requests.pm

filter: Statementstmt 90.0% 18 / 20 Branchbran 43.7% 7 / 16 Conditioncond 50.0% 4 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 3 totaltotal 59.6% 34 / 57 CC 13 SCAR 24.5
CC
13
Cov
66%
source_compile_request
17.1
simply_builder_request
6.0
stdlib_helper
2.1
CRAP 11.5
« STRling/StrictJSON.pm ↑ Summary STRling.pm »
1 package STRling::Requests;
2  
3 1 ▶use 5.010;
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  
7 # STRling-public-arity: source_compile_request=1..2
8 1 ▶sub source_compile_request {
Subroutine source_compile_request: called CC=11 SCAR=28.4
Pod undocumented
9 1 my ($source, $options) = @_;
10 1 ▶ $options ||= {};
Condition50%1/2
$options ||= {}
l!l
01
MC/DC0%0/1
$options ||= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
11 1 ▶ my $specification = defined($options->{specification_version}) ? "$options->{specification_version}" : '1.0-draft.1';
Branch: 1 branch
BranchTrueFalseTotal
defined $options->{'specification_version'} ? : 0 1 1
12 1 ▶ my $frontend = defined($options->{frontend_id}) ? "$options->{frontend_id}" : 'strling.semantic';
Branch: 1 branch
BranchTrueFalseTotal
defined $options->{'frontend_id'} ? : 0 1 1
13 my $request = {
14 contract_version => '1.0.0',
15 specification_version => $specification,
16 input => {
17 kind => 'source',
18 document => {
19 contract_version => '1.0.0',
20 source_id => defined($options->{source_id}) ? "$options->{source_id}" : 'src:perl.adapter',
21 specification_version => $specification,
22 frontend => {
23 id => $frontend,
24 dialect_version => defined($options->{frontend_version}) ? "$options->{frontend_version}" : '1.0.0',
25 },
26 content => {
27 kind => 'inline', encoding => 'utf-8',
28 media_type => defined($options->{media_type}) ? "$options->{media_type}" : ($frontend eq 'strling.regex-compat' ? 'text/x-strling-regex-compat' : 'text/x-strling-semantic'),
29 text => "$source",
30 },
31 provenance => { kind => 'authored' },
32 },
33 },
34 requested_outputs => $options->{requested_outputs} || ['semantic', 'analysis'],
35 compiler_options => $options->{compiler_options} || {
36 1 ▶ partial_semantics => 'forbid',
Branch: 4 branches
BranchTrueFalseTotal
defined $options->{'source_id'} ? : 0 1 1
defined $options->{'frontend_version'} ? : 0 1 1
defined $options->{'media_type'} ? : 0 1 1
$frontend eq 'strling.regex-compat' ? : 0 1 1
Condition50%2/4
$options->{'requested_outputs'} || ['semantic', 'analysis']
l!l
01
$options->{'compiler_options'} || {'partial_semantics', 'forbid', 'diagnostic_policy', {'minimum_severity', 'hint'}}
l!l
01
MC/DC0%0/1
$options->{'requested_outputs'} || ['semantic', 'analysis']
$options->{'requested_outputs'}
MC/DC0%0/1
$options->{'compiler_options'} || {'partial_semantics', 'forbid', 'diagnostic_policy', {'minimum_severity', 'hint'}}
$options->{'compiler_options'}
Truth table50%1/2
A
A= $options->{'requested_outputs'}
Aresult
11
00
Truth table50%1/2
A
A= $options->{'compiler_options'}
Aresult
11
00
37 diagnostic_policy => { minimum_severity => 'hint' },
38 },
39 };
40 1 ▶ $request->{target_profile} = $options->{target_profile_reference} if exists $options->{target_profile_reference};
Branch: 1 branch
BranchTrueFalseTotal
if exists $options->{"target_profile_reference"} 0 1 1
41 1 return $request;
42 }
43  
44 # STRling-public-arity: stdlib_helper=2..3
45 2 ▶sub stdlib_helper {
Subroutine stdlib_helper: called CC=2 SCAR=7.2
Pod undocumented
46 2 my ($step_id, $helper_id, $parameters) = @_;
47 return {
48 2 ▶ step_id => "$step_id", operation => 'stdlib_helper',
Condition50%1/2
$parameters || {}
l!l
20
MC/DC0%0/1
$parameters || {}
$parameters
Truth table50%1/2
A
A= $parameters
Aresult
11
00
49 arguments => { helper_id => "$helper_id", parameters => $parameters || {} },
50 };
51 }
52  
53 # STRling-public-arity: simply_builder_request=2..3
54 0 ▶sub simply_builder_request {
Subroutine simply_builder_request: not called CC=2 SCAR=17.9
Pod undocumented
55 0 my ($steps, $root_step_id, $identity_namespace) = @_;
56 return {
57 0 ▶ protocol_version => '1.1.0', contract_version => '1.0.0',
Branch: 1 branch
BranchTrueFalseTotal
defined $identity_namespace ? : 0 0 0
58 specification_version => '1.0-draft.1',
59 identity_namespace => defined($identity_namespace) ? $identity_namespace : 'perl.adapter',
60 semantic_options => {
61 case_matching => 'sensitive', text_model => 'unicode_scalar_values',
62 builtin_character_domain => 'unicode', wildcard_line_terminators => 'exclude',
63 },
64 steps => $steps, root_step_id => "$root_step_id",
65 compile => {
66 requested_outputs => ['semantic', 'analysis'],
67 compiler_options => {
68 partial_semantics => 'forbid',
69 diagnostic_policy => { minimum_severity => 'hint' },
70 },
71 },
72 };
73 }
74  
75 1 1;
« STRling/StrictJSON.pm ↑ Summary STRling.pm »