Branch Coverage: lib/OpenAPI.pm

# Branch Coverage

File: | lib/OpenAPI.pm
Coverage: | 76.8%

line | % | coverage | branch
--- | --- | --- | ---
84 | 50 | T | F | if (not $Importer)
101 | 50 | T | F | if ($db_state and $db_state =~ /^(?:08|57)/)
116 | 100 | T | F | if ($charset =~ /^guess(?:ing)?$/i)
128 | 100 | T | F | if (ref $decoder)
137 | 50 | T | F | if (not $charset)
149 | 100 | T | F | if (not $offset =~ /^\d+$/)
156 | 100 | T | F | if (not defined $limit)
159 | 100 | T | F | if (not defined $limit) { }
163 | 100 | T | F | if (not $limit =~ /^\d+$/)
166 | 50 | T | F | if ($limit > $MAX_SELECT_LIMIT)
184 | 100 | T | F | if ($url =~ s/$Ext$//) { }
192 | 100 | T | F | if ($http_meth eq 'POST') { }
| 100 | T | F | elsif ($http_meth eq 'PUT') { }
197 | 50 | T | F | if (not defined $req_data) { }
198 | 0 | T | F | unless $req_data = $cgi->param('data')
201 | 50 | T | F | if (length $req_data > $POST_LEN_LIMIT)
209 | 50 | T | F | if (not defined $req_data) { }
210 | 0 | T | F | unless $req_data = $cgi->param('data')
213 | 50 | T | F | if (length $req_data > $POST_LEN_LIMIT)
219 | 100 | T | F | if ($http_meth eq 'POST' and $url =~ s[^=/put/][=/]) { }
| 100 | T | F | elsif ($http_meth =~ /^(?:GET|POST)$/ and $url =~ s[^=/delete/][=/]) { }
| 100 | T | F | elsif ($http_meth eq 'GET' and $url =~ s[^=/(post|put)/][=/]) { }
236 | 100 | T | F | if ($req_data)
269 | 50 | T | F | if ($$self{'_no_response'})
274 | 100 | T | F | if ($cookie_data)
284 | 50 | T | F | $as_html ? :
287 | 100 | T | F | if (my $bin_data = $$self{'_bin_data'})
289 | 100 | T | F | $type =~ /text/ ? :
| 50 | T | F | @cookies ? :
293 | 100 | T | F | if (my $callback = $$self{'_callback'}) { }
301 | 100 | T | F | if ($$self{'_error'}) { }
| 50 | T | F | elsif ($$self{'_data'}) { }
305 | 100 | T | F | if ($$self{'_warning'})
321 | 100 | T | F | if (my $var = $$self{'_var'} and $Dumper eq \&JSON::Syck::Dump) { }
| 100 | T | F | elsif (my $callback = $$self{'_callback'} and $Dumper eq \&JSON::Syck::Dump) { }
328 | 50 | T | F | if ($as_html)
332 | 100 | T | F | if ($$self{'_http_method'} =~ /^(?:PUT|POST)$/)
333 | 50 | T | F | length $str > 1024 ? :
339 | 50 | T | F | $type =~ /text/ ? :
| 100 | T | F | @cookies ? :
383 | 100 | T | F | defined $_[0] && $_[0] =~ /^[A-Za-z]\w*$/ ? :