Condition Coverage

blib/lib/Hypersonic.pm
Criterion Covered Total %
condition 91 264 34.4


and 3 conditions

line !l l&&!r l&&r condition
274 0 0 0 builtin::blessed($handler) && ($handler->can('build_before') || $handler->can('build_after'))
283 0 0 0 builtin::blessed($handler) && ($handler->can('build_before') || $handler->can('build_after'))
559 1 0 0 builtin::blessed($mw) and $mw->can('build_before') || $mw->can('build_after')
566 1 0 0 builtin::blessed($mw) and $mw->can('build_before') || $mw->can('build_after')
675 1 0 23 defined $body and not ref $body
1070 0 11 3 $self->{'enable_security_headers'} and $has_dynamic
1296 0 0 0 ref $result eq "HASH" and $result->{'xs_function'}
1374 1 0 2 $analysis->{'needs_streaming'} and $self->{'_streaming_flags'}
1384 14 0 0 $analysis->{'needs_websocket'} and $self->{'_websocket_paths'}
1426 0 11 3 $self->{'enable_security_headers'} and $has_dynamic
1438 14 0 0 $analysis->{'needs_xs_builder'} and $self->{'_xs_builder_routes'}
0 0 0 $analysis->{'needs_xs_builder'} and $self->{'_xs_builder_routes'} and @{$self->{'_xs_builder_routes'};}
1487 6 0 0 $r->{'need_xs_builder'} and $r->{'_xs_result'}
1983 3 0 0 $analysis->{'needs_xs_builder'} and $self->{'_xs_builder_routes'}
0 0 0 $analysis->{'needs_xs_builder'} and $self->{'_xs_builder_routes'} and @{$self->{'_xs_builder_routes'};}
3188 7 0 0 not $prefix =~ m[/$] and $prefix =~ m[^(.*/)[^/]+$]
3343 120 0 160 defined $value and length $value
3383 0 0 0 $^O eq "MSWin32" and $workers > 1

or 2 conditions

