Condition Coverage

blib/lib/OpenAPI/Modern.pm
Criterion Covered Total %
condition 403 484 83.2


and 3 conditions

line !l l&&!r l&&r condition
107 322 0 2 $$options{"request"} and $request != $$options{"request"}
163 357 472 2 $seen_q{"query"} and $seen_q{"querystring"}
207 144 139 2 defined $request->headers->content_length and $request->content->is_chunked
213 160 123 2 $request->body_size and not $request->headers->content_length
283 0 2 $request->body_size and not $request->headers->content_length and not $request->content->is_chunked
236 22 103 8 $request->method eq 'GET' || $request->method eq 'HEAD' and $request->headers->content_length // $request->body_size
242 0 34 0 builtin::blessed($e) and $e->isa("JSON::Schema::Modern::Result")
0 0 34 builtin::blessed($e) and $e->isa("JSON::Schema::Modern::Error")
260 37 37 4 $response->can('request') && $response->request
262 0 3 1 $request and $$options{"request"}
3 0 1 $request and $$options{"request"} and $request != $$options{"request"}
267 77 0 0 $$options{"response"} and $response != $$options{"response"}
280 21 0 56 exists $$options{"path_template"} and exists $$options{"method"}
304 2 4 2 $response->is_success and $$options{"method"} eq "CONNECT"
309 12 55 2 defined $response->headers->content_length and $response->content->is_chunked
315 23 35 11 $response->body_size and not $response->headers->content_length
58 6 5 $response->body_size and not $response->headers->content_length and not $response->content->is_chunked
357 8 6 48 exists $$response_obj{"content"} and $response->headers->content_length // $response->body_size
360 0 6 0 builtin::blessed($e) and $e->isa("JSON::Schema::Modern::Result")
0 0 6 builtin::blessed($e) and $e->isa("JSON::Schema::Modern::Error")
397 114 0 121 exists $$options{"uri"} and exists $$options{"method"}
41 5 68 $$options{"path_template"} and exists $$options{"method"}
402 11 0 25 $_ ne "string" and $_ ne "number"
403 532 33 1 exists $$options{"path_captures"} and CORE::any {$_ ne "integer" if $_ ne "string" and $_ ne "number";} map(get_type($_), values %{$$options{"path_captures"}})
416 325 0 1 exists $$options{"uri"} and $$options{"request"}->url ne $$options{"uri"}
421 323 0 2 exists $$options{"method"} and $$options{"request"}->method ne $$options{"method"}
426 119 0 2 builtin::blessed($$options{"uri"}) and $$options{"uri"}->isa("Mojo::URL")
460 7 4 1 !$$options{'uri'} && $$options{'method'} eq lc $$options{'method'} && exists $self->openapi_document->get($path_item_path)->{$$options{'method'}}
26 39 12 exists $$options{"method"} and $$options{"method"} ne $method
484 411 97 3 exists $$options{"path_template"} and not exists $$schema{"paths"}{$$options{"path_template"}}
488 97 0 411 not $$options{"path_template"} and $$options{"uri"}
502 368 16 11 exists $$options{"operation_id"} and !exists($$local_state{'operation'}{'operationId'}) || $$local_state{'operation'}{'operationId'} ne $$options{'operation_id'}
545 7 5 6 exists $$options{"operation_id"} and !exists($$state{'operation'}{'operationId'}) || $$state{'operation'}{'operationId'} ne $$options{'operation_id'}
574 4 0 1 exists $$options{'method'} && $$options{'method'} eq lc $$options{'method'} && exists $$state{'path_item'}{$$options{'method'}}
582 63 1 2 exists $$options{"operation_id"} and !exists($$state{'operation'}{'operationId'}) || $$state{'operation'}{'operationId'} ne $$options{'operation_id'}
598 421 22 8 exists $$options{"path_captures"} and not is_equal([sort(keys %{$$options{"path_captures"}})], [sort(@path_capture_names)])
648 8 21 2 $entity_type and $this_entity ne $entity_type
654 5 2 22 defined($ref = $$schema{"\$ref"}) and not elem($this_entity, ["schema", "callbacks"])
658 21 0 1 elem($this_entity, ["response", "example", "path-item"]) and exists $$schema{"summary"}
21 0 1 elem($this_entity, ["response", "example", "path-item"]) and exists $$schema{"summary"} and not exists $$parent_obj{"summary"}
660 7 14 1 exists $$schema{"description"} and not exists $$parent_obj{"description"}
739 389 1 36 $servers and @$servers
861 291 12 62 $$state{"defaults"} and exists $$obj{"schema"}
303 26 36 $$state{"defaults"} and exists $$obj{"schema"} and ref $$obj{"schema"} eq "HASH"
38 0 36 $$state{"defaults"} and exists $$obj{"schema"} and ref $$obj{"schema"} eq "HASH" and exists $$obj{"schema"}{"default"}
871 29 795 123 exists $$obj{"schema"} and not $self->_evaluate_subschema($data_ref, $$obj{"schema"}, {%$state, "depth", $$state{"depth"} + 1, "keyword_path", $$state{"keyword_path"} . '/schema'})
918 0 0 454 builtin::blessed($params) and $params->isa("Mojo::Parameters")
923 46 0 2 $$param_obj{"allowEmptyValue"} and not length $data
960 8 4 3 $style eq 'form' && $explode && @types != 6 && elem('object', \@types)
973 0 0 399 builtin::blessed($headers) and $headers->isa("Mojo::Headers")
1030 0 0 219 builtin::blessed($headers) and $headers->isa("Mojo::Headers")
1058 6 268 7 defined $our $_[1] && !is_cookie_value($our $_[1])
1087 4 4 87 $explode and @types != 6
8 69 18 $explode and @types != 6 and elem("object", \@types)
1125 2 3 2 $style eq 'form' && $explode && @types != 6 && elem('object', \@types)
1134 0 0 43 builtin::blessed($params) and $params->isa("Mojo::Parameters")
1145 0 10 1 exists $$params{"pairs"} and @{$$params{"pairs"}}
1172 515 438 0 ref $data and ref $data ne "Mojo::Parameters"
1185 387 5 68 $data eq "" and $style ne 'simple' || @types != 6
1208 277 120 1 length $prefix and not $data =~ s/^$prefix//u
1212 120 127 150 $style eq 'simple' && $strip_internal_ws
1230 28 281 88 @types != 6 and $explode
309 36 52 @types != 6 and $explode and ($style eq 'simple' || $style eq 'label') && elem('object', \@types) || $style eq 'matrix' && elem(['object', 'array'], \@types)
1250 40 136 13 defined $val and not length $val
1277 300 4 39 $style eq "matrix" and !$explode || elem(['string', 'number', 'boolean', 'null'], \@types)
4 39 0 $style eq "matrix" and !$explode || elem(['string', 'number', 'boolean', 'null'], \@types) and !($data =~ s/^([^{}=]+)(?:=(?=.)|$)//u) || uri_decode($1) ne $name
1293 28 169 144 @types != 6 and elem(["array", "object"], \@types)
1296 34 51 59 not $explode and elem("object", \@types)
1305 14 40 41 elem("array", \@types) and elem($style, ['simple', 'label']) || $style eq 'matrix' && !$explode
1329 72 33 208 $explode and @types != 6
1350 167 1 9 $allowEmptyValue and not length $data
1352 48 84 36 $in ne "cookie" and not $explode
132 1 35 $in ne "cookie" and not $explode and @types != 6
85 0 35 $in ne "cookie" and not $explode and @types != 6 and elem(["array", "object"], \@types)
1357 13 7 15 not @values % 2 and elem("object", \@types)
1383 72 0 8 $allowEmptyValue and not length $data
1399 34 14 24 not @values % 2 and elem("object", \@types)
1417 16 14 0 not $explode and $self->openapi_document->oas_version < "3.2"
1430 25 45 1 $1 eq $name and !$allowEmptyValue || length $$pair[1]
1454 0 2 51 $explode and @types != 6
1577 278 6 2 match_media_type($content_type, ["application/x-www-form-urlencoded", "multipart/*"]) and my $keyword = &first(sub { exists $$content_obj{$media_type}{$_}; } , "encoding", "prefixEncoding", "itemEncoding")
1587 383 16 0 $is_exception and not @{$$state{"errors"}}
1649 1071 0 4 exists $$schema{$id_keyword} and not $$schema{$id_keyword} =~ /^#/u
1675 1062 0 1 defined(my $ref = $$schema{"\$dynamicRef"}) and not $$state{"specification_version"} =~ /^draft(?:[467]|2019-09)\z/u
1690 927 4 2 $$state{'vocabularies'}[0] =~ /::OpenAPI_3_0\z/u && $$schema{'nullable'}
1747 213 0 1 defined(my $ref = $$schema{"\$dynamicRef"}) and not $$state{"specification_version"} =~ /^draft(?:[467]|2019-09)\z/u
1774 575 11 0 exists $$schema{"patternProperties"} and $property =~ /$$schema{"patternProperties"}/u
1778 555 12 19 exists $$schema{"additionalProperties"} and @types == 0
1829 196 0 1 defined(my $ref = $$schema{"\$dynamicRef"}) and not $$state{"specification_version"} =~ /^draft(?:[467]|2019-09)\z/u
1856 460 12 80 exists $$schema{$array_items} and $idx <= $$schema{$array_items}->$#*
1860 473 17 62 exists $$schema{$schema_items} and @types == 0
1900 2 0 4 $location[-3] eq 'header' && $location[-2] eq 'Cookie'
1937 484 0 62 $$state{"defaults"} and $result->defaults

or 2 conditions

line l !l condition
147 251 355 ($section eq "operation" ? $operation : $path_item)->{"parameters"} // []
159 444 391 $$request_parameters_processed{$$param_obj{"in"}} // {}
22 813 ($$request_parameters_processed{$$param_obj{"in"}} // {})->{$fc_name} // ""
166 45 784 $seen_q{"querystring"} // 0
200 144 2 $$request_parameters_processed{"path"} // {}
339 30 32 $$response_obj{"headers"} // {}
379 399 171 $$state{"data_path"} //= ""
387 0 570 $$options{"errors"} //= []
388 0 570 $$state{"annotations"} //= []
568 4 0 $$state{"path_item"}{"additionalOperations"} // {}
721 5 1 $$local_state{"path_item"}{"additionalOperations"} // {}
771 416 4 $normalized_server_url->host // ""
798 18 0 $$server{"variables"} // {}
18 0 ($$server{"variables"} // {})->{$name} // {}
826 1370 91 $$param_obj{"in"} // "header"
899 342 0 $data // ""
912 193 98 $$param_obj{"style"} // "simple"
145 146 $$param_obj{"explode"} // bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' )
939 184 160 $$param_obj{"style"} // "form"
948 36 308 $$param_obj{"allowEmptyValue"} // bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' )
1024 44 127 $$header_obj{"style"} // "simple"
52 119 $$header_obj{"explode"} // bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' )
1066 18 2 (grep(($our $_[0] eq $$param_obj{"name"}), @pairs))[-1] // []
1079 107 42 $$param_obj{"style"} // "form"
1080 46 103 $$param_obj{"explode"} // bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' )
1102 62 0 $data[-1][1] // ""
1254 184 5 $key // ""
149 40 $val // ""
1473 28 3 $every_param[-1] // []
1598 158 0 $$state{"annotations"} // []
1643 1329 81 $$schema_info{"document"}{"_type_in_schema"} //= {}
1734 18 196 $$state{"_level"} //= 0
1770 120 466 $$schema{"properties"} // {}
1816 26 171 $$state{"_level"} //= 0
1916 70 476 $uri->fragment // ""

or 3 conditions

line l !l&&r !l&&!r condition
116 0 322 0 $$options{"request"} //= $request
236 107 4 22 $request->method eq 'GET' || $request->method eq 'HEAD'
8 0 103 $request->headers->content_length // $request->body_size
263 0 3 0 $$options{"request"} //= $request
298 2 2 4 $response->is_info or $response->code == 204
357 43 11 0 $response->headers->content_length // $response->body_size
390 2 3 565 $DEBUG or $self->debug
397 335 121 114 $$options{"request"} or exists $$options{"uri"} and exists $$options{"method"}
121 68 46 $$options{"request"} or exists $$options{"uri"} and exists $$options{"method"} or $$options{"path_template"} and exists $$options{"method"}
68 42 4 $$options{"request"} or exists $$options{"uri"} and exists $$options{"method"} or $$options{"path_template"} and exists $$options{"method"} or exists $$options{"operation_id"}
446 68 1 8 $parts[-2] ne 'additionalOperations' || $self->openapi_document->get_entity_at_location(jsonp(@parts[0 .. $#parts - 1])) eq 'path-item'
464 16 22 27 $$options{"path_template"} or $$options{"uri"}
502 8 9 10 !exists($$local_state{'operation'}{'operationId'}) || $$local_state{'operation'}{'operationId'} ne $$options{'operation_id'}
545 3 5 3 !exists($$state{'operation'}{'operationId'}) || $$state{'operation'}{'operationId'} ne $$options{'operation_id'}
582 2 1 0 !exists($$state{'operation'}{'operationId'}) || $$state{'operation'}{'operationId'} ne $$options{'operation_id'}
590 29 422 0 $$state{"initial_schema_uri"}->fragment // $$state{"keyword_path"}
651 21 8 0 $entity_type //= $this_entity
827 1370 91 0 $$param_obj{"name"} // $args{"name"}
923 62 2 46 not defined $data or $$param_obj{"allowEmptyValue"} and not length $data
940 106 134 104 $$param_obj{"explode"} // ($style eq "form" ? bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ) : bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ))
1172 0 0 953 not defined $data or ref $data and ref $data ne "Mojo::Parameters"
1181 327 69 554 $style eq "simple" or $style eq "matrix"
396 64 490 $style eq "simple" or $style eq "matrix" or $style eq "label"
47 47 83 $style eq "spaceDelimited" or $style eq "pipeDelimited"
1185 13 55 5 $style ne 'simple' || @types != 6
1230 43 33 12 ($style eq 'simple' || $style eq 'label') && elem('object', \@types) || $style eq 'matrix' && elem(['object', 'array'], \@types)
1260 0 1 27 not defined $our $_[0] or $our $_[0] ne $name
1277 39 0 4 !$explode || elem(['string', 'number', 'boolean', 'null'], \@types)
2 0 37 !($data =~ s/^([^{}=]+)(?:=(?=.)|$)//u) || uri_decode($1) ne $name
1305 69 9 3 elem($style, ['simple', 'label']) || $style eq 'matrix' && !$explode
1314 28 160 26 @types == 6 or coerce_primitive(\$data, \@types)
1350 58 60 117 not defined $data or $allowEmptyValue and not length $data
1369 24 102 9 @types == 6 or coerce_primitive(\$data, \@types)
1383 4 58 22 not defined $data or $allowEmptyValue and not length $data
1430 37 1 8 !$allowEmptyValue || length $$pair[1]
1476 2 26 0 @types == 6 or coerce_primitive(\$data, \@types)
1567 16 2 6 $$media_type_obj{"schema"} // ()
2 14 8 $$media_type_obj{"itemSchema"} // ()
6 10 14 $media_type eq "*/*" or CORE::all {ref $_ eq "HASH" ? !keys(%$_) : $_;} $$media_type_obj{"schema"} // (), $$media_type_obj{"itemSchema"} // ()
1792 161 490 0 $our $_{$property} // ()
1793 161 54 0 $our $_{$property} // ()
1874 219 420 0 $our $_[$idx] // ()
1875 219 69 0 $our $_[$idx] // ()
1948 0 0 8 $request->isa("Plack::Request") or $request->isa("Catalyst::Request")
1988 0 0 1 $response->isa("Plack::Response") or $response->isa("Dancer2::Core::Response")