Branch Coverage

blib/lib/Dancer2/Plugin/Swagger2.pm
Criterion Covered Total %
branch 56 102 54.9


line true false branch
26 0 2 unless my $url = $args{'url'}
30 0 2 exists $conf->{'create_options_route'} ? :
0 2 exists $args{'create_options_route'} ? :
34 0 2 exists $conf->{'validate_spec'} ? :
0 2 exists $args{'validate_spec'} ? :
38 0 2 exists $conf->{'validate_requests'} ? :
0 2 exists $args{'validate_requests'} ? :
42 0 2 exists $conf->{'validate_responses'} ? :
0 2 exists $args{'validate_responses'} ? :
47 0 0 if ($validate_spec or $validate_requests or $validate_responses)
48 0 2 if (my(@errors) = $spec->validate)
49 0 0 if ($validate_spec) { }
65 2 2 if $basePath
73 0 4 if ($create_options_route)
88 0 4 unless my $coderef = &$controller_factory($method_spec, $http_method, $path, $dsl, $conf, \%args)
92 0 4 if DEBUG()
97 0 4 if $http_method eq 'delete'
103 7 0 if ($validate_requests)
107 1 6 if (@errors)
108 0 1 if DEBUG()
116 5 0 if ($validate_responses)
121 1 4 if (@errors)
122 0 1 if DEBUG()
149 0 8 if ($in eq 'body') { }
159 0 8 if ($in eq 'header') { }
8 0 elsif ($in eq 'query') { }
0 0 elsif ($in eq 'path') { }
0 0 elsif ($in eq 'formData') { }
174 1 7 if (@values == 0 and $required) { }
1 6 elsif (@values > 1) { }
175 1 0 if $required
187 3 3 if ($type and defined($value //= $parameter_spec->{'default'}))
188 0 3 if ($type eq 'integer' || $type eq 'number' and $value =~ /^-?\d/) { }
0 3 elsif ($type eq 'boolean') { }
192 0 0 !$value || $value eq 'false' ? :
196 3 3 defined $value ? :
199 0 6 if $required
216 8 0 if (my $response_spec = $responses->{$status} || $responses->{'default'}) { }
223 0 2 if ($header_spec->{'type'} eq 'array') { }
228 0 2 if (@values == 0) { }
0 2 elsif (@values > 1) { }
243 5 3 if (my $schema = $response_spec->{'schema'})
268 2 2 if ($method =~ s/^(.+):://)
274 0 4 if ($namespace) { }
275 0 0 if ($module) { }
279 2 2 if ($module) { }
293 6 0 unless (eval { do { &use_module($controller); 1 } })
294 6 0 if ($@ and $@ =~ /^Can't locate /) { }
295 0 6 if DEBUG()
305 4 2 if (my $cb = $controller->can($method)) { }
309 0 2 if DEBUG()