line l !l condition
50 1 41 $opts{'security_headers'} // {}
100 26 16 $opts{'cache_dir'} // "_hypersonic_cache"
0 42 $opts{'host'} // "0.0.0.0"
3 39 $opts{'port'} // 8080
0 42 $opts{'tls'} // 0
0 42 $opts{'http2'} // 0
1 41 $opts{'max_connections'} // 10000
1 41 $opts{'max_request_size'} // 8192
1 41 $opts{'keepalive_timeout'} // 30
1 41 $opts{'recv_timeout'} // 30
0 42 $opts{'websocket_rooms'} // 0
0 42 $opts{'max_rooms'} // 1000
0 42 $opts{'max_clients_per_room'} // 10000
1 41 $opts{'drain_timeout'} // 5
1 41 $security_headers->{'X-Frame-Options'} // "DENY"
0 42 $security_headers->{'X-Content-Type-Options'} // "nosniff"
0 42 $security_headers->{'X-XSS-Protection'} // "1; mode=block"
0 42 $security_headers->{'Referrer-Policy'} // "strict-origin-when-cross-origin"
0 0 $security_headers->{'Strict-Transport-Security'} // "max-age=31536000; includeSubDomains"
1 41 $opts{'enable_security_headers'} // 1
115 0 1 $path //= "/health"
128 0 1 $path //= "/ready"
144 2 2 $self->{'websocket_routes'} //= []
156 1 14 $self->{'websocket_routes'} // []
163 3 0 $self->{'websocket_routes'} // []
194 0 0 $opts //= {}
203 0 0 $self->{'static_dirs'} //= []
210 0 0 $opts->{'max_age'} // 3600
0 0 $opts->{'index'} // "index.html"
0 0 $opts->{'etag'} // 1
0 0 $opts->{'gzip'} // 0
263 0 0 $ext // ""
0 0 $MIME_TYPES{lc($ext // "")} // "application/octet-stream"
339 0 0 $opts{'workers'} // 8
0 0 $opts{'queue_size'} // 4096
343 0 0 $self->{'_async_pools'} //= []
436 0 47 $opts->{'before'} // []
0 47 $opts->{'after'} // []
445 0 1 $self->{'static_dirs'} // []
496 6 0 $route->{'features'} // {}
663 1 0 $status //= 200
664 1 0 $headers //= {}
666 7 1 $result->{'status'} // 200
667 1 7 $result->{'headers'} // {}
668 8 0 $result->{'body'} // ""
793 14 0 $] || ''
885 0 0 $compile_opts{'extra_cflags'} // ""
886 0 0 $compile_opts{'extra_ldflags'} // ""
893 0 0 $compile_opts{'extra_cflags'} // ""
894 0 0 $compile_opts{'extra_ldflags'} // ""
899 0 0 $compile_opts{'extra_cflags'} // ""
900 0 0 $compile_opts{'extra_ldflags'} // ""
907 14 0 $backend->extra_cflags // ""
908 0 0 $compile_opts{'extra_cflags'} // ""
912 14 0 $backend->extra_ldflags // ""
913 0 0 $compile_opts{'extra_ldflags'} // ""
922 0 0 $compile_opts{'extra_ldflags'} // ""
950 0 0 $compile_opts{'extra_ldflags'} // ""
963 0 0 $compile_opts{'extra_ldflags'} // ""
1123 0 0 $config->{'min_size'} // 1024
1124 0 0 $config->{'level'} // 6
1272 0 0 $self->{'_async_config'} // {}
1274 0 0 $async_config->{'max_futures'} // 65536
1278 0 0 $async_config->{'workers'} // 8
0 0 $async_config->{'queue_size'} // 4096
1351 3 0 $self->{'route_param_info'} // []
1356 6 0 $route_params[$i] // []
1671 14 0 $analysis->{'has_body_access'} // 0
2061 0 0 $self->{'_xs_builder_routes'} || []
2782 0 0 $config->{'min_size'} // 1024
3227 0 0 $STATUS_TEXT{$code} // "Unknown"
3376 0 0 $opts{'workers'} // 1

or 3 conditions

line l !l&&r !l&&!r condition
120 0 1 0 $handler //= sub { return "{\"status\":\"ok\"}"; }
132 0 1 0 $handler //= sub { return "{\"ready\":true}"; }
275 0 0 0 ref $handler eq "CODE" or $is_builder
284 0 0 0 ref $handler eq "CODE" or $is_builder
445 16 0 1 @{$self->{'routes'};} or @{$self->{'static_dirs'} // [];}
527 0 0 30 @{$route->{'before'};} or @{$route->{'after'};}
559 0 0 0 $mw->can('build_before') || $mw->can('build_after')
566 0 0 0 $mw->can('build_before') || $mw->can('build_after')
604 0 0 14 $analysis{'has_global_before'} || $analysis{'has_global_after'} || $analysis{'has_builder_before'} || $analysis{'has_builder_after'} || $analysis{'has_route_middleware'}
758 1 0 13 $analysis->{'has_global_before'} or $analysis->{'has_global_after'}
931 0 14 0 $ENV{'HYPERSONIC_COMPILE_DIAG'} or $ENV{'AUTOMATED_TESTING'}
984 0 14 0 $self->{'event_backend'} // "Hypersonic::Event"->best_backend
2161 0 0 3 $analysis->{'needs_query'} or $analysis->{'needs_form'}
2221 0 1 2 $analysis->{'needs_headers'} or $analysis->{'needs_cookies'}
1 0 2 $analysis->{'needs_headers'} or $analysis->{'needs_cookies'} or $analysis->{'needs_json'}
0 0 2 $analysis->{'needs_headers'} or $analysis->{'needs_cookies'} or $analysis->{'needs_json'} or $analysis->{'needs_form'}
2258 0 0 3 $analysis->{'has_builder_before'} or $analysis->{'has_builder_after'}
2419 0 0 2 $analysis->{'needs_headers'} || $analysis->{'needs_cookies'} || $analysis->{'needs_json'} || $analysis->{'needs_form'}
2464 0 1 0 $analysis->{'needs_form'} or $analysis->{'needs_json'}
3167 3 3 0 $DEPARSER //= "B::Deparse"->new("-q")
3374 0 0 0 $opts{'host'} // $self->{'host'}
3375 0 0 0 $opts{'port'} // $self->{'port'}