Condition Coverage

blib/lib/Mojolicious/Plugin/OpenAPI.pm
Criterion Covered Total %
condition 71 101 70.3


and 3 conditions

line !l l&&!r l&&r condition
72 58 70 1 $op_spec->{'operationId'} and $uniq{'o'}{$op_spec->{'operationId'}}++
73 14 113 1 $name and $uniq{'r'}{$name}++
75 14 4 109 not $op_spec->{'x-mojo-to'} and $name
105 4 375 0 $handler eq "openapi" and exists $c->stash->{'openapi'}
112 4 0 9 $handler eq "openapi" and $status eq '404' || $status eq '500'
131 56 3 0 $route and not $route->pattern->unparsed
176 0 0 0 not $h->content_type and $output->isa("Mojo::Asset::File")
226 111 1 13 @args and $args[0] =~ /#/u
231 0 0 5 not ref $arg and @args
247 20 2 137 $method_path_status->[0] && $self->validator->parameters_for_response($method_path_status)
255 0 2 20 ref $stash->{'openapi'} eq "HASH" and ref $stash->{'openapi'}{'errors'} eq "ARRAY"

or 2 conditions

line l !l condition
9 0 48 $ENV{'MOJO_OPENAPI_DEBUG'} || 0
38 0 59 $ENV{'MOJO_OPENAPI_LOG_LEVEL'} || $config->{'log_level'} || 'warn'
51 1 58 $config->{'default_response_name'} || 'DefaultResponse'
52 1 58 $config->{'default_response_codes'} || [400, 401, 404, 500, 501]
63 1 58 $config->{'op_spec_to_route'} || '_op_spec_to_route'
102 4 375 $args->{'handler'} || 'openapi'
111 9 4 $args->{'status'} || $c->stash('status') || '200'
144 4 55 $self->{'route_prefix'} //= ""
150 4 33 shift() // "for_current"
221 14 111 $op_spec->{'x-mojo-to'} // []
245 49 110 $args->{'status'} || $stash->{'status'} || 200
253 10 149 $stash->{'format'} ||= "json"
284 1 3 $params{$name}{'x-mojo-placeholder'} || ':'

or 3 conditions

line l !l&&r !l&&!r condition
19 58 3 0 $config->{'url'} || $config->{'spec'}
22 2 59 0 $config->{'version_from_class'} // ref $app
51 0 59 0 $default_response{'name'} ||= $config->{'default_response_name'} || 'DefaultResponse'
52 0 59 0 $default_response{'status'} ||= $config->{'default_response_codes'} || [400, 401, 404, 500, 501]
68 46 69 14 $op_spec->{'x-mojo-name'} || $op_spec->{'operationId'}
83 12 0 14 $name ||= $op_spec->{'operationId'}
105 0 150 229 $handler eq "openapi" and exists $c->stash->{'openapi'} or exists $args->{'openapi'}
112 5 4 0 $status eq '404' || $status eq '500'
140 2 2 55 $config->{'spec_route_name'} || $validator->get('/x-mojo-name')
154 0 1 36 ref $path or $path =~ m[^/]u
1 0 36 ref $path or $path =~ m[^/]u or not length $path
179 0 0 0 $type || $types->type('bin')
229 0 0 0 $constraints->{'format'} //= $config->{'format'}
263 20 0 0 $args->{'status'} ||= $stash->{'openapi'}{'status'}